IndexImagingBLPixelConverter
BLPixelConverter Class Referencefinal

Pixel converter [C++ API].

Provides an interface to convert pixels between various pixel formats. The primary purpose of this class is to allow efficient conversion between pixel formats used natively by Blend2D and pixel formats used elsewhere, for example image codecs or native framebuffers.

Note
A default-initialized converter has a valid conversion function that would return BL_ERROR_NOT_INITIALIZED if invoked. Use isInitialized() member function to test whether the pixel converter was properly initialized.

Member Functions

Additional Inherited Members

- Public Attributes inherited from BLPixelConverterCore

BLPixelConverter::BLPixelConverter()noexcept[1/2][¶]

Creates a new default-initialized pixel converter.

BLPixelConverter::BLPixelConverter(
const BLPixelConverter& other
)noexcept[2/2][¶]

Creates a copy of the other converter.

If the other converter has dynamically allocated resources they will be properly managed (reference counting). Only very specific converters require such resources so this operation should be considered very cheap.

BLPixelConverter::~BLPixelConverter()noexcept[¶]

Destroys the pixel-converter and releases all resources allocated by it.

bool BLPixelConverter::isInitialized() constnoexcept[¶]

Tests whether if the converter is initialized.

BLResult BLPixelConverter::reset()noexcept[¶]

Reset the pixel converter.

BLResult BLPixelConverter::assign(
const BLPixelConverter& other
)noexcept[¶]

Assigns the other pixel converter into this one.

BLResult BLPixelConverter::create(
const BLFormatInfo& dstInfo,
const BLFormatInfo& srcInfo,
)noexcept[¶]

Creates a new pixel converter that will convert pixels described by srcInfo into pixels described by dstInfo.

Use createFlags to further specify the parameters of the conversion.

Note
Destination and source format informattion must be valid, otherwise BL_ERROR_INVALID_VALUE would be returned.

BLResult BLPixelConverter::convertSpan(
void* dstData,
const void* srcData,
uint32_t w,
const BLPixelConverterOptions* options = nullptr
) constnoexcept[¶]

Converts a single span of pixels of w width.

BLResult BLPixelConverter::convertRect(
void* dstData,
intptr_t dstStride,
const void* srcData,
intptr_t srcStride,
uint32_t w,
uint32_t h,
const BLPixelConverterOptions* options = nullptr
) constnoexcept[¶]

Converts a rectangular area of pixels from source format to destination.