@@ -127,7 +127,7 @@ private void OnFrameApplyCore(
127127 in verticalOperation ) ;
128128
129129 // Compute the horizontal 1D convolutions and accumulate the partial results on the target buffer
130- var horizontalOperation = new ApplyHorizontalConvolutionRowOperation ( sourceRectangle , processingBuffer , firstPassBuffer , kernel , parameters . Z , parameters . W ) ;
130+ var horizontalOperation = new BokehBlurProcessor . ApplyHorizontalConvolutionRowOperation ( sourceRectangle , processingBuffer , firstPassBuffer , kernel , parameters . Z , parameters . W ) ;
131131 ParallelRowIterator . IterateRows (
132132 configuration ,
133133 sourceRectangle ,
@@ -175,52 +175,6 @@ public void Invoke(int y)
175175 }
176176 }
177177
178- /// <summary>
179- /// A <see langword="struct"/> implementing the horizontal convolution logic for <see cref="BokehBlurProcessor{T}"/>.
180- /// </summary>
181- private readonly struct ApplyHorizontalConvolutionRowOperation : IRowOperation
182- {
183- private readonly Rectangle bounds ;
184- private readonly Buffer2D < Vector4 > targetValues ;
185- private readonly Buffer2D < ComplexVector4 > sourceValues ;
186- private readonly Complex64 [ ] kernel ;
187- private readonly float z ;
188- private readonly float w ;
189- private readonly int maxY ;
190- private readonly int maxX ;
191-
192- [ MethodImpl ( InliningOptions . ShortMethod ) ]
193- public ApplyHorizontalConvolutionRowOperation (
194- Rectangle bounds ,
195- Buffer2D < Vector4 > targetValues ,
196- Buffer2D < ComplexVector4 > sourceValues ,
197- Complex64 [ ] kernel ,
198- float z ,
199- float w )
200- {
201- this . bounds = bounds ;
202- this . maxY = this . bounds . Bottom - 1 ;
203- this . maxX = this . bounds . Right - 1 ;
204- this . targetValues = targetValues ;
205- this . sourceValues = sourceValues ;
206- this . kernel = kernel ;
207- this . z = z ;
208- this . w = w ;
209- }
210-
211- /// <inheritdoc/>
212- [ MethodImpl ( InliningOptions . ShortMethod ) ]
213- public void Invoke ( int y )
214- {
215- Span < Vector4 > targetRowSpan = this . targetValues . GetRowSpan ( y ) . Slice ( this . bounds . X ) ;
216-
217- for ( int x = 0 ; x < this . bounds . Width ; x ++ )
218- {
219- Buffer2DUtils . Convolve4AndAccumulatePartials ( this . kernel , this . sourceValues , targetRowSpan , y , x , this . bounds . Y , this . maxY , this . bounds . X , this . maxX , this . z , this . w ) ;
220- }
221- }
222- }
223-
224178 /// <summary>
225179 /// A <see langword="struct"/> implementing the gamma exposure logic for <see cref="BokehBlurProcessor{T}"/>.
226180 /// </summary>
@@ -304,7 +258,7 @@ public void Invoke(int y)
304258 for ( int x = 0 ; x < this . bounds . Width ; x ++ )
305259 {
306260 ref Vector4 v = ref Unsafe . Add ( ref sourceRef , x ) ;
307- var clamp = Numerics . Clamp ( v , low , high ) ;
261+ Vector4 clamp = Numerics . Clamp ( v , low , high ) ;
308262 v . X = MathF . Pow ( clamp . X , this . inverseGamma ) ;
309263 v . Y = MathF . Pow ( clamp . Y , this . inverseGamma ) ;
310264 v . Z = MathF . Pow ( clamp . Z , this . inverseGamma ) ;
0 commit comments