@@ -17,7 +17,7 @@ public abstract partial class Image
1717 {
1818 /// <summary>
1919 /// <para>
20- /// Wraps an existing contiguous memory area of 'width' x 'height' pixels allowing viewing/manipulation as
20+ /// Wraps an existing contiguous memory area of at least 'width' x 'height' pixels allowing viewing/manipulation as
2121 /// an <see cref="Image{TPixel}"/> instance.
2222 /// </para>
2323 /// <para>
@@ -52,15 +52,15 @@ public static Image<TPixel> WrapMemory<TPixel>(
5252 {
5353 Guard . NotNull ( configuration , nameof ( configuration ) ) ;
5454 Guard . NotNull ( metadata , nameof ( metadata ) ) ;
55- Guard . IsTrue ( pixelMemory . Length == width * height , nameof ( pixelMemory ) , "The length of the input memory doesn't match the specified image size" ) ;
55+ Guard . IsTrue ( pixelMemory . Length >= width * height , nameof ( pixelMemory ) , "The length of the input memory is less than the specified image size" ) ;
5656
5757 var memorySource = MemoryGroup < TPixel > . Wrap ( pixelMemory ) ;
5858 return new Image < TPixel > ( configuration , memorySource , width , height , metadata ) ;
5959 }
6060
6161 /// <summary>
6262 /// <para>
63- /// Wraps an existing contiguous memory area of 'width' x 'height' pixels allowing viewing/manipulation as
63+ /// Wraps an existing contiguous memory area of at least 'width' x 'height' pixels allowing viewing/manipulation as
6464 /// an <see cref="Image{TPixel}"/> instance.
6565 /// </para>
6666 /// <para>
@@ -93,7 +93,7 @@ public static Image<TPixel> WrapMemory<TPixel>(
9393
9494 /// <summary>
9595 /// <para>
96- /// Wraps an existing contiguous memory area of 'width' x 'height' pixels allowing viewing/manipulation as
96+ /// Wraps an existing contiguous memory area of at least 'width' x 'height' pixels allowing viewing/manipulation as
9797 /// an <see cref="Image{TPixel}"/> instance.
9898 /// </para>
9999 /// <para>
@@ -122,7 +122,7 @@ public static Image<TPixel> WrapMemory<TPixel>(
122122 => WrapMemory ( Configuration . Default , pixelMemory , width , height ) ;
123123
124124 /// <summary>
125- /// Wraps an existing contiguous memory area of 'width' x 'height' pixels,
125+ /// Wraps an existing contiguous memory area of at least 'width' x 'height' pixels,
126126 /// allowing to view/manipulate it as an <see cref="Image{TPixel}"/> instance.
127127 /// The ownership of the <paramref name="pixelMemoryOwner"/> is being transferred to the new <see cref="Image{TPixel}"/> instance,
128128 /// meaning that the caller is not allowed to dispose <paramref name="pixelMemoryOwner"/>.
@@ -147,14 +147,14 @@ public static Image<TPixel> WrapMemory<TPixel>(
147147 {
148148 Guard . NotNull ( configuration , nameof ( configuration ) ) ;
149149 Guard . NotNull ( metadata , nameof ( metadata ) ) ;
150- Guard . IsTrue ( pixelMemoryOwner . Memory . Length == width * height , nameof ( pixelMemoryOwner ) , "The length of the input memory doesn't match the specified image size" ) ;
150+ Guard . IsTrue ( pixelMemoryOwner . Memory . Length >= width * height , nameof ( pixelMemoryOwner ) , "The length of the input memory is less than the specified image size" ) ;
151151
152152 var memorySource = MemoryGroup < TPixel > . Wrap ( pixelMemoryOwner ) ;
153153 return new Image < TPixel > ( configuration , memorySource , width , height , metadata ) ;
154154 }
155155
156156 /// <summary>
157- /// Wraps an existing contiguous memory area of 'width' x 'height' pixels,
157+ /// Wraps an existing contiguous memory area of at least 'width' x 'height' pixels,
158158 /// allowing to view/manipulate it as an <see cref="Image{TPixel}"/> instance.
159159 /// The ownership of the <paramref name="pixelMemoryOwner"/> is being transferred to the new <see cref="Image{TPixel}"/> instance,
160160 /// meaning that the caller is not allowed to dispose <paramref name="pixelMemoryOwner"/>.
@@ -176,7 +176,7 @@ public static Image<TPixel> WrapMemory<TPixel>(
176176 => WrapMemory ( configuration , pixelMemoryOwner , width , height , new ImageMetadata ( ) ) ;
177177
178178 /// <summary>
179- /// Wraps an existing contiguous memory area of 'width' x 'height' pixels,
179+ /// Wraps an existing contiguous memory area of at least 'width' x 'height' pixels,
180180 /// allowing to view/manipulate it as an <see cref="Image{TPixel}"/> instance.
181181 /// The ownership of the <paramref name="pixelMemoryOwner"/> is being transferred to the new <see cref="Image{TPixel}"/> instance,
182182 /// meaning that the caller is not allowed to dispose <paramref name="pixelMemoryOwner"/>.
@@ -196,7 +196,7 @@ public static Image<TPixel> WrapMemory<TPixel>(
196196
197197 /// <summary>
198198 /// <para>
199- /// Wraps an existing contiguous memory area of 'width' x 'height' pixels allowing viewing/manipulation as
199+ /// Wraps an existing contiguous memory area of at least 'width' x 'height' pixels allowing viewing/manipulation as
200200 /// an <see cref="Image{TPixel}"/> instance.
201201 /// </para>
202202 /// <para>
@@ -234,15 +234,15 @@ public static Image<TPixel> WrapMemory<TPixel>(
234234
235235 var memoryManager = new ByteMemoryManager < TPixel > ( byteMemory ) ;
236236
237- Guard . IsTrue ( memoryManager . Memory . Length == width * height , nameof ( byteMemory ) , "The length of the input memory doesn't match the specified image size" ) ;
237+ Guard . IsTrue ( memoryManager . Memory . Length >= width * height , nameof ( byteMemory ) , "The length of the input memory is less than the specified image size" ) ;
238238
239239 var memorySource = MemoryGroup < TPixel > . Wrap ( memoryManager . Memory ) ;
240240 return new Image < TPixel > ( configuration , memorySource , width , height , metadata ) ;
241241 }
242242
243243 /// <summary>
244244 /// <para>
245- /// Wraps an existing contiguous memory area of 'width' x 'height' pixels allowing viewing/manipulation as
245+ /// Wraps an existing contiguous memory area of at least 'width' x 'height' pixels allowing viewing/manipulation as
246246 /// an <see cref="Image{TPixel}"/> instance.
247247 /// </para>
248248 /// <para>
@@ -275,7 +275,7 @@ public static Image<TPixel> WrapMemory<TPixel>(
275275
276276 /// <summary>
277277 /// <para>
278- /// Wraps an existing contiguous memory area of 'width' x 'height' pixels allowing viewing/manipulation as
278+ /// Wraps an existing contiguous memory area of at least 'width' x 'height' pixels allowing viewing/manipulation as
279279 /// an <see cref="Image{TPixel}"/> instance.
280280 /// </para>
281281 /// <para>
@@ -305,7 +305,7 @@ public static Image<TPixel> WrapMemory<TPixel>(
305305
306306 /// <summary>
307307 /// <para>
308- /// Wraps an existing contiguous memory area of 'width' x 'height' pixels allowing viewing/manipulation as
308+ /// Wraps an existing contiguous memory area of at least 'width' x 'height' pixels allowing viewing/manipulation as
309309 /// an <see cref="Image{TPixel}"/> instance.
310310 /// </para>
311311 /// <para>
@@ -355,7 +355,7 @@ public static unsafe Image<TPixel> WrapMemory<TPixel>(
355355
356356 /// <summary>
357357 /// <para>
358- /// Wraps an existing contiguous memory area of 'width' x 'height' pixels allowing viewing/manipulation as
358+ /// Wraps an existing contiguous memory area of at least 'width' x 'height' pixels allowing viewing/manipulation as
359359 /// an <see cref="Image{TPixel}"/> instance.
360360 /// </para>
361361 /// <para>
@@ -393,7 +393,7 @@ public static unsafe Image<TPixel> WrapMemory<TPixel>(
393393
394394 /// <summary>
395395 /// <para>
396- /// Wraps an existing contiguous memory area of 'width' x 'height' pixels allowing viewing/manipulation as
396+ /// Wraps an existing contiguous memory area of at least 'width' x 'height' pixels allowing viewing/manipulation as
397397 /// an <see cref="Image{TPixel}"/> instance.
398398 /// </para>
399399 /// <para>
0 commit comments