콘텐츠로 이동

IImageFilterContext interface

이 콘텐츠는 아직 번역되지 않았습니다.

Per-evaluation environment passed to Execute. Provides access to the source layer (resolved by SourceFilter / null inputs), a scratch render-target pool, and graph factory for backend resource creation.

public interface IImageFilterContext
name description
Factory { get; } Gets the factory used to create backend resources such as image views over scratch surfaces.
LogicalToPixelScaleX { get; } Conversion factor from filter input coordinates (logical/DIP) to source-layer pixel coordinates along X. Matches the effective scale at which the input was rasterized into Source (= user transform x DPI for image filters). Executors multiply per-axis filter parameters specified in input units (Blur sigma, Offset dx) by this factor before applying GPU/CPU passes so that filter radii track the current transform.
LogicalToPixelScaleY { get; } Same as LogicalToPixelScaleX for the Y axis.
Source { get; } Image the executor treats as the layer being filtered. Returned for SourceFilter nodes and any null input slot. Wrapped as a BorrowedFilterResult so callers can using-dispose uniformly without releasing the underlying source.
SourceBounds { get; } Bounds of the source image in user coordinates. Used by nodes that compute output extent from input bounds (Blur halo inflation, Offset translation).
AcquireScratch(…) Rents a scratch render surface sized at least (pixelWidth, pixelHeight) from the pool. The returned ScratchFilterResult automatically releases the surface on Dispose. Callers must render INTO the scratch before returning it as the node’s output.
WithSource(…) Returns a sub-context whose Source is replaced with newSource. Used by ComposeFilter to chain Inner→Outer without aliasing or recursive bookkeeping.

WithSource creates a sub-context whose Source is replaced - used by ComposeFilter evaluation: the inner filter runs against the original source, and the outer filter runs against the inner’s result. The sub-context shares the same scratch pool / factory.