Image
Typedefs
-
typedef struct binocle_image_load_desc binocle_image_load_desc
an image
Functions
-
sg_image binocle_image_load(const char *filename)
Loads an image file (.png or .jpg) through stb image. It applies linear filtering and edge clamping by default. It uses SDL as the backing filesystem.
- Parameters:
filename – the full filename of the image we want to load
- Returns:
the actual image data
-
sg_image binocle_image_load_with_desc(binocle_image_load_desc *desc)
Loads an image file (.png or .jpg) through stb image.
- Parameters:
binocle_image_load_desc – the descriptor with the data needed to load the image
- Returns:
the actual image data
-
void binocle_image_destroy(sg_image image)
Frees the memory allocated for the image.
- Parameters:
image – the image to destroy
-
sg_image binocle_image_load_from_memory(const unsigned char *image_data, int width, int height, sg_filter filter)
Loads an image from a memory stream.
- Parameters:
image_data – the memory stream of the image
width – the image width
height – the image height
filter – the filter to use (linear or nearest)
- Returns:
the image descriptor
-
struct binocle_image_load_desc
- #include <binocle_image.h>
an image