![]() |
XII Release 0.1.0
|
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 (xiiEnum< xiiGALResourceFormat > sourceFormat, xiiEnum< xiiGALResourceFormat > targetFormat) |
| Checks if there is a known conversion path between the two formats. | |
| static xiiEnum< xiiGALResourceFormat > | FindClosestCompatibleFormat (xiiEnum< xiiGALResourceFormat > format, xiiArrayPtr< const xiiEnum< xiiGALResourceFormat > > pCompatibleFormats) |
| Finds the image format from a given list of formats which is the cheapest to convert to. | |
| static xiiResult | BuildPath (xiiEnum< xiiGALResourceFormat > sourceFormat, xiiEnum< xiiGALResourceFormat > targetFormat, bool bSourceEqualsTarget, xiiHybridArray< ConversionPathNode, 16 > &out_path, xiiUInt32 &out_uiNumScratchBuffers) |
| static xiiResult | Convert (const xiiImageView &source, xiiImage &ref_target, xiiEnum< xiiGALResourceFormat > 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 > pPath, xiiUInt32 uiNumScratchBuffers) |
| Converts the source image into a target image using a precomputed conversion path. | |
| static xiiResult | ConvertRaw (xiiConstByteBlobPtr pSource, xiiByteBlobPtr pTarget, xiiUInt32 uiElementCount, xiiEnum< xiiGALResourceFormat > sourceFormat, xiiEnum< xiiGALResourceFormat > 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 pSource, xiiByteBlobPtr pTarget, xiiUInt32 uiElementCount, xiiArrayPtr< ConversionPathNode > pPath, xiiUInt32 uiNumScratchBuffers) |
| Converts the raw source data into a target data buffer using a precomputed conversion path. | |
Helper class containing utilities to convert between different image formats and layouts.
|
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.
| sourceFormat | The source format. |
| targetFormat | The target format. |
| sourceEqualsTarget | If 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_path | The generated path. |
| out_numScratchBuffers | The number of scratch buffers required for the conversion path. |