Enumeration PixelFormat

Pixel formats usable by images, textures and render surfaces.

Constructors

  • Parameters

    • do_not_: undefined
    • construct_: undefined
    • this_: undefined
    • type_: undefined

    Returns PixelFormat

Values

BC1 = 13

DXT1/BC1 format containing opaque RGB. 4 bits per pixel.

BC2 = 15

DXT3/BC2 format containing RGB with explicit alpha. 8 bits per pixel.

BC3 = 16

DXT5/BC2 format containing RGB with explicit alpha. 8 bits per pixel. Better alpha gradients than BC2.

BC4 = 17

One channel compressed format. 4 bits per pixel.

BC5 = 18

Two channel compressed format. 8 bits per pixel.

BC6H = 19

Format storing RGB in half (16-bit) signed floating point format usable for HDR. 8 bits per pixel.

BC7 = 20

Format storing RGB with optional alpha channel. Similar to BC1/BC2/BC3 formats but with higher quality and higher decompress overhead. 8 bits per pixel.

BGR8 = 4

8-bit 3-channel pixel format, unsigned normalized.

Most GPUs do not support it and the format will have to be converted to RGBA8. Usage is discouraged.

BGRA8 = 7

8-bit 4-channel pixel format, unsigned normalized.

D16 = 32

Depth format, 16bits. Unsigned normalized.

D24S8 = 30

Depth stencil fomrat, 24bit depth + 8bit stencil. Depth stored as unsigned normalized.

D32 = 31

Depth format, 32bits. Signed float.

D32_S8X24 = 29

Depth stencil format, 32bit depth, 8bit stencil + 24 unused. Depth stored as signed float.

R16 = 61

16-bit 1-channel pixel format, unsigned normalized.

R16F = 21

16-bit 1-channel pixel format, signed float.

R16I = 44

16-bit 1-channel pixel format, signed integer.

R16S = 58

16-bit 1-channel pixel format, signed normalized.

R16U = 47

16-bit 1-channel pixel format, unsigned integer.

R32F = 25

32-bit 1-channel pixel format, signed float.

R32I = 50

32-bit 1-channel pixel format, signed integer.

R32U = 54

32-bit 1-channel pixel format, unsigned integer.

R8 = 1

8-bit 1-channel pixel format, unsigned normalized.

R8I = 35

8-bit 1-channel pixel format, signed integer.

R8S = 41

8-bit 1-channel pixel format, signed normalized.

R8U = 38

8-bit 1-channel pixel format, unsigned integer.

RG11B10F = 33

Packed unsigned float format, 11 bits for red, 11 bits for green, 10 bits for blue.

RG16 = 62

16-bit 2-channel pixel format, unsigned normalized.

RG16F = 22

16-bit 2-channel pixel format, signed float.

RG16I = 45

16-bit 2-channel pixel format, signed integer.

RG16S = 59

16-bit 2-channel pixel format, signed normalized.

RG16U = 48

16-bit 2-channel pixel format, unsigned integer.

RG32F = 26

32-bit 2-channel pixel format, signed float.

RG32I = 51

32-bit 2-channel pixel format, signed integer.

RG32U = 55

32-bit 2-channel pixel format, unsigned integer.

RG8 = 2

8-bit 2-channel pixel format, unsigned normalized.

RG8I = 36

8-bit 2-channel pixel format, signed integer.

RG8S = 42

8-bit 2-channel pixel format, signed normalized.

RG8U = 39

8-bit 2-channel pixel format, unsigned integer.

Rgb10a2 = 34

Packed unsigned normalized format, 10 bits for red, 10 bits for green, 10 bits for blue, and two bits for alpha.

RGB16 = 63

16-bit 3-channel pixel format, unsigned normalized.

RGB32F = 27

32-bit 3-channel pixel format, signed float.

RGB32I = 52

32-bit 3-channel pixel format, signed integer.

RGB32U = 56

32-bit 3-channel pixel format, unsigned integer.

RGB8 = 3

8-bit 3-channel pixel format, unsigned normalized.

Most GPUs do not support it and the format will have to be converted to RGBA8. Usage is discouraged.

RGBA16 = 64

16-bit 4-channel pixel format, unsigned normalized.

RGBA16F = 24

16-bit 4-channel pixel format, signed float.

RGBA16I = 46

16-bit 4-channel pixel format, signed integer.

RGBA16S = 60

16-bit 4-channel pixel format, signed normalized.

RGBA16U = 49

16-bit 4-channel pixel format, unsigned integer.

RGBA32F = 28

32-bit 4-channel pixel format, signed float.

RGBA32I = 53

32-bit 4-channel pixel format, signed integer.

RGBA32U = 57

32-bit 4-channel pixel format, unsigned integer.

RGBA8 = 8

8-bit 4-channel pixel format, unsigned normalized.

RGBA8I = 37

8-bit 4-channel pixel format, signed integer.

RGBA8S = 43

8-bit 4-channel pixel format, signed normalized.

RGBA8U = 40

8-bit 4-channel pixel format, unsigned integer.

Unknown = 0

Unknown pixel format.

Methods

  • Takes an array of enum values and combines them as a single enum flag value. This assumes that the target enum is a flag enum that can have their values combined using bitwise operators.

    Type Parameters

    Parameters

    Returns EnumValueTyped<T, number>

    The combined enum value.

  • Type Parameters

    • T

    Parameters

    Returns string

    Compatibility

  • Returns string[]

    Compatibility

  • Parameters

    • index: number

    Returns number

    Compatibility

  • Returns number[]

    Compatibility

  • Gets the name for the enumeration value that matches the specified enumValue.

    Type Parameters

    • T

    Parameters

    Returns string

    The enumeration value or undefined if not found.

  • Gets the enumeration names

    Returns string[]

    The enumeration names.

  • Gets the enumeration value at the specified index.

    Type Parameters

    • T = number

    Parameters

    • index: number

      The index.

    Returns EnumValueTyped<T, number>

    The enumeration value or undefined if not found.

  • Determines if the enum value has the flags set.

    Type Parameters

    Parameters

    Returns boolean

  • Determines if the enum bits were changed from previousValue to currentValue.

    Type Parameters

    Parameters

    Returns boolean

  • Iterates the enumeration names

    Returns Generator<string, any, any>

    The enumeration names.

  • Iterates the enumeration values

    Type Parameters

    • T = any

    Returns Generator<EnumValueTyped<T, number>, any, any>

    The enumeration values.

  • Takes a single enum value and splits it into separated flag values set on the value. This assumes that the target enum is a flag enum that can have their values combined using bitwise operators.

    Type Parameters

    Parameters

    • value: number | BrandedType<number, "enum"> | BrandedType<T, "enum">

      The enum value to have it's value split using bitwise-and operator.

    Returns EnumValueTyped<T, number>[]

    An array of each "bit flag" set in the enum.