RetroArch
Macros | Functions
rpng_encode.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <encodings/crc32.h>
#include <streams/file_stream.h>
#include <streams/trans_stream.h>
#include "rpng_internal.h"
Include dependency graph for rpng_encode.c:

Macros

#define GOTO_END_ERROR()
 

Functions

static void dword_write_be (uint8_t *buf, uint32_t val)
 
static bool png_write_crc (RFILE *file, const uint8_t *data, size_t size)
 
static bool png_write_ihdr (RFILE *file, const struct png_ihdr *ihdr)
 
static bool png_write_idat (RFILE *file, const uint8_t *data, size_t size)
 
static bool png_write_iend (RFILE *file)
 
static void copy_argb_line (uint8_t *dst, const uint32_t *src, unsigned width)
 
static void copy_bgr24_line (uint8_t *dst, const uint8_t *src, unsigned width)
 
static unsigned count_sad (const uint8_t *data, size_t size)
 
static unsigned filter_up (uint8_t *target, const uint8_t *line, const uint8_t *prev, unsigned width, unsigned bpp)
 
static unsigned filter_sub (uint8_t *target, const uint8_t *line, unsigned width, unsigned bpp)
 
static unsigned filter_avg (uint8_t *target, const uint8_t *line, const uint8_t *prev, unsigned width, unsigned bpp)
 
static unsigned filter_paeth (uint8_t *target, const uint8_t *line, const uint8_t *prev, unsigned width, unsigned bpp)
 
static bool rpng_save_image (const char *path, const uint8_t *data, unsigned width, unsigned height, unsigned pitch, unsigned bpp)
 
bool rpng_save_image_argb (const char *path, const uint32_t *data, unsigned width, unsigned height, unsigned pitch)
 
bool rpng_save_image_bgr24 (const char *path, const uint8_t *data, unsigned width, unsigned height, unsigned pitch)
 

Macro Definition Documentation

◆ GOTO_END_ERROR

#define GOTO_END_ERROR ( )
Value:
do { \
fprintf(stderr, "[RPNG]: Error in line %d.\n", __LINE__); \
ret = false; \
goto end; \
} while(0)
GLuint GLuint end
Definition: glext.h:6292

Function Documentation

◆ copy_argb_line()

static void copy_argb_line ( uint8_t dst,
const uint32_t src,
unsigned  width 
)
static
Here is the caller graph for this function:

◆ copy_bgr24_line()

static void copy_bgr24_line ( uint8_t dst,
const uint8_t src,
unsigned  width 
)
static
Here is the caller graph for this function:

◆ count_sad()

static unsigned count_sad ( const uint8_t data,
size_t  size 
)
static
Here is the caller graph for this function:

◆ dword_write_be()

static void dword_write_be ( uint8_t buf,
uint32_t  val 
)
static
Here is the caller graph for this function:

◆ filter_avg()

static unsigned filter_avg ( uint8_t target,
const uint8_t line,
const uint8_t prev,
unsigned  width,
unsigned  bpp 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ filter_paeth()

static unsigned filter_paeth ( uint8_t target,
const uint8_t line,
const uint8_t prev,
unsigned  width,
unsigned  bpp 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ filter_sub()

static unsigned filter_sub ( uint8_t target,
const uint8_t line,
unsigned  width,
unsigned  bpp 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ filter_up()

static unsigned filter_up ( uint8_t target,
const uint8_t line,
const uint8_t prev,
unsigned  width,
unsigned  bpp 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ png_write_crc()

static bool png_write_crc ( RFILE file,
const uint8_t data,
size_t  size 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ png_write_idat()

static bool png_write_idat ( RFILE file,
const uint8_t data,
size_t  size 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ png_write_iend()

static bool png_write_iend ( RFILE file)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ png_write_ihdr()

static bool png_write_ihdr ( RFILE file,
const struct png_ihdr ihdr 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rpng_save_image()

static bool rpng_save_image ( const char *  path,
const uint8_t data,
unsigned  width,
unsigned  height,
unsigned  pitch,
unsigned  bpp 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rpng_save_image_argb()

bool rpng_save_image_argb ( const char *  path,
const uint32_t data,
unsigned  width,
unsigned  height,
unsigned  pitch 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rpng_save_image_bgr24()

bool rpng_save_image_bgr24 ( const char *  path,
const uint8_t data,
unsigned  width,
unsigned  height,
unsigned  pitch 
)
Here is the call graph for this function:
Here is the caller graph for this function: