Namespace: Rx – Class: TPixel – Header: Rx.Core.Ex/Rx.InlinePixel.h

TPixel Struct

C++
#include "Rx.Core.Ex/Rx.InlinePixel.h"

template<typename TDataType, unsigned tuColorCnt, unsigned tuAlphaCnt, int tiR, int tiG, int tiB, int tiA, EPixelType tePT, EDataType teDT>
struct TPixel

General pixel template structure.

This structure allows the definition of all possible pixel types in such a way, that template functions working on different image types can be written.

Template Parameters

TDataType

The data type of the pixel components.

tuColorCnt

The number of color components.

tuAlphaCnt

The number of alpha components. This is usually 0 or 1.

tiR

The index of the red component. This is 0 for RGBA.

tiG

The index of the green component. This is 1 for RGBA.

tiB

The index of the blue component. This is 2 for RGBA.

tiA

The index of the alpha component. This is 3 for RGBA.

tePT

The pixel type ID.

teDT

The data type ID.

Constructors

TPixel()

Default constructor with uninitialized values.

Methods

Clear()

Sets all components to zero.

IsNaN()

Queries if at least one of the pixel components is NaN.

IsZero()

Queries if all pixel components are zero.

r()

Gets the red component of this pixel.

r()

Gets the red component of this pixel.

g()

Gets the green component of this pixel.

g()

Gets the green component of this pixel.

b()

Gets the blue component of this pixel.

b()

Gets the blue component of this pixel.

a()

Gets the alpha component of this pixel.

a()

Gets the alpha component of this pixel.

x()

Gets the red component of this pixel.

x()

Gets the red component of this pixel.

y()

Gets the green component of this pixel.

y()

Gets the green component of this pixel.

z()

Gets the blue component of this pixel.

z()

Gets the blue component of this pixel.

w()

Gets the alpha component of this pixel.

w()

Gets the alpha component of this pixel.

Static Methods

IsOfType(ePixelType, eDataType)

Queries if this pixel class is of the given pixel type and data type.

Operators

operator=(xPixel)

Assignment operator.

Variables

value

The values for each pixel component.

Static Variables

PixelType

The pixel type ID of this pixel class.

DataType

The data type ID of this pixel class.

uColorCnt

The number of color components of this pixel class.

uAlphaCnt

The number of alpha components of this pixel class.

uCompoCnt

The number of components of this pixel class.

uColorSize

The size of all color components in bytes.

uAlphaSize

The size of all alpha components in bytes.

uSize

The size of all components in bytes.

Typedefs

TType

The data type of this pixel class.