Class TextureAssetHelper
The texture asset helper class.
Namespace: Evergine.Assets
Assembly: Evergine.Assets.dll
Syntax
public class TextureAssetHelper
Methods
CreateBitmapFromPixelsArray(SKImageInfo, byte[])
Creates a bitmap from a pixel array.
Declaration
public static SKBitmap CreateBitmapFromPixelsArray(SKImageInfo info, byte[] pixels)
Parameters
Type | Name | Description |
---|---|---|
SKImageInfo | info | Image info. |
byte[] | pixels | Pixel array. |
Returns
Type | Description |
---|---|
SKBitmap | Bitmap with loaded pixels. |
CreateBitmapFromPixelsPointer(SKImageInfo, nint)
Creates a bitmap from a pixels pointer.
Declaration
public static SKBitmap CreateBitmapFromPixelsPointer(SKImageInfo info, nint pixels)
Parameters
Type | Name | Description |
---|---|---|
SKImageInfo | info | Image information. |
nint | pixels | Pointer to the pixels array. |
Returns
Type | Description |
---|---|
SKBitmap | A bitmap with the loaded pixels. |
FillDataPartFromBitmap(SKBitmap, TextureDataPart, bool)
Fills the data part from an SkiaSharp bitmap.
Declaration
public static void FillDataPartFromBitmap(SKBitmap bitmap, TextureDataPart dataPart, bool premultiplyAlpha)
Parameters
Type | Name | Description |
---|---|---|
SKBitmap | bitmap | The bitmap. |
TextureDataPart | dataPart | The data part. |
bool | premultiplyAlpha | Premultiplies the alpha. |
FillDataPartFromBitmap(SKBitmap, TextureDataPart, int, int, bool)
Fills the data part from a SkiaSharp bitmap.
Declaration
public static void FillDataPartFromBitmap(SKBitmap bitmap, TextureDataPart dataPart, int textureIndex, int mipmapIndex, bool premultiplyAlpha)
Parameters
Type | Name | Description |
---|---|---|
SKBitmap | bitmap | The bitmap. |
TextureDataPart | dataPart | The data part. |
int | textureIndex | The index of the texture. |
int | mipmapIndex | The index of the mipmap. |
bool | premultiplyAlpha | Premultiplies the alpha. |
FillDataPartFromPixelsArray(int, int, byte[], TextureDataPart, int, int, bool)
Fills the data part from the pixels array.
Declaration
public static void FillDataPartFromPixelsArray(int width, int height, byte[] pixels, TextureDataPart textureData, int textureIndex, int mipmapIndex, bool premultiplyAlpha)
Parameters
Type | Name | Description |
---|---|---|
int | width | Image width. |
int | height | Image height. |
byte[] | pixels | Pixels array. |
TextureDataPart | textureData | The data part. |
int | textureIndex | Index of the texture. |
int | mipmapIndex | Index of the mipmap. |
bool | premultiplyAlpha | Premultiply the alpha. |
TextureDataFromAsset(TextureMetaFile, TextureInfoPart)
Generates the TextureDataPart object from a texture meta file and texture info.
Declaration
public static TextureDataPart TextureDataFromAsset(TextureMetaFile textureMeta, TextureInfoPart outTexInfo)
Parameters
Type | Name | Description |
---|---|---|
TextureMetaFile | textureMeta | The texture meta file. |
TextureInfoPart | outTexInfo | The texture info part. |
Returns
Type | Description |
---|---|
TextureDataPart | The resulting TextureDataPart object. |
TextureInfoFromAsset(TextureMetaFile, TextureProfile)
Gets an exported TextureInfo part from an asset.
Declaration
public static TextureInfoPart TextureInfoFromAsset(TextureMetaFile texture, TextureProfile profile)
Parameters
Type | Name | Description |
---|---|---|
TextureMetaFile | texture | The texture metadata file. |
TextureProfile | profile | The desired profile. |
Returns
Type | Description |
---|---|
TextureInfoPart | The resulting texture info part from the asset. |
TextureInfoFromAsset(TextureMetaFile, string)
Gets an exported TextureInfo part from an asset.
Declaration
public static TextureInfoPart TextureInfoFromAsset(TextureMetaFile texture, string profileName)
Parameters
Type | Name | Description |
---|---|---|
TextureMetaFile | texture | The texture metadata file. |
string | profileName | The desired profile name. |
Returns
Type | Description |
---|---|
TextureInfoPart | The resulting TextureInfo part from the asset. |