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. |
DetermineIsGammaFromName(string)
Determine if a texture has gamma correction from the file name of the path.
Declaration
public static bool? DetermineIsGammaFromName(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | The path of the image file. |
Returns
| Type | Description |
|---|---|
| bool? | Tue if the name suggests that the texture has gamma correction. False if the name suggests that the texture has linear encoding. Null if the name doesn't help determine the encoding. |
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, SKColorType)
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, SKColorType colorType)
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. |
| SKColorType | colorType | Color type. |
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. |