GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
pngdriver/Box.c
Go to the documentation of this file.
1 
2 #include "pngdriver.h"
3 
4 void PNG_Box_abs(int x1, int y1, int x2, int y2)
5 {
6  int tmp;
7  int x, y;
8 
9  if (x1 > x2)
10  tmp = x1, x1 = x2, x2 = tmp;
11 
12  if (y1 > y2)
13  tmp = y1, y1 = y2, y2 = tmp;
14 
15  if (x2 < 0 || x1 > width)
16  return;
17 
18  if (y2 < 0 || y1 > height)
19  return;
20 
21  if (x1 < clip_left)
22  x1 = clip_left;
23 
24  if (x2 > clip_rite)
25  x2 = clip_rite;
26 
27  if (y1 < clip_top)
28  y1 = clip_top;
29 
30  if (y2 > clip_bot)
31  y2 = clip_bot;
32 
33  for (y = y1; y < y2; y++) {
34  unsigned int *p = &grid[y * width + x1];
35 
36  for (x = x1; x < x2; x++)
37  *p++ = currentColor;
38  }
39 
40  modified = 1;
41 }
int currentColor
int modified
tuple width
int clip_rite
unsigned char * grid
int y
Definition: plot.c:34
int clip_bot
void PNG_Box_abs(int x1, int y1, int x2, int y2)
Definition: pngdriver/Box.c:4
int clip_top
int clip_left
int height