Gama C Library
Gama C API Documentation
Loading...
Searching...
No Matches
image.h File Reference
#include "gapi.h"
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  gmImage
 Structure representing an image with handle and dimensions. More...

Functions

gmImage gm_image_open (const char *path)
 Loads an image from a file path.
void gm_image_draw (gmImage i, double x, double y, double w, double h)
 Draws an entire image at the specified position and size.
void gm_image_draw_part (gmImage i, int slice_x, int slice_y, int slice_width, int slice_height, double x, double y, double w, double h)
 Draws a part of an image at the specified position and size.

Function Documentation

◆ gm_image_draw()

void gm_image_draw ( gmImage i,
double x,
double y,
double w,
double h )

Draws an entire image at the specified position and size.

Parameters
iThe image to draw.
xThe x-coordinate to draw at.
yThe y-coordinate to draw at.
wThe width to draw the image.
hThe height to draw the image.

◆ gm_image_draw_part()

void gm_image_draw_part ( gmImage i,
int slice_x,
int slice_y,
int slice_width,
int slice_height,
double x,
double y,
double w,
double h )

Draws a part of an image at the specified position and size.

Parameters
iThe image to draw from.
slice_xThe x-coordinate of the slice to draw from the image.
slice_yThe y-coordinate of the slice to draw from the image.
slice_widthThe width of the slice to draw from the image.
slice_heightThe height of the slice to draw from the image.
xThe x-coordinate to draw at.
yThe y-coordinate to draw at.
wThe width to draw the slice.
hThe height to draw the slice.

◆ gm_image_open()

gmImage gm_image_open ( const char * path)

Loads an image from a file path.

Parameters
pathThe file path to the image.
Returns
A gmImage structure containing the loaded image and its properties.