enum Gloop::PixelType

Overview

Describes how components of a pixel are stored in memory.

Defined in:

gloop/pixel_type.cr

Enum Members

Int8 = 5120_u32

Each component is stored as a signed 8-bit integer.

UInt8 = 5121_u32

Each component is stored as an unsigned 8-bit integer.

Int16 = 5122_u32

Each component is stored as a signed 16-bit integer.

UInt16 = 5123_u32

Each component is stored as an unsigned 16-bit integer.

Int32 = 5124_u32

Each component is stored as a signed 32-bit integer.

UInt32 = 5125_u32

Each component is stored as an unsigned 32-bit integer.

Float32 = 5126_u32

Each component is stored as a 32-bit floating-point number.

UInt8R3G3B2 = 32818_u32

Three components stored in 8 bits.

3 bits for red, 3 bits for green, and 2 bits for blue.

UInt16R4G4B4A4 = 32819_u32

Four components stored in 16 bits.

4 bits for each component.

UInt16R5G5B5A1 = 32820_u32

Four components stored in 16 bits.

4 bits each for red, green, and blue and 1 bit for alpha.

UInt32R8G8B8A8 = 32821_u32

Four components stored in 32 bits.

8 bits for each component.

UInt32R10G10B10A2 = 32822_u32

Four components stored in 32 bits.

8 bits each for red, green, and blue and 2 bits for alpha.

Constructors

Instance Method Summary

Constructor Detail

def self.new(value : Symbol) #

Creates a pixel type from a symbol.

This is intended to be used as a workaround for Crystal's limitations and auto-generated names.


[View source]

Instance Method Detail

def float32? #

[View source]
def int16? #

[View source]
def int32? #

[View source]
def int8? #

[View source]
def to_unsafe #

Converts to an OpenGL enum.


[View source]
def u_int16? #

[View source]
def u_int16_r4_g4_b4_a4? #

[View source]
def u_int16_r5_g5_b5_a1? #

[View source]
def u_int32? #

[View source]
def u_int32_r10_g10_b10_a2? #

[View source]
def u_int32_r8_g8_b8_a8? #

[View source]
def u_int8? #

[View source]
def u_int8_r3_g3_b2? #

[View source]