LRaspi  2022.1
A Lua Player for Rasberry Pi
lraspi.h File Reference
#include <stdint.h>
#include <stdbool.h>

Go to the source code of this file.

Macros

#define LRASPI_LIB_VERSION   "1.0.0"
 
#define LRASPI_VERSION   "2022.1"
 
#define LRASPI_FONT_SIZE   12
 
#define LRASPI_FONT_FILE   "OpenSans.ttf"
 

Typedefs

typedef struct lraspi_Colour lraspi_Colour
 
typedef struct lraspi_Image lraspi_Image
 
typedef struct lraspi_Font lraspi_Font
 

Enumerations

enum  lraspi_FilterMode { LRASPI_FILTER_NEAREST = 0 , LRASPI_FILTER_BILINEAR , LRASPI_FILTER_TRILINEAR }
 

Functions

void lraspi_init ()
 Initializes internal libraries and state.
 
void lraspi_close ()
 Closes internal libraries and free internal state.
 
lraspi_Colourlraspi_colour_new (uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha)
 Creates a new colour object. More...
 
void lraspi_colour_free (lraspi_Colour *colour)
 Releases the colour. More...
 
uint8_t lraspi_colour_getredchannel (lraspi_Colour *colour)
 Gets the red channel value. More...
 
void lraspi_colour_setredchannel (lraspi_Colour *colour, uint8_t red)
 Sets the red channel value. More...
 
uint8_t lraspi_colour_getgreenchannel (lraspi_Colour *colour)
 Gets the green channel value. More...
 
void lraspi_colour_setgreenchannel (lraspi_Colour *colour, uint8_t green)
 Sets the green channel value. More...
 
uint8_t lraspi_colour_getbluechannel (lraspi_Colour *colour)
 Gets the blue channel value. More...
 
void lraspi_colour_setbluechannel (lraspi_Colour *colour, uint8_t blue)
 Sets the blue channel value. More...
 
uint8_t lraspi_colour_getalphachannel (lraspi_Colour *colour)
 Gets the alpha channel value. More...
 
void lraspi_colour_setalphachannel (lraspi_Colour *colour, uint8_t alpha)
 Sets the alpha channel value. More...
 
void lraspi_colour_setforeground (lraspi_Colour *colour)
 Sets the default foreground colour. More...
 
lraspi_Colourlraspi_colour_getforeground ()
 Gets the default foreground colour. More...
 
void lraspi_colour_setbackground (lraspi_Colour *colour)
 Sets the default foreground colour. More...
 
lraspi_Colourlraspi_colour_getbackground ()
 Gets the default background colour. More...
 
const char * lraspi_colour_tostring (lraspi_Colour *colour)
 Gets the string representation of the colour.
 
lraspi_Imagelraspi_image_new (const char *image_file)
 Loads an image file onto the memory. More...
 
void lraspi_image_free (lraspi_Image *image)
 Releases an image from memory. More...
 
int lraspi_image_getwidth (lraspi_Image *image)
 Gets the current width (in pixels) of the image. More...
 
int lraspi_image_getinitialwidth (lraspi_Image *image)
 Gets the width (in pixels) of the image. More...
 
int lraspi_image_getheight (lraspi_Image *image)
 Gets the current height (in pixels) of the image. More...
 
int lraspi_image_getinitialheight (lraspi_Image *image)
 Gets the height (in pixels) of the image. More...
 
void lraspi_image_resize (lraspi_Image *image, int height, int width)
 Resizes the image. More...
 
float lraspi_image_getrotation (lraspi_Image *image)
 Gets the rotation angle (in radians) of the image. More...
 
void lraspi_image_rotate (lraspi_Image *image, float angle)
 Rotates the image. More...
 
bool lraspi_image_isvflip (lraspi_Image *image)
 Checks if the image is vertically flipped. More...
 
void lraspi_image_vflip (lraspi_Image *image, bool vflip)
 Flips the image vertically. More...
 
bool lraspi_image_ishflip (lraspi_Image *image)
 Checks if the image is horizontally flipped. More...
 
void lraspi_image_hflip (lraspi_Image *image, bool hflip)
 Flips the image vertically. More...
 
lraspi_FilterMode lraspi_image_getfilter (lraspi_Image *image)
 Gets the image filter. More...
 
void lraspi_image_setfilter (lraspi_Image *image, lraspi_FilterMode filter)
 Sets the image filter. More...
 
lraspi_Colourlraspi_image_getpixel (lraspi_Image *image, int x, int y)
 Gets the colour pixel of the image. More...
 
void lraspi_image_setpixel (lraspi_Image *image, lraspi_Colour *colour, int x, int y)
 Sets the colour pixel of the image. More...
 
const char * lraspi_image_tostring (lraspi_Image *image)
 Gets the string representation of the image.
 
bool lraspi_screen_isclosing ()
 Checks if the program will be closed. More...
 
int lraspi_screen_getwidth ()
 Gets the width of the screen. More...
 
int lraspi_screen_getheight ()
 Gets the height of the screen. More...
 
int lraspi_screen_getfps ()
 Gets the frames per second.
 
void lraspi_screen_setfps (int frame_per_seconds)
 Sets the frames per second.
 
float lraspi_screen_getdeltatime ()
 Gets the time in seconds since the last screen update.
 
void lraspi_screen_clear ()
 Clears the buffer using the default background colour and prepares the library to draw.
 
void lraspi_screen_flip ()
 Sets the library to stop drawing and show the buffer onto the screen.
 
void lraspi_screen_setdefault (lraspi_Image *image)
 Sets the render target to a image object. More...
 
lraspi_Imagelraspi_screen_getdefault ()
 Gets the current render image. More...
 
void lraspi_draw_print (const char *text, int x, int y)
 Draws a text with default font. More...
 
void lraspi_draw_blit (lraspi_Image *image, int x, int y)
 Draws an image with default foreground colour. More...
 
lraspi_Fontlraspi_font_new (const char *font_file, int size)
 Loads a font file onto the memory. More...
 
void lraspi_font_free (lraspi_Font *font)
 Releases a font from memory. More...
 
void lraspi_font_setdefault (lraspi_Font *font)
 Sets the current default font. More...
 
lraspi_Fontlraspi_font_getdefault ()
 Gets the current default font. More...
 
const char * lraspi_font_tostring (lraspi_Font *font)
 Gets the string representation of the image.
 

Macro Definition Documentation

◆ LRASPI_LIB_VERSION

#define LRASPI_LIB_VERSION   "1.0.0"

Gets the library version

◆ LRASPI_VERSION

#define LRASPI_VERSION   "2022.1"

Gets the human-readable version