@@ -216,18 +216,18 @@ public static void ProcessRgbScanline<TPixel>(
216216 int bytesPerPixel ,
217217 int bytesPerSample ,
218218 Color ? transparentColor )
219- where TPixel : unmanaged, IPixel < TPixel > =>
220- ProcessInterlacedRgbScanline (
221- configuration ,
222- bitDepth ,
223- frameControl ,
224- scanlineSpan ,
225- rowSpan ,
226- 0 ,
227- 1 ,
228- bytesPerPixel ,
229- bytesPerSample ,
230- transparentColor ) ;
219+ where TPixel : unmanaged, IPixel < TPixel > =>
220+ ProcessInterlacedRgbScanline (
221+ configuration ,
222+ bitDepth ,
223+ frameControl ,
224+ scanlineSpan ,
225+ rowSpan ,
226+ 0 ,
227+ 1 ,
228+ bytesPerPixel ,
229+ bytesPerSample ,
230+ transparentColor ) ;
231231
232232 public static void ProcessInterlacedRgbScanline < TPixel > (
233233 Configuration configuration ,
@@ -264,9 +264,16 @@ public static void ProcessInterlacedRgbScanline<TPixel>(
264264 Unsafe . Add ( ref rowSpanRef , x ) = pixel;
265265 }
266266 }
267+ else if ( pixelOffset == 0 && increment == 1 )
268+ {
269+ PixelOperations < TPixel > . Instance . FromRgb24Bytes (
270+ configuration ,
271+ scanlineSpan [ ..( int ) ( frameControl . Width * bytesPerPixel ) ] ,
272+ rowSpan . Slice ( ( int ) frameControl . XOffset , ( int ) frameControl . Width ) ,
273+ ( int ) frameControl . Width ) ;
274+ }
267275 else
268276 {
269- // TODO: Investigate reintroducing bulk operations optimization here.
270277 Rgb24 rgb = default ;
271278 int o = 0 ;
272279 for ( nuint x = offset ; x < frameControl . XMax ; x += increment , o += bytesPerPixel )
@@ -323,24 +330,27 @@ public static void ProcessInterlacedRgbScanline<TPixel>(
323330 }
324331
325332 public static void ProcessRgbaScanline < TPixel > (
333+ Configuration configuration ,
326334 int bitDepth ,
327335 in FrameControl frameControl ,
328336 ReadOnlySpan < byte > scanlineSpan ,
329337 Span < TPixel > rowSpan ,
330338 int bytesPerPixel ,
331339 int bytesPerSample )
332- where TPixel : unmanaged, IPixel < TPixel > =>
333- ProcessInterlacedRgbaScanline (
334- bitDepth ,
335- frameControl ,
336- scanlineSpan ,
337- rowSpan ,
338- 0 ,
339- 1 ,
340- bytesPerPixel ,
341- bytesPerSample ) ;
340+ where TPixel : unmanaged, IPixel < TPixel > =>
341+ ProcessInterlacedRgbaScanline (
342+ configuration ,
343+ bitDepth ,
344+ frameControl ,
345+ scanlineSpan ,
346+ rowSpan ,
347+ 0 ,
348+ 1 ,
349+ bytesPerPixel ,
350+ bytesPerSample ) ;
342351
343352 public static void ProcessInterlacedRgbaScanline < TPixel > (
353+ Configuration configuration ,
344354 int bitDepth ,
345355 in FrameControl frameControl ,
346356 ReadOnlySpan < byte > scanlineSpan ,
@@ -370,9 +380,16 @@ public static void ProcessInterlacedRgbaScanline<TPixel>(
370380 Unsafe . Add ( ref rowSpanRef , x ) = pixel;
371381 }
372382 }
383+ else if ( pixelOffset == 0 && increment == 1 )
384+ {
385+ PixelOperations < TPixel > . Instance . FromRgba32Bytes (
386+ configuration ,
387+ scanlineSpan [ ..( int ) ( frameControl . Width * bytesPerPixel ) ] ,
388+ rowSpan . Slice ( ( int ) frameControl . XOffset , ( int ) frameControl . Width ) ,
389+ ( int ) frameControl . Width ) ;
390+ }
373391 else
374392 {
375- // TODO: Investigate reintroducing bulk operations optimization here.
376393 ref byte scanlineSpanRef = ref MemoryMarshal . GetReference ( scanlineSpan ) ;
377394 Rgba32 rgba = default ;
378395 int o = 0 ;
0 commit comments