GRASS Programmer's Manual
6.5.svn(2014)-r66266
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
}
b
float b
Definition:
named_colr.c:8
pngdriver.h
currentColor
int currentColor
Definition:
pngdriver/Graph_set.c:27
r
float r
Definition:
named_colr.c:8
PNG_color
void PNG_color(int number)
Definition:
pngdriver/Color.c:12
true_color
int true_color
Definition:
pngdriver/Graph_set.c:28
NCOLORS
int NCOLORS
Definition:
driver/init.c:30
g
float g
Definition:
named_colr.c:8
G_warning
G_warning("category support for [%s] in mapset [%s] %s", name, mapset, type)
get_color
unsigned int get_color(int r, int g, int b, int a)
Definition:
pngdriver/Color_table.c:124
lib
pngdriver
Color.c
Generated on Sat Jan 2 2016 01:46:47 for GRASS Programmer's Manual by
1.8.5