Class RenderExtensions
- Namespace
- Icy.Rendering
- Assembly
- IcyUI.dll
Provides extension methods for rendering operations on textures.
public static class RenderExtensions
- Inheritance
-
RenderExtensions
- Inherited Members
Methods
GetTextureData<TColor>(ITexture, Rectangle?, TColor[])
Gets the colors stored in the texture, reading data in the format represented by the TColor struct.
public static void GetTextureData<TColor>(this ITexture texture, Rectangle? region, TColor[] buffer) where TColor : struct
Parameters
textureITextureThe texture instance to read data from.
regionRectangle?The section of the texture from which the data will be copied. null indicates that the data will be copied from the entire texture.
bufferTColor[]The array to receive texture data. If
regionis null, the number of elements in the array must be equal to the Size; otherwise, the number of elements in the array should be equal to the size of the specified rectangle.
Type Parameters
TColorThe type of the color used to read texture data. It must be a value type.
GetTextureData<TColor>(ITexture, TColor[])
Gets the colors stored in the entire texture, reading data in the format represented by the TColor struct.
public static void GetTextureData<TColor>(this ITexture texture, TColor[] buffer) where TColor : struct
Parameters
textureITextureThe texture instance to read data from.
bufferTColor[]The array to receive texture data. The number of elements in the array must be equal to the Size.
Type Parameters
TColorThe type of the color used to read texture data. It must be a value type.
Modify<TColor>(ITexture, Func<TColor, TColor>)
Modifies the colors in the entire texture using a specified modifier function.
public static void Modify<TColor>(this ITexture texture, Func<TColor, TColor> modifier) where TColor : struct
Parameters
textureITextureThe texture instance to modify.
modifierFunc<TColor, TColor>A function that takes a color of type
TColorand returns a modified color of the same type.
Type Parameters
TColorThe type of the color used to modify texture data. It must be a value type.
Remarks
This method retrieves the current texture data into a temporary buffer, applies the modifier function to each color, and then writes the modified data back to the entire texture.
Modify<TColor>(ITexture, Rectangle?, Func<TColor, TColor>)
Modifies the colors in the texture using a specified modifier function, applying it to a specified region of the texture.
public static void Modify<TColor>(this ITexture texture, Rectangle? region, Func<TColor, TColor> modifier) where TColor : struct
Parameters
textureITextureThe texture instance to modify.
regionRectangle?The section of the texture to modify. null indicates that the entire texture will be modified.
modifierFunc<TColor, TColor>A function that takes a color of type
TColorand returns a modified color of the same type.
Type Parameters
TColorThe type of the color used to modify texture data. It must be a value type.
Remarks
This method retrieves the current texture data into a temporary buffer, applies the modifier function to each color, and then writes the modified data back to the specified region of the texture.
SetTextureData<TColor>(ITexture, Rectangle?, TColor[])
Sets the colors in the texture, writing data in the format represented by the TColor struct.
public static void SetTextureData<TColor>(this ITexture texture, Rectangle? region, TColor[] buffer) where TColor : struct
Parameters
textureITextureThe texture instance to write data to.
regionRectangle?The section of the texture where the data will be written. null indicates that the data will be written to the entire texture.
bufferTColor[]The array containing the texture data to write. If
regionis null, the number of elements in the array must be equal to the Size; otherwise, the number of elements in the array should be equal to the size of the specified rectangle.
Type Parameters
TColorThe type of the color used to write texture data. It must be a value type.
SetTextureData<TColor>(ITexture, TColor[])
Sets the colors in the entire texture, writing data in the format represented by the TColor struct.
public static void SetTextureData<TColor>(this ITexture texture, TColor[] buffer) where TColor : struct
Parameters
textureITextureThe texture instance to write data to.
bufferTColor[]The array containing the texture data to write. The number of elements in the array must be equal to the Size.
Type Parameters
TColorThe type of the color used to write texture data. It must be a value type.