MUAN
image.h File Reference

This file represents an Image. More...

Go to the source code of this file.

Classes

struct  Bcolor
struct  Image

Typedefs

typedef struct Bcolor Bcolor
typedef struct Image Image

Functions

Imageimg_create (int w, int h)
 Creates a new image.
void img_free (Image *i)
 Frees an image.
void img_clear (Image *i, Bcolor c)
 Clears an image with a color.
void img_putc (Image *i, int u, int v, Bcolor c)
 Sets a pixel on the image using color.
Bcolor img_getc (Image *i, int u, int v)
 Gets the color of a pixel on the image.
Bcolor c_make (Byte x, Byte y, Byte z)

Detailed Description

This file represents an Image.


Typedef Documentation

typedef struct Bcolor Bcolor
typedef struct Image Image

Function Documentation

Bcolor c_make ( Byte  x,
Byte  y,
Byte  z 
)

References Bcolor::b, Bcolor::g, and Bcolor::r.

Referenced by copy_image(), and img_getc().

void img_clear ( Image i,
Bcolor  c 
)

Clears an image with a color.

Parameters:
iThe image to clear
cThe color to fill.

References Image::h, img_putc(), and Image::w.

Image* img_create ( int  w,
int  h 
)

Creates a new image.

Parameters:
typeThe Image type: IMG_TRUECOL, IMG_MAPPCOL, IMG_MONOCOL.
wThe Image width.
hThe Image height.
Returns:
The Image.

References Image::c, Image::h, and Image::w.

Referenced by VideoEncoder::jpg_write(), and video_getframe().

void img_free ( Image i)

Frees an image.

References Image::c.

Referenced by VideoEncoder::jpg_write().

Bcolor img_getc ( Image i,
int  u,
int  v 
)

Gets the color of a pixel on the image.

References c_make().

void img_putc ( Image i,
int  u,
int  v,
Bcolor  c 
)

Sets a pixel on the image using color.

Referenced by copy_image(), and img_clear().