using System; using System.Drawing; namespace ComputeSharp.D2D1; /// /// An providing support for custom, stateful draw transform mappings for shaders. /// public interface ID2D1TransformMapper where T : unmanaged, ID2D1PixelShader { /// /// /// Allows a transform to state how it would map a a set of sample rectangles on its input to an output rectangle. /// /// /// This is effectively the inverse mapping of . /// /// /// The input D2D1 pixel shader being executed on the current effect (this can be used to retrieve shader properties). /// The input rectangles to be mapped to the output rectangle. This parameter is always equal to the input bounds. /// The input rectangles to be mapped to the opaque output rectangle. /// The output rectangle that maps to the corresponding input rectangle. /// The output rectangle that maps to the corresponding opaque input rectangle. /// /// /// Unlike and , this method is explicitly called by the renderer at /// a determined place in its rendering algorithm. The transform implementation may change its state based on the input rectangles /// and use this information to control its rendering information. This method is always called before the /// and methods. /// /// /// For more info, see . /// /// void MapInputsToOutput( in T shader, ReadOnlySpan inputs, ReadOnlySpan opaqueInputs, out Rectangle output, out Rectangle opaqueOutput); /// /// Allows a transform to state how it would map a rectangle requested on its output to a set of sample rectangles on its input. /// /// The output rectangle from which the inputs must be mapped. /// The corresponding set of inputs. The inputs will directly correspond to the transform inputs. /// /// /// The transform implementation must regard this method as purely functional. It can base the mapped input and output rectangles on its /// current state as specified by the encapsulating effect properties. However, it must not change its own state in response to this method /// being invoked. The Direct2D renderer implementation reserves the right to call this method at any time and in any sequence. /// /// /// For more info, see . /// /// void MapOutputToInputs(in Rectangle output, Span inputs); /// /// Sets the input rectangles for this rendering pass into the transform. /// /// The index of the input rectangle. /// The invalid input rectangle. /// The output rectangle to which the input rectangle must be mapped. /// /// /// The transform implementation must regard this method as purely functional. The transform implementation can base the mapped input rectangle on /// the transform implementation's current state as specified by the encapsulating effect properties. But the transform implementation can't change /// its own state in response to a call to . Direct2D can call this method at any time /// and in any sequence following a call to . /// /// /// For more info, see . /// /// void MapInvalidOutput(int inputIndex, Rectangle invalidInput, out Rectangle invalidOutput); }