A collection of utility functions for image manipulation operations.
static std::vector< std::byte > savePng(const CesiumGltf::ImageAsset &image)
Saves an image to a new byte buffer in PNG format.
static bool blitImage(CesiumGltf::ImageAsset &target, const PixelRectangle &targetPixels, const CesiumGltf::ImageAsset &source, const PixelRectangle &sourcePixels)
Copies pixels from a source image to a target image.
static void unsafeBlitImage(std::byte *pTarget, size_t targetRowStride, const std::byte *pSource, size_t sourceRowStride, size_t sourceWidth, size_t sourceHeight, size_t bytesPerPixel)
Directly copies pixels from a source to a target, without validating the provided pointers or ranges.
static void savePng(const CesiumGltf::ImageAsset &image, std::vector< std::byte > &output)
Saves an image to an existing byte buffer in PNG format.
Classes that support manipulating the content of a glTF.
Specifies a rectangle of pixels in an image.
int32_t width
The total number of pixels in the horizontal direction.
int32_t height
The total number of pixels in the vertical direction.
int32_t x
The X coordinate of the top-left corner of the rectangle.
int32_t y
The Y coordinate of the top-left corner of the rectangle.