Class ImageHelpers
This static class represents the image helpers.
Namespace: Evergine.Framework.Assets.Extensions
Assembly: Evergine.Framework.dll
Syntax
public static class ImageHelpers
Methods
FromBGR24ToRGBA32(byte[], int, int)
Converts 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 | The image width. |
int | height | The image height. |
Returns
Type | Description |
---|---|
byte[] | The RGBA bytes. |
FromBGRA32ToRGBA32(ref byte[])
Converts BGRA to RGBA.
Declaration
public static byte[] FromBGRA32ToRGBA32(ref byte[] bytes)
Parameters
Type | Name | Description |
---|---|---|
byte[] | bytes | The BGRA bytes. |
Returns
Type | Description |
---|---|
byte[] | The RGBA bytes. |
FromRGB24ToRGBA32(byte[], int, int)
Converts 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 | The image width. |
int | height | The image height. |
Returns
Type | Description |
---|---|
byte[] | The RGBA bytes. |
ReadLittleEndianInt16(BinaryReader)
Reads an Int16 from the binary reader.
Declaration
public static short ReadLittleEndianInt16(BinaryReader binaryReader)
Parameters
Type | Name | Description |
---|---|---|
BinaryReader | binaryReader | Binary reader. |
Returns
Type | Description |
---|---|
short | Int16 data. |
ReadLittleEndianInt32(BinaryReader)
Reads an Int32 from the binary reader.
Declaration
public static int ReadLittleEndianInt32(BinaryReader binaryReader)
Parameters
Type | Name | Description |
---|---|---|
BinaryReader | binaryReader | The binary reader. |
Returns
Type | Description |
---|---|
int | Int32 data. |
ReadLittleEndianUInt16(BinaryReader)
Reads a UInt16 from a binary reader.
Declaration
public static ushort ReadLittleEndianUInt16(BinaryReader binaryReader)
Parameters
Type | Name | Description |
---|---|---|
BinaryReader | binaryReader | The binary reader. |
Returns
Type | Description |
---|---|
ushort | The UInt16 data. |
ReadStruct<T>(BinaryReader)
Reads a 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 read 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 | True if thisBytes starts with thatBytes. |