Struct in ldk_image.h

LDKImage

typedef struct LDKImage LDKImage;
Enum in ldk_image.h

LDKImageFormat

typedef enum LDKImageFormat{
  LDK_IMAGE_FORMAT_RGBA8_UNORM=0,
  LDK_IMAGE_FORMAT_RGBA16_UNORM
}LDKImageFormat;
Struct in ldk_image.h

LDKImageInfo

typedef struct LDKImageInfo{
  u32 width;
  u32 height;
  u32 channel_count;
  u32 bytes_per_channel;
  LDKImageFormat format;
  u64 byte_count;
  u8 const *pixels;
}LDKImageInfo;
Function in ldk_image.h

ldk_image_create

Create an RGBA8 UNORM image.

LDK_API LDKImage * ldk_image_create(
 u32 width,
 u32 height,
 void const *pixels
);

Parameters

u32 width
Width in pixels or the units expected by the API.
u32 height
Height in pixels or the units expected by the API.
void const *pixels
Image pixel data.

Returns

Pointer to the requested object or data; NULL when unavailable.

Function in ldk_image.h

ldk_image_create_format

Create an image from raw interleaved RGBA pixels in the requested format.

LDK_API LDKImage * ldk_image_create_format(
 u32 width,
 u32 height,
 LDKImageFormat format,
 void const *pixels
);

Parameters

u32 width
Width in pixels or the units expected by the API.
u32 height
Height in pixels or the units expected by the API.
LDKImageFormat format
Format to use for this resource.
void const *pixels
Image pixel data.

Returns

Pointer to the requested object or data; NULL when unavailable.

Function in ldk_image.h

ldk_image_load

Load an image file. 16-bit sources remain RGBA16 UNORM; other sources use RGBA8.

LDK_API LDKImage * ldk_image_load(char const *path);

Parameters

char const *path
Path identifying the file or resource.

Returns

Pointer to the requested object or data; NULL when unavailable.

Function in ldk_image.h

ldk_image_create_from_memory

Create an image from pixel data in memory.

LDK_API LDKImage * ldk_image_create_from_memory(
 void const *data,
 u32 data_size
);

Parameters

void const *data
Source data or system-owned context for this operation.
u32 data_size
Size of the data buffer or region.

Returns

Pointer to the requested object or data; NULL when unavailable.

Function in ldk_image.h

ldk_image_get_info

Read the image format and dimension metadata.

LDK_API bool ldk_image_get_info(
 LDKImage const *image,
 LDKImageInfo *out_info
);

Parameters

LDKImage const *image
Image used by this operation.
LDKImageInfo *out_info
Receives the requested information.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_image.h

ldk_image_get_width

Read the image width in pixels.

LDK_API u32 ldk_image_get_width(LDKImage const *image);

Parameters

LDKImage const *image
Image used by this operation.

Returns

The resulting numeric value.

Function in ldk_image.h

ldk_image_get_height

Read the image height in pixels.

LDK_API u32 ldk_image_get_height(LDKImage const *image);

Parameters

LDKImage const *image
Image used by this operation.

Returns

The resulting numeric value.

Function in ldk_image.h

ldk_image_get_channel_count

Get the number of color channels in the image format.

LDK_API u32 ldk_image_get_channel_count(LDKImage const *image);

Parameters

LDKImage const *image
Image used by this operation.

Returns

Number of matching entries.

Function in ldk_image.h

ldk_image_get_bytes_per_channel

Query the number of bytes used per image channel.

LDK_API u32 ldk_image_get_bytes_per_channel(LDKImage const *image);

Parameters

LDKImage const *image
Image used by this operation.

Returns

The resulting numeric value.

Function in ldk_image.h

ldk_image_get_pixels

Get the image pixel buffer.

LDK_API u8 const * ldk_image_get_pixels(LDKImage const *image);

Parameters

LDKImage const *image
Image used by this operation.

Returns

Pointer to the requested object or data; NULL when unavailable.

Function in ldk_image.h

ldk_image_get_byte_count

Get the size of the image pixel buffer in bytes.

LDK_API u64 ldk_image_get_byte_count(LDKImage const *image);

Parameters

LDKImage const *image
Image used by this operation.

Returns

Number of matching entries.