Table of Contents

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

texture ITexture

The texture instance to read data from.

region Rectangle?

The section of the texture from which the data will be copied. null indicates that the data will be copied from the entire texture.

buffer TColor[]

The array to receive texture data. If region is 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

TColor

The 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

texture ITexture

The texture instance to read data from.

buffer TColor[]

The array to receive texture data. The number of elements in the array must be equal to the Size.

Type Parameters

TColor

The 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

texture ITexture

The texture instance to modify.

modifier Func<TColor, TColor>

A function that takes a color of type TColor and returns a modified color of the same type.

Type Parameters

TColor

The 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

texture ITexture

The texture instance to modify.

region Rectangle?

The section of the texture to modify. null indicates that the entire texture will be modified.

modifier Func<TColor, TColor>

A function that takes a color of type TColor and returns a modified color of the same type.

Type Parameters

TColor

The 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

texture ITexture

The texture instance to write data to.

region Rectangle?

The section of the texture where the data will be written. null indicates that the data will be written to the entire texture.

buffer TColor[]

The array containing the texture data to write. If region is 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

TColor

The 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

texture ITexture

The texture instance to write data to.

buffer TColor[]

The array containing the texture data to write. The number of elements in the array must be equal to the Size.

Type Parameters

TColor

The type of the color used to write texture data. It must be a value type.