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

Utility class offering helpers for conversions. More...

Static Public Member Functions

static nkMaths::Vector convertPixel (const nkMaths::Vector &pix, PIXEL_FORMAT inFormat, PIXEL_FORMAT outFormat)
 
static Image convertImage (const ImageView &image, PIXEL_FORMAT outFormat, const AlignmentDescriptor &alignmentDescriptor=AlignmentDescriptor())
 

Detailed Description

Utility class offering helpers for conversions.

Member Function Documentation

◆ convertPixel()

static nkMaths::Vector nkImages::ConversionUtils::convertPixel ( const nkMaths::Vector pix,
PIXEL_FORMAT  inFormat,
PIXEL_FORMAT  outFormat 
)
static

Converts a pixel from one format to another.

Parameters
pixThe pixel to convert.
inFormatProvided pixel's format.
outFormatWhich format to convert to.
Returns
The converted pixel, expressed in its outFormat.

◆ convertImage()

static Image nkImages::ConversionUtils::convertImage ( const ImageView image,
PIXEL_FORMAT  outFormat,
const AlignmentDescriptor alignmentDescriptor = AlignmentDescriptor() 
)
static

Converts a full image from one format to another.

Parameters
imageThe image to convert.
outFormatThe format to convert to.
alignmentDescriptorThe alignment constraint the output image should respect. Only the byte alignment fields are taken into account.
Returns
A new image fitting the alignment constraints, in the format requested.
Remarks
Currently, the conversion takes into account only the first mip and the first image in an array. It is also only supporting YUV to RGB typed format conversions.

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