BLImage Class Reference

2D raster image [C++ API].

Member Functions

Construction & Destruction
Overloaded Operators
Common Functionality
Create Functionality
Image Utilities
Image IO

Static Functions

Additional Inherited Members

- Public Attributes inherited from BLObjectCore

Member Function Documentation

BLResult BLImage::assignDeep(const BLImage& other)

Create a deep copy of the other image.

bool BLImage::empty() const

Tests whether the image is empty (has no size).

BLResult BLImage::create(int w, int h, BLFormat format)

Create a new image of a specified width w, height h, and format.

It's important to always test whether the function succeeded as allocating pixel-data can fail. If invalid arguments (invalid size or format) were passed to the function a BL_ERROR_INVALID_VALUE result will be returned and no data will be allocated. It's also important to notice that BLImage::create() would not change anything if the function fails (the previous image content would be kept as is).

BLResult BLImage::createFromData(int w, int h, BLFormat format, void* pixelData, intptr_t stride, BLDestroyExternalDataFunc destroyFunc = nullptr, void* userData = nullptr)

Create a new image from external data.

int BLImage::width() const

Returns image width.

int BLImage::height() const

Returns image height.

BLSizeI BLImage::size() const

Returns image size.

BLFormat BLImage::format() const

Returns image format, see BLFormat.

uint32_t BLImage::depth() const

Returns image depth, in bits.