XII Release 0.1.0
Loading...
Searching...
No Matches
xiiImageConversion Class Reference

Helper class containing utilities to convert between different image formats and layouts. More...

#include <ImageConversion.h>

Classes

struct  ConversionPathNode
 A single node along a computed conversion path. More...
 

Static Public Member Functions

static bool IsConvertible (xiiImageFormat::Enum sourceFormat, xiiImageFormat::Enum targetFormat)
 Checks if there is a known conversion path between the two formats.
 
static xiiImageFormat::Enum FindClosestCompatibleFormat (xiiImageFormat::Enum format, xiiArrayPtr< const xiiImageFormat::Enum > compatibleFormats)
 Finds the image format from a given list of formats which is the cheapest to convert to.
 
static xiiResult BuildPath (xiiImageFormat::Enum sourceFormat, xiiImageFormat::Enum targetFormat, bool bSourceEqualsTarget, xiiHybridArray< ConversionPathNode, 16 > &out_path, xiiUInt32 &out_uiNumScratchBuffers)
 Precomputes an optimal conversion path between two formats and the minimal number of required scratch buffers.
 
static xiiResult Convert (const xiiImageView &source, xiiImage &ref_target, xiiImageFormat::Enum targetFormat)
 Converts the source image into a target image with the given format. Source and target may be the same.
 
static xiiResult Convert (const xiiImageView &source, xiiImage &ref_target, xiiArrayPtr< ConversionPathNode > path, xiiUInt32 uiNumScratchBuffers)
 Converts the source image into a target image using a precomputed conversion path.
 
static xiiResult ConvertRaw (xiiConstByteBlobPtr source, xiiByteBlobPtr target, xiiUInt32 uiNumElements, xiiImageFormat::Enum sourceFormat, xiiImageFormat::Enum targetFormat)
 Converts the raw source data into a target data buffer with the given format. Source and target may be the same.
 
static xiiResult ConvertRaw (xiiConstByteBlobPtr source, xiiByteBlobPtr target, xiiUInt32 uiNumElements, xiiArrayPtr< ConversionPathNode > path, xiiUInt32 uiNumScratchBuffers)
 Converts the raw source data into a target data buffer using a precomputed conversion path.
 

Detailed Description

Helper class containing utilities to convert between different image formats and layouts.

Member Function Documentation

◆ BuildPath()

xiiResult xiiImageConversion::BuildPath ( xiiImageFormat::Enum sourceFormat,
xiiImageFormat::Enum targetFormat,
bool bSourceEqualsTarget,
xiiHybridArray< ConversionPathNode, 16 > & out_path,
xiiUInt32 & out_uiNumScratchBuffers )
static

Precomputes an optimal conversion path between two formats and the minimal number of required scratch buffers.

The generated path can be cached by the user if the same conversion is performed multiple times. The path must not be reused if the set of supported conversions changes, e.g. when plugins are loaded or unloaded.

Parameters
sourceFormatThe source format.
targetFormatThe target format.
sourceEqualsTargetIf true, the generated path is applicable if source and target memory regions are equal, and may contain additional copy-steps if the conversion can't be performed in-place. A path generated with sourceEqualsTarget == true will work correctly even if source and target are not the same, but may not be optimal. A path generated with sourceEqualsTarget == false will not work correctly when source and target are the same.
out_pathThe generated path.
out_numScratchBuffersThe number of scratch buffers required for the conversion path.
Returns
xii_SUCCESS if a path was found, xii_FAILURE otherwise.

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