Class ImageHelpers
This static class represent the image helpers.
Inherited Members
Namespace: Evergine.Framework.Assets.Extensions
Assembly: Evergine.Framework.dll
Syntax
public static class ImageHelpers
Methods
FromBGR24ToRGBA32(byte[], int, int)
Convert BGR to RGBA.
Declaration
public static byte[] FromBGR24ToRGBA32(byte[] bytes, int width, int height)
Parameters
Type | Name | Description |
---|---|---|
byte[] | bytes | The BGR bytes. |
int | width | Image width. |
int | height | Image height. |
Returns
Type | Description |
---|---|
byte[] | The RGBA bytes. |
FromBGRA32ToRGBA32(ref byte[])
Convert BGRA to RGBA.
Declaration
public static byte[] FromBGRA32ToRGBA32(ref byte[] bytes)
Parameters
Type | Name | Description |
---|---|---|
byte[] | bytes | The brga bytes. |
Returns
Type | Description |
---|---|
byte[] | The rgba bytes. |
FromRGB24ToRGBA32(byte[], int, int)
Convert RGB to RGBA.
Declaration
public static byte[] FromRGB24ToRGBA32(byte[] bytes, int width, int height)
Parameters
Type | Name | Description |
---|---|---|
byte[] | bytes | The RGB bytes. |
int | width | Image width. |
int | height | Image height. |
Returns
Type | Description |
---|---|
byte[] | The RGBA bytes. |
ReadLittleEndianInt16(BinaryReader)
Read int16 from binaryReader.
Declaration
public static short ReadLittleEndianInt16(BinaryReader binaryReader)
Parameters
Type | Name | Description |
---|---|---|
BinaryReader | binaryReader | binary reader. |
Returns
Type | Description |
---|---|
short | int16 data. |
ReadLittleEndianInt32(BinaryReader)
Read int32 from binary reader.
Declaration
public static int ReadLittleEndianInt32(BinaryReader binaryReader)
Parameters
Type | Name | Description |
---|---|---|
BinaryReader | binaryReader | binary reader. |
Returns
Type | Description |
---|---|
int | int32 data. |
ReadLittleEndianUInt16(BinaryReader)
Read UInt16 from binary reader.
Declaration
public static ushort ReadLittleEndianUInt16(BinaryReader binaryReader)
Parameters
Type | Name | Description |
---|---|---|
BinaryReader | binaryReader | binary reader. |
Returns
Type | Description |
---|---|
ushort | uint16 data. |
ReadStruct<T>(BinaryReader)
Read struct from a binary reader.
Declaration
public static T ReadStruct<T>(BinaryReader reader)
Parameters
Type | Name | Description |
---|---|---|
BinaryReader | reader | The binary reader. |
Returns
Type | Description |
---|---|
T | The readed struct value. |
Type Parameters
Name | Description |
---|---|
T | The type to read. |
StartsWith(byte[], byte[])
Starts with.
Declaration
public static bool StartsWith(byte[] thisBytes, byte[] thatBytes)
Parameters
Type | Name | Description |
---|---|---|
byte[] | thisBytes | source byte array. |
byte[] | thatBytes | pattern byte array. |
Returns
Type | Description |
---|---|
bool | if thisBytes start with thatBytes. |