TORCS  1.3.10
The Open Racing Car Simulator
Loading...
Searching...
No Matches
img.cpp File Reference


Image management API. More...

#include "png.h"
#include <tgfclient.h>
#include <stdlib.h>
#include <stdio.h>
#include <portability.h>
Include dependency graph for img.cpp:

Go to the source code of this file.

Macros

#define PNG_BYTES_TO_CHECK   4

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.
static int writePng (unsigned char *img, const char *filename, int width, int height, int writeGamma)
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


Image management API.

Load and store png images.

Author
Bernhard Wymann, Eric Espie

Definition in file img.cpp.

Macro Definition Documentation

◆ PNG_BYTES_TO_CHECK

#define PNG_BYTES_TO_CHECK   4

Definition at line 41 of file img.cpp.

Function Documentation

◆ writePng()

int writePng ( unsigned char * img,
const char * filename,
int width,
int height,
int writeGamma )
static

Definition at line 191 of file img.cpp.

Here is the call graph for this function: