GRASS Programmer's Manual
6.4.2(2012)
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
pngdriver/Color.c
Go to the documentation of this file.
1
/*
2
* Identify a color that has been set in the reset_color() (found in Reset_clr.c
3
* file in this directory). Subsequent graphics calls will use this color.
4
*
5
* Called by:
6
* Color() in ../lib/Color.c
7
*/
8
9
#include <grass/gis.h>
10
#include "
pngdriver.h
"
11
12
void
PNG_color
(
int
number)
13
{
14
if
(number >=
NCOLORS
|| number < 0) {
15
G_warning
(
"Color: can't set color %d\n"
, number);
16
return
;
17
}
18
19
if
(
true_color
) {
20
int
r
= (number >> 16) & 0xFF;
21
int
g
= (number >> 8) & 0xFF;
22
int
b
= (number >> 0) & 0xFF;
23
24
currentColor
=
get_color
(r, g, b, 0);
25
}
26
else
27
currentColor
= number;
28
}
lib
pngdriver
Color.c
Generated on Sun Sep 9 2012 18:55:30 for GRASS Programmer's Manual by
1.8.1.2