TORCS  1.3.9
The Open Racing Car Simulator
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. More...
 
int GfImgWritePng (unsigned char *img, const char *filename, int width, int height)
 Write a buffer to a png image on disk. More...
 
void GfImgFreeTex (GLuint tex)
 Free the texture. More...
 
GLuint GfImgReadTex (char *filename)
 Read a png image into a texture. More...
 

Detailed Description

Load and store png images with easy interface.

Function Documentation

◆ GfImgFreeTex()

void GfImgFreeTex ( GLuint  tex)

Free the texture.

Parameters
textexture to free
Returns
none

Definition at line 280 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 54 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 293 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 201 of file img.cpp.

Here is the call graph for this function: