35#ifndef ULTRALIGHT_CAPI_BITMAP_H
36#define ULTRALIGHT_CAPI_BITMAP_H
63 const void* pixels,
size_t size,
bool should_copy);
void * ulBitmapRawPixels(ULBitmap bitmap)
Get raw pixel buffer– you should only call this if Bitmap is already locked.
bool ulBitmapOwnsPixels(ULBitmap bitmap)
Whether or not this bitmap owns its own pixel buffer.
bool ulBitmapWritePNG(ULBitmap bitmap, const char *path)
Write bitmap to a PNG on disk.
ULBitmap ulCreateBitmap(unsigned int width, unsigned int height, ULBitmapFormat format)
Create bitmap with certain dimensions and pixel format.
bool ulBitmapIsEmpty(ULBitmap bitmap)
Whether or not this bitmap is empty.
void ulDestroyBitmap(ULBitmap bitmap)
Destroy a bitmap (you should only destroy Bitmaps you have explicitly created via one of the creation...
void ulBitmapUnlockPixels(ULBitmap bitmap)
Unlock pixels after locking.
unsigned int ulBitmapGetRowBytes(ULBitmap bitmap)
Get the number of bytes per row.
ULBitmapFormat ulBitmapGetFormat(ULBitmap bitmap)
Get the pixel format.
ULBitmap ulCreateEmptyBitmap()
Create empty bitmap.
unsigned int ulBitmapGetHeight(ULBitmap bitmap)
Get the height in pixels.
void ulBitmapErase(ULBitmap bitmap)
Reset bitmap pixels to 0.
unsigned int ulBitmapGetWidth(ULBitmap bitmap)
Get the width in pixels.
void * ulBitmapLockPixels(ULBitmap bitmap)
Lock pixels for reading/writing, returns pointer to pixel buffer.
ULBitmap ulCreateBitmapFromPixels(unsigned int width, unsigned int height, ULBitmapFormat format, unsigned int row_bytes, const void *pixels, size_t size, bool should_copy)
Create bitmap from existing pixel buffer.
size_t ulBitmapGetSize(ULBitmap bitmap)
Get the size in bytes of the underlying pixel buffer.
unsigned int ulBitmapGetBpp(ULBitmap bitmap)
Get the bytes per pixel.
void ulBitmapSwapRedBlueChannels(ULBitmap bitmap)
This converts a BGRA bitmap to RGBA bitmap and vice-versa by swapping the red and blue channels.
ULBitmap ulCreateBitmapFromCopy(ULBitmap existing_bitmap)
Create bitmap from copy.
Various defines and utility functions for the C API.
#define ULExport
Definition CAPI_Defines.h:38
struct C_Bitmap * ULBitmap
Definition CAPI_Defines.h:64
ULBitmapFormat
Definition CAPI_Defines.h:153