Imaging API

Images and image codecs.

Classes

BLFormat - Constants

BLImage - Constants

BLImageCodec - Constants

BLPixelConverter - Constants

BLFormat - Globals

BLFormat - C API

BLImage - C API

BLImageCodec - C API

BLImageDecoder - C API

BLImageEncoder - C API

BLPixelConverter - C API

Enumeration Type Documentation

BLFormat : uint32_tenum◆ 

Pixel format.

Compatibility Table

+---------------------+---------------------+-----------------------------+
| Blend2D Format | Cairo Format | QImage::Format |
+---------------------+---------------------+-----------------------------+
| BL_FORMAT_PRGB32 | CAIRO_FORMAT_ARGB32 | Format_ARGB32_Premultiplied |
| BL_FORMAT_XRGB32 | CAIRO_FORMAT_RGB24 | Format_RGB32 |
| BL_FORMAT_A8 | CAIRO_FORMAT_A8 | n/a |
+---------------------+---------------------+-----------------------------+
ConstantDescription
BL_FORMAT_NONE 

None or invalid pixel format.

BL_FORMAT_PRGB32 

32-bit premultiplied ARGB pixel format (8-bit components).

BL_FORMAT_XRGB32 

32-bit (X)RGB pixel format (8-bit components, alpha ignored).

BL_FORMAT_A8 

8-bit alpha-only pixel format.

BLFormatFlags : uint32_tenum◆ 

Pixel format flags.

ConstantDescription
BL_FORMAT_NO_FLAGS 

No flags.

BL_FORMAT_FLAG_RGB 

Pixel format provides RGB components.

BL_FORMAT_FLAG_ALPHA 

Pixel format provides only alpha component.

BL_FORMAT_FLAG_RGBA 

A combination of BL_FORMAT_FLAG_RGB | BL_FORMAT_FLAG_ALPHA.

BL_FORMAT_FLAG_LUM 

Pixel format provides LUM component (and not RGB components).

BL_FORMAT_FLAG_LUMA 

A combination of BL_FORMAT_FLAG_LUM | BL_FORMAT_FLAG_ALPHA.

BL_FORMAT_FLAG_INDEXED 

Indexed pixel format the requires a palette (I/O only).

BL_FORMAT_FLAG_PREMULTIPLIED 

RGB components are premultiplied by alpha component.

BL_FORMAT_FLAG_BYTE_SWAP 

Pixel format doesn't use native byte-order (I/O only).

BL_FORMAT_FLAG_BYTE_ALIGNED 

Pixel components are byte aligned (all 8bpp).

BL_FORMAT_FLAG_UNDEFINED_BITS 

Pixel has some undefined bits that represent no information.

For example a 32-bit XRGB pixel has 8 undefined bits that are usually set to all ones so the format can be interpreted as premultiplied RGB as well. There are other formats like 16_0555 where the bit has no information and is usually set to zero. Blend2D doesn't rely on the content of such bits.

BL_FORMAT_FLAG_LE 

Convenience flag that contains either zero or BL_FORMAT_FLAG_BYTE_SWAP depending on host byte order. Little endian hosts have this flag set to zero and big endian hosts to BL_FORMAT_FLAG_BYTE_SWAP.

Note
This is not a real flag that you can test, it's only provided for convenience to define little endian pixel formats.
BL_FORMAT_FLAG_BE 

Convenience flag that contains either zero or BL_FORMAT_FLAG_BYTE_SWAP depending on host byte order. Big endian hosts have this flag set to zero and little endian hosts to BL_FORMAT_FLAG_BYTE_SWAP.

Note
This is not a real flag that you can test, it's only provided for convenience to define big endian pixel formats.

BLImageInfoFlags : uint32_tenum◆ 

Flags used by BLImageInfo.

ConstantDescription
BL_IMAGE_INFO_FLAG_NO_FLAGS 

No flags.

BL_IMAGE_INFO_FLAG_PROGRESSIVE 

Progressive mode.

BLImageScaleFilter : uint32_tenum◆ 

Filter type used by BLImage::scale().

ConstantDescription
BL_IMAGE_SCALE_FILTER_NONE 

No filter or uninitialized.

BL_IMAGE_SCALE_FILTER_NEAREST 

Nearest neighbor filter (radius 1.0).

BL_IMAGE_SCALE_FILTER_BILINEAR 

Bilinear filter (radius 1.0).

BL_IMAGE_SCALE_FILTER_BICUBIC 

Bicubic filter (radius 2.0).

BL_IMAGE_SCALE_FILTER_LANCZOS 

Lanczos filter (radius 2.0).

BL_IMAGE_SCALE_FILTER_MAX_VALUE 

Maximum value of BLImageScaleFilter.

BLImageCodecFeatures : uint32_tenum◆ 

Image codec feature bits.

ConstantDescription
BL_IMAGE_CODEC_NO_FEATURES 

No features.

BL_IMAGE_CODEC_FEATURE_READ 

Image codec supports reading images (can create BLImageDecoder).

BL_IMAGE_CODEC_FEATURE_WRITE 

Image codec supports writing images (can create BLImageEncoder).

BL_IMAGE_CODEC_FEATURE_LOSSLESS 

Image codec supports lossless compression.

BL_IMAGE_CODEC_FEATURE_LOSSY 

Image codec supports loosy compression.

BL_IMAGE_CODEC_FEATURE_MULTI_FRAME 

Image codec supports writing multiple frames (GIF).

BL_IMAGE_CODEC_FEATURE_IPTC 

Image codec supports IPTC metadata.

BL_IMAGE_CODEC_FEATURE_EXIF 

Image codec supports EXIF metadata.

BL_IMAGE_CODEC_FEATURE_XMP 

Image codec supports XMP metadata.

BLPixelConverterCreateFlags : uint32_tenum◆ 

Flags used by BLPixelConverter::create() function.

ConstantDescription
BL_PIXEL_CONVERTER_CREATE_NO_FLAGS 

No flags.

BL_PIXEL_CONVERTER_CREATE_FLAG_DONT_COPY_PALETTE 

Specifies that the source palette in BLFormatInfo doesn't have to by copied by BLPixelConverter. The caller must ensure that the palette would stay valid until the pixel converter is destroyed.

BL_PIXEL_CONVERTER_CREATE_FLAG_ALTERABLE_PALETTE 

Specifies that the source palette in BLFormatInfo is alterable and the pixel converter can modify it when preparing the conversion. The modification can be irreversible so only use this flag when you are sure that the palette passed to BLPixelConverter::create() won't be needed outside of pixel conversion.

Note
The flag BL_PIXEL_CONVERTER_CREATE_FLAG_DONT_COPY_PALETTE must be set as well, otherwise this flag would be ignored.
BL_PIXEL_CONVERTER_CREATE_FLAG_NO_MULTI_STEP 

When there is no built-in conversion between the given pixel formats it's possible to use an intermediate format that is used during conversion. In such case the base pixel converter creates two more converters that are then used internally.

This option disables such feature - creating a pixel converter would fail with BL_ERROR_NOT_IMPLEMENTED error if direct conversion is not possible.

Variable Documentation

const BLFormatInfo blFormatInfo[]extern◆ 

Pixel format information of Blend2D native pixel formats, see BLFormat.