Pixel manipulation

Summary
Convert r, g, b, a (ranging from 0-255) into an ALLEGRO_COLOR.
Convert r, g, b (ranging from 0-255) into an ALLEGRO_COLOR, using 255 for alpha.
Convert r, g, b, a (ranging from 0.0f-1.0f) into an ALLEGRO_COLOR.
Convert r, g, b, (ranging from 0.0f-1.0f) into an ALLEGRO_COLOR, using 1.0f for alpha.
Get a pixel’s color value from the specified bitmap.
Draw a single pixel on the target bitmap.
Retrieves components of an ALLEGRO_COLOR.
Retrieves components of an ALLEGRO_COLOR, ignoring alpha Components will range from 0-255.
Retrieves components of an ALLEGRO_COLOR.
Retrieves components of an ALLEGRO_COLOR, ignoring alpha.

Functions

al_map_rgba

ALLEGRO_COLOR al_map_rgba(unsigned char r,
unsigned char g,
unsigned char b,
unsigned char a)

Convert r, g, b, a (ranging from 0-255) into an ALLEGRO_COLOR.

See also: al_map_rgb <al_map_rgba_f) al_map_rgb_f

al_map_rgb

ALLEGRO_COLOR al_map_rgb(unsigned char r,
unsigned char g,
unsigned char b)

Convert r, g, b (ranging from 0-255) into an ALLEGRO_COLOR, using 255 for alpha.

See also: al_map_rgba <al_map_rgba_f) al_map_rgb_f

al_map_rgba_f

ALLEGRO_COLOR al_map_rgba_f(float r,
float g,
float b,
float a)

Convert r, g, b, a (ranging from 0.0f-1.0f) into an ALLEGRO_COLOR.

See also: al_map_rgba al_map_rgb al_map_rgb_f

al_map_rgb_f

ALLEGRO_COLOR al_map_rgb_f(float r,
float g,
float b)

Convert r, g, b, (ranging from 0.0f-1.0f) into an ALLEGRO_COLOR, using 1.0f for alpha.

See also: al_map_rgba al_map_rgb al_map_rgba_f

al_get_pixel

ALLEGRO_COLOR al_get_pixel(ALLEGRO_BITMAP *bitmap,
int x,
int y)

Get a pixel’s color value from the specified bitmap.

al_put_pixel

void al_put_pixel(int x,
int y,
ALLEGRO_COLOR color)

Draw a single pixel on the target bitmap.

al_unmap_rgba

void al_unmap_rgba(ALLEGRO_COLOR color,
unsigned char *r,
unsigned char *g,
unsigned char *b,
unsigned char *a)

Retrieves components of an ALLEGRO_COLOR.  Components will range from 0-255.

See also: al_unmap_rgb, al_unmap_rgba_f, al_unmap_rgb_f

al_unmap_rgb

void al_unmap_rgb(ALLEGRO_COLOR color,
unsigned char *r,
unsigned char *g,
unsigned char *b)

Retrieves components of an ALLEGRO_COLOR, ignoring alpha Components will range from 0-255.

See also: al_unmap_rgba, al_unmap_rgba_f, al_unmap_rgb_f

al_unmap_rgba_f

void al_unmap_rgba_f(ALLEGRO_COLOR color,
float *r,
float *g,
float *b,
float *a)

Retrieves components of an ALLEGRO_COLOR.  Components will range from 0.0f-1.0f.

See also: al_unmap_rgba, al_unmap_rgb, al_unmap_rgb_f

al_unmap_rgb_f

void al_unmap_rgb_f(ALLEGRO_COLOR color,
float *r,
float *g,
float *b)

Retrieves components of an ALLEGRO_COLOR, ignoring alpha.  Components will range from 0.0f-1.0f.

See also: al_unmap_rgba, al_unmap_rgb, al_unmap_rgba_f

ALLEGRO_COLOR al_map_rgba(unsigned char r,
unsigned char g,
unsigned char b,
unsigned char a)
Convert r, g, b, a (ranging from 0-255) into an ALLEGRO_COLOR.
ALLEGRO_COLOR al_map_rgb(unsigned char r,
unsigned char g,
unsigned char b)
Convert r, g, b (ranging from 0-255) into an ALLEGRO_COLOR, using 255 for alpha.
ALLEGRO_COLOR al_map_rgba_f(float r,
float g,
float b,
float a)
Convert r, g, b, a (ranging from 0.0f-1.0f) into an ALLEGRO_COLOR.
ALLEGRO_COLOR al_map_rgb_f(float r,
float g,
float b)
Convert r, g, b, (ranging from 0.0f-1.0f) into an ALLEGRO_COLOR, using 1.0f for alpha.
ALLEGRO_COLOR al_get_pixel(ALLEGRO_BITMAP *bitmap,
int x,
int y)
Get a pixel’s color value from the specified bitmap.
void al_put_pixel(int x,
int y,
ALLEGRO_COLOR color)
Draw a single pixel on the target bitmap.
void al_unmap_rgba(ALLEGRO_COLOR color,
unsigned char *r,
unsigned char *g,
unsigned char *b,
unsigned char *a)
Retrieves components of an ALLEGRO_COLOR.
void al_unmap_rgb(ALLEGRO_COLOR color,
unsigned char *r,
unsigned char *g,
unsigned char *b)
Retrieves components of an ALLEGRO_COLOR, ignoring alpha Components will range from 0-255.
void al_unmap_rgba_f(ALLEGRO_COLOR color,
float *r,
float *g,
float *b,
float *a)
Retrieves components of an ALLEGRO_COLOR.
void al_unmap_rgb_f(ALLEGRO_COLOR color,
float *r,
float *g,
float *b)
Retrieves components of an ALLEGRO_COLOR, ignoring alpha.