@@ -145,9 +145,9 @@ private static void ProcessCornerTile(
145145 Span < TPixel > rowSpan = source . GetPixelRowSpan ( dy ) ;
146146 for ( int dx = xStart ; dx < xEnd ; dx ++ )
147147 {
148- TPixel pixel = rowSpan [ dx ] ;
148+ ref TPixel pixel = ref rowSpan [ dx ] ;
149149 float luminanceEqualized = cdfData . RemapGreyValue ( cdfX , cdfY , GetLuminance ( pixel , luminanceLevels ) ) ;
150- rowSpan [ dx ] . FromVector4 ( new Vector4 ( luminanceEqualized , luminanceEqualized , luminanceEqualized , pixel . ToVector4 ( ) . W ) ) ;
150+ pixel . FromVector4 ( new Vector4 ( luminanceEqualized , luminanceEqualized , luminanceEqualized , pixel . ToVector4 ( ) . W ) ) ;
151151 }
152152 }
153153 }
@@ -191,9 +191,9 @@ private static void ProcessBorderColumn(
191191 Span < TPixel > rowSpan = source . GetPixelRowSpan ( dy ) ;
192192 for ( int dx = xStart ; dx < xEnd ; dx ++ )
193193 {
194- TPixel pixel = rowSpan [ dx ] ;
194+ ref TPixel pixel = ref rowSpan [ dx ] ;
195195 float luminanceEqualized = InterpolateBetweenTwoTiles ( pixel , cdfData , cdfX , cdfY , cdfX , cdfY + 1 , tileY , tileHeight , luminanceLevels ) ;
196- rowSpan [ dx ] . FromVector4 ( new Vector4 ( luminanceEqualized , luminanceEqualized , luminanceEqualized , pixel . ToVector4 ( ) . W ) ) ;
196+ pixel . FromVector4 ( new Vector4 ( luminanceEqualized , luminanceEqualized , luminanceEqualized , pixel . ToVector4 ( ) . W ) ) ;
197197 }
198198
199199 tileY ++ ;
@@ -243,9 +243,9 @@ private static void ProcessBorderRow(
243243 int xLimit = Math . Min ( x + tileWidth , sourceWidth - 1 ) ;
244244 for ( int dx = x ; dx < xLimit ; dx ++ )
245245 {
246- TPixel pixel = rowSpan [ dx ] ;
246+ ref TPixel pixel = ref rowSpan [ dx ] ;
247247 float luminanceEqualized = InterpolateBetweenTwoTiles ( pixel , cdfData , cdfX , cdfY , cdfX + 1 , cdfY , tileX , tileWidth , luminanceLevels ) ;
248- rowSpan [ dx ] . FromVector4 ( new Vector4 ( luminanceEqualized , luminanceEqualized , luminanceEqualized , pixel . ToVector4 ( ) . W ) ) ;
248+ pixel . FromVector4 ( new Vector4 ( luminanceEqualized , luminanceEqualized , luminanceEqualized , pixel . ToVector4 ( ) . W ) ) ;
249249 tileX ++ ;
250250 }
251251 }
@@ -423,7 +423,7 @@ public void Invoke(in RowInterval rows)
423423 int tileX = 0 ;
424424 for ( int dx = x ; dx < xEnd ; dx ++ )
425425 {
426- TPixel pixel = rowSpan [ dx ] ;
426+ ref TPixel pixel = ref rowSpan [ dx ] ;
427427 float luminanceEqualized = InterpolateBetweenFourTiles (
428428 pixel ,
429429 this . cdfData ,
@@ -437,7 +437,7 @@ public void Invoke(in RowInterval rows)
437437 this . tileHeight ,
438438 this . luminanceLevels ) ;
439439
440- rowSpan [ dx ] . FromVector4 ( new Vector4 ( luminanceEqualized , luminanceEqualized , luminanceEqualized , pixel . ToVector4 ( ) . W ) ) ;
440+ pixel . FromVector4 ( new Vector4 ( luminanceEqualized , luminanceEqualized , luminanceEqualized , pixel . ToVector4 ( ) . W ) ) ;
441441 tileX ++ ;
442442 }
443443
0 commit comments