32 #ifndef LRASPI_LIBRARY_H
33 #define LRASPI_LIBRARY_H
41 #define LRASPI_LIB_VERSION "1.0.0"
44 #define LRASPI_VERSION "2022.1"
46 #define LRASPI_FONT_SIZE 12
47 #define LRASPI_FONT_FILE "OpenSans.ttf"
203 LRASPI_FILTER_NEAREST = 0,
struct lraspi_Colour lraspi_Colour
Definition: lraspi.h:77
lraspi_Colour * lraspi_colour_getbackground()
Gets the default background colour.
void lraspi_colour_setalphachannel(lraspi_Colour *colour, uint8_t alpha)
Sets the alpha channel value.
uint8_t lraspi_colour_getgreenchannel(lraspi_Colour *colour)
Gets the green channel value.
const char * lraspi_colour_tostring(lraspi_Colour *colour)
Gets the string representation of the colour.
uint8_t lraspi_colour_getredchannel(lraspi_Colour *colour)
Gets the red channel value.
lraspi_Colour * lraspi_colour_getforeground()
Gets the default foreground colour.
void lraspi_colour_setforeground(lraspi_Colour *colour)
Sets the default foreground colour.
void lraspi_colour_setbackground(lraspi_Colour *colour)
Sets the default foreground colour.
void lraspi_colour_setredchannel(lraspi_Colour *colour, uint8_t red)
Sets the red channel value.
lraspi_Colour * lraspi_colour_new(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha)
Creates a new colour object.
void lraspi_colour_free(lraspi_Colour *colour)
Releases the colour.
void lraspi_colour_setgreenchannel(lraspi_Colour *colour, uint8_t green)
Sets the green channel value.
uint8_t lraspi_colour_getbluechannel(lraspi_Colour *colour)
Gets the blue channel value.
void lraspi_colour_setbluechannel(lraspi_Colour *colour, uint8_t blue)
Sets the blue channel value.
uint8_t lraspi_colour_getalphachannel(lraspi_Colour *colour)
Gets the alpha channel value.
void lraspi_close()
Closes internal libraries and free internal state.
void lraspi_init()
Initializes internal libraries and state.
void lraspi_draw_blit(lraspi_Image *image, int x, int y)
Draws an image with default foreground colour.
void lraspi_draw_print(const char *text, int x, int y)
Draws a text with default font.
void lraspi_font_free(lraspi_Font *font)
Releases a font from memory.
struct lraspi_Font lraspi_Font
Definition: lraspi.h:462
void lraspi_font_setdefault(lraspi_Font *font)
Sets the current default font.
lraspi_Font * lraspi_font_getdefault()
Gets the current default font.
const char * lraspi_font_tostring(lraspi_Font *font)
Gets the string representation of the image.
lraspi_Font * lraspi_font_new(const char *font_file, int size)
Loads a font file onto the memory.
void lraspi_image_vflip(lraspi_Image *image, bool vflip)
Flips the image vertically.
void lraspi_image_resize(lraspi_Image *image, int height, int width)
Resizes the image.
void lraspi_image_free(lraspi_Image *image)
Releases an image from memory.
bool lraspi_image_isvflip(lraspi_Image *image)
Checks if the image is vertically flipped.
int lraspi_image_getwidth(lraspi_Image *image)
Gets the current width (in pixels) of the image.
void lraspi_image_hflip(lraspi_Image *image, bool hflip)
Flips the image vertically.
float lraspi_image_getrotation(lraspi_Image *image)
Gets the rotation angle (in radians) of the image.
int lraspi_image_getheight(lraspi_Image *image)
Gets the current height (in pixels) of the image.
const char * lraspi_image_tostring(lraspi_Image *image)
Gets the string representation of the image.
int lraspi_image_getinitialheight(lraspi_Image *image)
Gets the height (in pixels) of the image.
void lraspi_image_setpixel(lraspi_Image *image, lraspi_Colour *colour, int x, int y)
Sets the colour pixel of the image.
lraspi_Colour * lraspi_image_getpixel(lraspi_Image *image, int x, int y)
Gets the colour pixel of the image.
lraspi_FilterMode
Definition: lraspi.h:202
struct lraspi_Image lraspi_Image
Definition: lraspi.h:199
lraspi_FilterMode lraspi_image_getfilter(lraspi_Image *image)
Gets the image filter.
void lraspi_image_setfilter(lraspi_Image *image, lraspi_FilterMode filter)
Sets the image filter.
bool lraspi_image_ishflip(lraspi_Image *image)
Checks if the image is horizontally flipped.
lraspi_Image * lraspi_image_new(const char *image_file)
Loads an image file onto the memory.
void lraspi_image_rotate(lraspi_Image *image, float angle)
Rotates the image.
int lraspi_image_getinitialwidth(lraspi_Image *image)
Gets the width (in pixels) of the image.
@ LRASPI_FILTER_TRILINEAR
Definition: lraspi.h:205
@ LRASPI_FILTER_BILINEAR
Definition: lraspi.h:204
int lraspi_screen_getheight()
Gets the height of the screen.
int lraspi_screen_getfps()
Gets the frames per second.
void lraspi_screen_setdefault(lraspi_Image *image)
Sets the render target to a image object.
float lraspi_screen_getdeltatime()
Gets the time in seconds since the last screen update.
int lraspi_screen_getwidth()
Gets the width of the screen.
bool lraspi_screen_isclosing()
Checks if the program will be closed.
void lraspi_screen_setfps(int frame_per_seconds)
Sets the frames per second.
void lraspi_screen_flip()
Sets the library to stop drawing and show the buffer onto the screen.
void lraspi_screen_clear()
Clears the buffer using the default background colour and prepares the library to draw.
lraspi_Image * lraspi_screen_getdefault()
Gets the current render image.