|
Kore 3
|
Functionality for creating and loading images. Image loading supports PNG, JPEG and the custom K format. K files can contain image data that uses texture-compression (see kore_image_compression). More...
Go to the source code of this file.
Data Structures | |
| struct | kore_image |
| struct | kore_image_read_callbacks |
| struct | kore_image_info |
Functions | |
| KORE_FUNC size_t | kore_image_init (kore_image *image, void *memory, int width, int height, kore_image_format format) |
| Creates a 2D kore_image in the provided memory. | |
| KORE_FUNC size_t | kore_image_init3d (kore_image *image, void *memory, int width, int height, int depth, kore_image_format format) |
| Creates a 3D kore_image in the provided memory. | |
| KORE_FUNC kore_image_info | kore_image_info_from_file (const char *filename) |
| Peeks into an image file and figures out the size it will occupy in memory. | |
| KORE_FUNC kore_image_info | kore_image_info_from_callbacks (kore_image_read_callbacks callbacks, void *user_data, const char *format) |
| Peeks into an image that is loaded via callback functions and figures out the size it will occupy in memory. | |
| KORE_FUNC kore_image_info | kore_image_info_from_encoded_bytes (void *data, size_t data_size, const char *format_hint) |
| Peeks into an image file that resides in memory and figures out the size it will occupy in memory once it is uncompressed. | |
| KORE_FUNC size_t | kore_image_init_from_file (kore_image *image, void *memory, const char *filename) |
| Loads an image from a file. | |
| KORE_FUNC size_t | kore_image_init_from_file_with_stride (kore_image *image, void *memory, const char *filename, uint32_t stride) |
| Loads an image from a file with an enforced stride. | |
| KORE_FUNC size_t | kore_image_init_from_callbacks (kore_image *image, void *memory, kore_image_read_callbacks callbacks, void *user_data, const char *format) |
| Loads an image file using callbacks. | |
| KORE_FUNC size_t | kore_image_init_from_callbacks_with_stride (kore_image *image, void *memory, kore_image_read_callbacks callbacks, void *user_data, const char *format, uint32_t stride) |
| Loads an image file using callbacks with an enforced stride. | |
| KORE_FUNC size_t | kore_image_init_from_encoded_bytes (kore_image *image, void *memory, void *data, size_t data_size, const char *format) |
| Loads an image file from memory. | |
| KORE_FUNC size_t | kore_image_init_from_encoded_bytes_with_stride (kore_image *image, void *memory, void *data, size_t data_size, const char *format, uint32_t stride) |
| Loads an image file from memory with an enforced stride. | |
| KORE_FUNC void | kore_image_init_from_bytes (kore_image *image, void *data, int width, int height, kore_image_format format) |
| Creates a 2D image from memory. | |
| KORE_FUNC void | kore_image_init_from_bytes3d (kore_image *image, void *data, int width, int height, int depth, kore_image_format format) |
| Creates a 3D image from memory. | |
| KORE_FUNC void | kore_image_destroy (kore_image *image) |
| Destroys an image. This does not free the user-provided memory. | |
| KORE_FUNC uint32_t | kore_image_at (kore_image *image, int x, int y) |
| Gets the color value of a 32 bit pixel. If this doesn't fit the format of the image please use kore_image_at_raw instead. | |
| KORE_FUNC void * | kore_image_at_raw (kore_image *image, int x, int y) |
| Gets a pointer to the color-data of one pixel. | |
| KORE_FUNC uint8_t * | kore_image_get_pixels (kore_image *image) |
| Provides access to the image data. | |
| KORE_FUNC int | kore_image_format_sizeof (kore_image_format format) |
| Gets the size in bytes of a single pixel for a given image format. | |
Functionality for creating and loading images. Image loading supports PNG, JPEG and the custom K format. K files can contain image data that uses texture-compression (see kore_image_compression).
| KORE_FUNC uint32_t kore_image_at | ( | kore_image * | image, |
| int | x, | ||
| int | y ) |
Gets the color value of a 32 bit pixel. If this doesn't fit the format of the image please use kore_image_at_raw instead.
| KORE_FUNC void * kore_image_at_raw | ( | kore_image * | image, |
| int | x, | ||
| int | y ) |
Gets a pointer to the color-data of one pixel.
| KORE_FUNC int kore_image_format_sizeof | ( | kore_image_format | format | ) |
Gets the size in bytes of a single pixel for a given image format.
| KORE_FUNC uint8_t * kore_image_get_pixels | ( | kore_image * | image | ) |
Provides access to the image data.
| KORE_FUNC kore_image_info kore_image_info_from_callbacks | ( | kore_image_read_callbacks | callbacks, |
| void * | user_data, | ||
| const char * | format ) |
Peeks into an image that is loaded via callback functions and figures out the size it will occupy in memory.
| KORE_FUNC kore_image_info kore_image_info_from_encoded_bytes | ( | void * | data, |
| size_t | data_size, | ||
| const char * | format_hint ) |
Peeks into an image file that resides in memory and figures out the size it will occupy in memory once it is uncompressed.
| data | The encoded data |
| data_size | The size of the encoded data |
| format_hint | Something like "png" can help, it also works to just put in the filename |
| KORE_FUNC kore_image_info kore_image_info_from_file | ( | const char * | filename | ) |
Peeks into an image file and figures out the size it will occupy in memory.
| KORE_FUNC size_t kore_image_init | ( | kore_image * | image, |
| void * | memory, | ||
| int | width, | ||
| int | height, | ||
| kore_image_format | format ) |
Creates a 2D kore_image in the provided memory.
| KORE_FUNC size_t kore_image_init3d | ( | kore_image * | image, |
| void * | memory, | ||
| int | width, | ||
| int | height, | ||
| int | depth, | ||
| kore_image_format | format ) |
Creates a 3D kore_image in the provided memory.
| KORE_FUNC size_t kore_image_init_from_callbacks | ( | kore_image * | image, |
| void * | memory, | ||
| kore_image_read_callbacks | callbacks, | ||
| void * | user_data, | ||
| const char * | format ) |
Loads an image file using callbacks.
| image | The image-object to initialize with the data |
| memory | The pre-allocated memory to load the image-data into |
| callbacks | The callbacks that are used to query the data to encode |
| user_data | An optional pointer that is passed to the callbacks |
| KORE_FUNC size_t kore_image_init_from_callbacks_with_stride | ( | kore_image * | image, |
| void * | memory, | ||
| kore_image_read_callbacks | callbacks, | ||
| void * | user_data, | ||
| const char * | format, | ||
| uint32_t | stride ) |
Loads an image file using callbacks with an enforced stride.
| image | The image-object to initialize with the data |
| memory | The pre-allocated memory to load the image-data into |
| callbacks | The callbacks that are used to query the data to encode |
| user_data | An optional pointer that is passed to the callbacks |
| stride | The enforced stride in bytes |
| KORE_FUNC size_t kore_image_init_from_encoded_bytes | ( | kore_image * | image, |
| void * | memory, | ||
| void * | data, | ||
| size_t | data_size, | ||
| const char * | format ) |
Loads an image file from memory.
| image | The image-object to initialize with the data |
| memory | The pre-allocated memory to load the image-data into |
| data | The data to encode |
| data_size | The size of the data to encode in bytes |
| KORE_FUNC size_t kore_image_init_from_encoded_bytes_with_stride | ( | kore_image * | image, |
| void * | memory, | ||
| void * | data, | ||
| size_t | data_size, | ||
| const char * | format, | ||
| uint32_t | stride ) |
Loads an image file from memory with an enforced stride.
| image | The image-object to initialize with the data |
| memory | The pre-allocated memory to load the image-data into |
| data | The data to encode |
| data_size | The size of the data to encode in bytes |
| stride | The enforced stride in bytes |
| KORE_FUNC size_t kore_image_init_from_file | ( | kore_image * | image, |
| void * | memory, | ||
| const char * | filename ) |
Loads an image from a file.
| image | The image-object to initialize with the data |
| memory | The pre-allocated memory to load the image-data into |
| filename | The file to load |
| KORE_FUNC size_t kore_image_init_from_file_with_stride | ( | kore_image * | image, |
| void * | memory, | ||
| const char * | filename, | ||
| uint32_t | stride ) |
Loads an image from a file with an enforced stride.
| image | The image-object to initialize with the data |
| memory | The pre-allocated memory to load the image-data into |
| filename | The file to load |
| stride | The enforced stride in bytes |