Skip to content

Commit

Permalink
Added support for animated GIF images.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rinnegatamante committed May 27, 2021
1 parent d917ca8 commit 3dff18e
Show file tree
Hide file tree
Showing 9 changed files with 992 additions and 149 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Official documentation: http://rinnegatamante.github.io/lpp-vita/
* Native support to OBJ models.
* Native support to TTF/PGF/PVF/OTF fonts.
* Native support to BMP/PNG/JPG images.
* Native support to GIF animated images.
* Built-in rescaler to perform portings from [lpp-3ds](https://github.com/Rinnegatamante/lpp-3ds) easily.

##### Multimedia
Expand Down Expand Up @@ -136,3 +137,4 @@ Lua Player Plus Vita supports different flags to enables some features:<br>
* **Misledz** for the Lua Player Plus logo.
* **Arkanite** for providing a sample for sceAvPlayer used to implement the Video module.
* **EasyRPG Team** for the Audio Decoder used for Sound module.
* **lecram** for gifdec usd for animated GIFs support.
46 changes: 46 additions & 0 deletions doc/luaGraphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,52 @@ class Graphics {
*/
int loadImage(string filename);

/**
* Load a .gif animated image.
* \ingroup Graphics
*
* @par Usage example:
* @code
* img = Graphics.loadAnimatedImage("app0:/image.gif")
* @endcode
*
* @param filename - Name of the file to open.
*
* @return A valid image ID.
*/
int loadAnimatedImage(string filename);

/**
* Gets the number of frames of a loaded animated image.
* \ingroup Graphics
*
* @par Usage example:
* @code
* img = Graphics.loadAnimatedImage("app0:/image.gif")
* frames = Graphics.getImageFramesNum(img)
* @endcode
*
* @param img - A valid image ID.
*
* @return The number of frames for the given image.
*/
int getImageFramesNum(int img);

/**
* Set current active frame for a loaded animated image.
* \ingroup Graphics
*
* @par Usage example:
* @code
* img = Graphics.loadAnimatedImage("app0:/image.gif")
* Graphics.setImageFrame(img, 8)
* @endcode
*
* @param img - A valid image ID.
* @param frame - The frame to set as active.
*/
void setImageFrame(int img, int frame);

/**
* Free a loaded image.
* \ingroup Graphics
Expand Down

0 comments on commit 3dff18e

Please sign in to comment.