N64FlashcartMenu
Loading...
Searching...
No Matches
Typedefs | Enumerations | Functions
png_decoder.h File Reference

PNG decoder. More...

Go to the source code of this file.

Typedefs

typedef void png_callback_t(png_err_t err, surface_t *decoded_image, void *callback_data)
 PNG decoder callback type.
 

Enumerations

enum  png_err_t {
  PNG_OK , PNG_ERR_INT , PNG_ERR_BUSY , PNG_ERR_OUT_OF_MEM ,
  PNG_ERR_NO_FILE , PNG_ERR_BAD_FILE
}
 PNG decoder errors. More...
 

Functions

png_err_t png_decoder_start (char *path, int max_width, int max_height, png_callback_t *callback, void *callback_data)
 Start the PNG decoding process.
 
void png_decoder_abort (void)
 Abort the PNG decoding process.
 
float png_decoder_get_progress (void)
 Get the progress of the PNG decoding process.
 
void png_decoder_poll (void)
 Poll the PNG decoder.
 

Detailed Description

PNG decoder.

Typedef Documentation

◆ png_callback_t

typedef void png_callback_t(png_err_t err, surface_t *decoded_image, void *callback_data)

PNG decoder callback type.

This typedef defines the callback function type used by the PNG decoder.

Parameters
errError code indicating the result of the decoding process.
decoded_imagePointer to the decoded image surface.
callback_dataUser-defined data passed to the callback function.

Enumeration Type Documentation

◆ png_err_t

enum png_err_t

PNG decoder errors.

Enumeration for different types of errors that can occur in the PNG decoder.

Enumerator
PNG_OK 

No error

PNG_ERR_INT 

Internal error

PNG_ERR_BUSY 

Decoder is busy

PNG_ERR_OUT_OF_MEM 

Out of memory error

PNG_ERR_NO_FILE 

No file found error

PNG_ERR_BAD_FILE 

Bad file error

Function Documentation

◆ png_decoder_start()

png_err_t png_decoder_start ( char *  path,
int  max_width,
int  max_height,
png_callback_t callback,
void *  callback_data 
)

Start the PNG decoding process.

This function starts the PNG decoding process for the specified file.

Parameters
pathPath to the PNG file.
max_widthMaximum width of the decoded image.
max_heightMaximum height of the decoded image.
callbackCallback function to be called when decoding is complete.
callback_dataUser-defined data to be passed to the callback function.
Returns
png_err_t Error code indicating the result of the start operation.

◆ png_decoder_abort()

void png_decoder_abort ( void  )

Abort the PNG decoding process.

This function aborts the ongoing PNG decoding process.

◆ png_decoder_get_progress()

float png_decoder_get_progress ( void  )

Get the progress of the PNG decoding process.

This function returns the current progress of the PNG decoding process as a percentage.

Returns
float Current progress of the decoding process (0.0 to 100.0).

◆ png_decoder_poll()

void png_decoder_poll ( void  )

Poll the PNG decoder.

This function polls the PNG decoder to handle any ongoing decoding tasks.