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 pixels array.
Declaration
public static SKBitmap CreateBitmapFromPixelsArray(SKImageInfo info, byte[] pixels)
Parameters
Type | Name | Description |
---|---|---|
SKImageInfo | info | Image info. |
byte[] | pixels | Pixels array. |
Returns
Type | Description |
---|---|
SKBitmap | Bitmap with loaded pixels. |
CreateBitmapFromPixelsPointer(SKImageInfo, IntPtr)
Creates a bitmap from pixels pointer.
Declaration
public static SKBitmap CreateBitmapFromPixelsPointer(SKImageInfo info, IntPtr pixels)
Parameters
Type | Name | Description |
---|---|---|
SKImageInfo | info | Image info. |
IntPtr | pixels | Pixels array pointer. |
Returns
Type | Description |
---|---|
SKBitmap | Bitmap with loaded pixels. |
FillDataPartFromBitmap(SKBitmap, TextureDataPart, bool)
Fills the data part from ImageSharp 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 | Premultiply the alpha. |
FillDataPartFromBitmap(SKBitmap, TextureDataPart, int, int, bool)
Fills the data part from 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 | Index of the texture. |
int | mipmapIndex | Index of the mipmap. |
bool | premultiplyAlpha | Premultiply the alpha. |
FillDataPartFromPixelsArray(int, int, byte[], TextureDataPart, int, int, bool)
Fills the data part from 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 a textureInfo.
Declaration
public static TextureDataPart TextureDataFromAsset(TextureMetaFile textureMeta, TextureInfoPart outTexInfo)
Parameters
Type | Name | Description |
---|---|---|
TextureMetaFile | textureMeta | The texture metafile. |
TextureInfoPart | outTexInfo | The texture info part. |
Returns
Type | Description |
---|---|
TextureDataPart | The result 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 metafile. |
TextureProfile | profile | The desired profile. |
Returns
Type | Description |
---|---|
TextureInfoPart | The result 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 metafile. |
string | profileName | The desired profile name. |
Returns
Type | Description |
---|---|
TextureInfoPart | The result texture info part from the asset. |