TORCS  1.3.10
The Open Racing Car Simulator
Loading...
Searching...
No Matches
Image Management API

Load and store png images with easy interface. More...

Functions

unsigned char * GfImgReadPng (const char *filename, int *widthp, int *heightp, float screen_gamma)
 Load an image from disk to a buffer in RGBA mode.
int GfImgWritePng (unsigned char *img, const char *filename, int width, int height)
 Write a buffer to a png image on disk.
int GfImgWritePngNoGamma (unsigned char *img, const char *filename, int width, int height)
 Write a framebuffer capture to a png image on disk without gamma metadata.
void GfImgFreeTex (GLuint tex)
 Free the texture.
GLuint GfImgReadTex (char *filename)
 Read a png image into a texture.

Detailed Description

Load and store png images with easy interface.

Function Documentation

◆ GfImgFreeTex()

void GfImgFreeTex ( GLuint tex)

Free the texture.

Parameters
textexture to free

Definition at line 302 of file img.cpp.

◆ GfImgReadPng()

unsigned char * GfImgReadPng ( const char * filename,
int * widthp,
int * heightp,
float screen_gamma )

Load an image from disk to a buffer in RGBA mode.


Parameters
filenamename of the image to load
widthpwidth of the read image
heightpheight of the read image
screen_gammagamma correction value
Returns
Pointer on the buffer containing the image
NULL Error

Definition at line 53 of file img.cpp.

◆ GfImgReadTex()

GLuint GfImgReadTex ( char * filename)

Read a png image into a texture.

Parameters
filenamefile name of the image
Returns
None.

Definition at line 315 of file img.cpp.

Here is the call graph for this function:

◆ GfImgWritePng()

int GfImgWritePng ( unsigned char * img,
const char * filename,
int width,
int height )

Write a buffer to a png image on disk.

Parameters
imgimage data (RGB)
filenamefilename of the png file
widthwidth of the image
heightheight of the image
Returns
0 Ok
-1 Error

Definition at line 277 of file img.cpp.

Here is the call graph for this function:

◆ GfImgWritePngNoGamma()

int GfImgWritePngNoGamma ( unsigned char * img,
const char * filename,
int width,
int height )

Write a framebuffer capture to a png image on disk without gamma metadata.

Parameters
imgimage data (RGB)
filenamefilename of the png file
widthwidth of the image
heightheight of the image
Returns
0 Ok
-1 Error

Definition at line 292 of file img.cpp.

Here is the call graph for this function: