API Documentation
Static Public Member Functions | List of all members
nkImages::PixelFormatUtils Class Referencefinal

Utility class to translate enum values into linked useful data. More...

Static Public Member Functions

static PIXEL_FORMAT getRgbFromBgrFormat (PIXEL_FORMAT format)
 
static PIXEL_FORMAT getEquivalentAlphaFormat (PIXEL_FORMAT format)
 
static PIXEL_FORMAT getEquivalentNoAlphaFormat (PIXEL_FORMAT format)
 
static unsigned int getFormatByteSize (PIXEL_FORMAT format)
 
static unsigned int getFormatCompressionRatioWidth (PIXEL_FORMAT format)
 
static unsigned int getFormatCompressionRatioHeight (PIXEL_FORMAT format)
 
static bool isFormatCompressed (PIXEL_FORMAT format)
 
static bool isFormatFloatingPoint (PIXEL_FORMAT format)
 
static bool hasAlpha (PIXEL_FORMAT format)
 

Detailed Description

Utility class to translate enum values into linked useful data.

Member Function Documentation

◆ getRgbFromBgrFormat()

static PIXEL_FORMAT nkImages::PixelFormatUtils::getRgbFromBgrFormat ( PIXEL_FORMAT  format)
static

Provides an RGB format its BGR format equivalent, if available.

Parameters
formatThe format to convert.
Returns
The BGR equivalent of format provided if available, the format if unavailable.

◆ getEquivalentAlphaFormat()

static PIXEL_FORMAT nkImages::PixelFormatUtils::getEquivalentAlphaFormat ( PIXEL_FORMAT  format)
static

Provides a format with its equivalent with the alpha channel.

Parameters
formatThe format to convert.
Returns
The alpha enabled equivalent format if available, the format if unavailable.

◆ getEquivalentNoAlphaFormat()

static PIXEL_FORMAT nkImages::PixelFormatUtils::getEquivalentNoAlphaFormat ( PIXEL_FORMAT  format)
static

Provides a format with its equivalent without the alpha channel.

Parameters
formatThe format to convert.
Returns
The alpha disabled equivalent format if available, the format if unavailable.

◆ getFormatByteSize()

static unsigned int nkImages::PixelFormatUtils::getFormatByteSize ( PIXEL_FORMAT  format)
static

Translates a pixel format into its byte size, if it were to be tightly packed.

Parameters
formatThe format value to retrieve the size from.
Returns
The format size, in bytes.

◆ getFormatCompressionRatioWidth()

static unsigned int nkImages::PixelFormatUtils::getFormatCompressionRatioWidth ( PIXEL_FORMAT  format)
static

Provides with the compression ratio of a format on the X direction.

Parameters
formatThe format value to retrieve the ratio for.
Returns
The compression ratio, in bytes.

◆ getFormatCompressionRatioHeight()

static unsigned int nkImages::PixelFormatUtils::getFormatCompressionRatioHeight ( PIXEL_FORMAT  format)
static

Provides with the compression ratio of a format on the Y direction.

Parameters
formatThe format value to retrieve the ratio for.
Returns
The compression ratio, in bytes.

◆ isFormatCompressed()

static bool nkImages::PixelFormatUtils::isFormatCompressed ( PIXEL_FORMAT  format)
static

Allows to check if a format is considered as compressed.

Parameters
formatThe format to check.
Returns
Whether the format is compressed (true) or not (false).
Remarks
Compressed formats are for now the BCx variants.

◆ isFormatFloatingPoint()

static bool nkImages::PixelFormatUtils::isFormatFloatingPoint ( PIXEL_FORMAT  format)
static

Allows to check if a format is using floating point values.

Parameters
formatThe format to check.
Returns
Whether the format is using floating point numbers (true) or not (false).

◆ hasAlpha()

static bool nkImages::PixelFormatUtils::hasAlpha ( PIXEL_FORMAT  format)
static

Allows to check if a format has an alpha channel.

Parameters
formatThe format to check.
Returns
Whether the format has an alpha channel (true) or not (false).

The documentation for this class was generated from the following file: