[GRASS-SVN] r38001 - in grass/trunk: include lib/display
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Jun 20 10:28:18 EDT 2009
Author: martinl
Date: 2009-06-20 10:28:17 -0400 (Sat, 20 Jun 2009)
New Revision: 38001
Modified:
grass/trunk/include/display_raster.h
grass/trunk/lib/display/draw2.c
grass/trunk/lib/display/r_raster.c
grass/trunk/lib/display/raster.c
grass/trunk/lib/display/raster2.c
grass/trunk/lib/display/tran_colr.c
grass/trunk/lib/display/window.c
Log:
R_() fns used only by display library renamed to R__()
Modified: grass/trunk/include/display_raster.h
===================================================================
--- grass/trunk/include/display_raster.h 2009-06-20 12:38:05 UTC (rev 38000)
+++ grass/trunk/include/display_raster.h 2009-06-20 14:28:17 UTC (rev 38001)
@@ -1,45 +1,39 @@
-#ifndef _GRASS_RASTER_H
-#define _GRASS_RASTER_H
+#ifndef _GRASS_DISPLAY_RASTER_H
+#define _GRASS_DISPLAY_RASTER_H
+void R__line_width(double);
+void R__get_text_box(const char *, double *, double *, double *, double *);
+void R__pos_abs(double, double);
+void R__begin(void);
+void R__move(double, double);
+void R__cont(double, double);
+void R__close(void);
+void R__stroke(void);
+void R__fill(void);
+void R__point(double, double);
+void R__RGB_color(int, int, int);
+int R__scaled_raster(int, int,
+ const unsigned char *,
+ const unsigned char *,
+ const unsigned char *, const unsigned char *);
+void R__begin_scaled_raster(int, int[2][2], double[2][2]);
+void R__end_scaled_raster(void);
+void R__standard_color(int);
+
int R_open_driver(void);
void R_close_driver(void);
-void R_set_window(double, double, double, double);
void R_get_window(double *, double *, double *, double *);
-void R_standard_color(int);
-void R_RGB_color(int, int, int);
-
-void R_line_width(double);
void R_erase(void);
-void R_pos_abs(double, double);
-void R_box_abs(double, double, double, double);
-
-void R_begin(void);
-void R_move(double, double);
-void R_cont(double, double);
-void R_close(void);
-void R_stroke(void);
-void R_fill(void);
-void R_point(double, double);
-
void R_text_size(double, double);
void R_text_rotation(double);
void R_text(const char *);
-void R_get_text_box(const char *, double *, double *, double *, double *);
void R_font(const char *);
void R_encoding(const char *);
void R_font_list(char ***, int *);
void R_font_info(char ***, int *);
-void R_begin_scaled_raster(int, int[2][2], double[2][2]);
-int R_scaled_raster(int, int,
- const unsigned char *,
- const unsigned char *,
- const unsigned char *, const unsigned char *);
-void R_end_scaled_raster(void);
-void R_bitmap(int, int, int, const unsigned char *);
-
#endif
Modified: grass/trunk/lib/display/draw2.c
===================================================================
--- grass/trunk/lib/display/draw2.c 2009-06-20 12:38:05 UTC (rev 38000)
+++ grass/trunk/lib/display/draw2.c 2009-06-20 14:28:17 UTC (rev 38001)
@@ -3,8 +3,8 @@
#include <string.h>
#include <grass/gis.h>
+#include <grass/display.h>
#include <grass/display_raster.h>
-#include <grass/display.h>
#include <grass/glocale.h>
#include "path.h"
#include "clip.h"
@@ -186,14 +186,14 @@
void D_line_width(double d)
{
- R_line_width(d > 0 ? d : 0);
+ R__line_width(d > 0 ? d : 0);
}
void D_get_text_box(const char *text, double *t, double *b, double *l, double *r)
{
double T, B, L, R;
- R_get_text_box(text, &T, &B, &L, &R);
+ R__get_text_box(text, &T, &B, &L, &R);
*t = D_d_to_u_row(T);
*b = D_d_to_u_row(B);
@@ -219,7 +219,7 @@
x = D_u_to_d_col(x);
y = D_u_to_d_row(y);
- R_pos_abs(x, y);
+ R__pos_abs(x, y);
}
void D_pos_rel(double x, double y)
@@ -266,19 +266,19 @@
p = &eps_path;
}
- R_begin();
+ R__begin();
for (i = 0; i < p->count; i++) {
struct vertex *v = &p->vertices[i];
switch (v->mode)
{
case P_MOVE:
- R_move(v->x, v->y);
+ R__move(v->x, v->y);
break;
case P_CONT:
- R_cont(v->x, v->y);
+ R__cont(v->x, v->y);
break;
case P_CLOSE:
- R_close();
+ R__close();
break;
}
}
@@ -317,13 +317,13 @@
void D_stroke(void)
{
do_path(0);
- R_stroke();
+ R__stroke();
}
void D_fill(void)
{
do_path(1);
- R_fill();
+ R__fill();
}
void D_dots(void)
@@ -352,7 +352,7 @@
x = D_u_to_d_col(x);
y = D_u_to_d_row(y);
- R_point(x, y);
+ R__point(x, y);
}
}
Modified: grass/trunk/lib/display/r_raster.c
===================================================================
--- grass/trunk/lib/display/r_raster.c 2009-06-20 12:38:05 UTC (rev 38000)
+++ grass/trunk/lib/display/r_raster.c 2009-06-20 14:28:17 UTC (rev 38001)
@@ -1,4 +1,16 @@
+/*!
+ \file display/r_raster.c
+ \brief Display Library - Raster graphics subroutines
+
+ (C) 2001-2009 by the GRASS Development Team
+
+ This program is free software under the GNU General Public License
+ (>=v2). Read the file COPYING that comes with GRASS for details.
+
+ \author Original author CERL
+*/
+
#include <grass/config.h>
#include <errno.h>
@@ -22,6 +34,8 @@
extern const struct driver *Cairo_Driver(void);
#endif
+static void set_window(double, double, double, double);
+
static void init(void)
{
const char *fenc = getenv("GRASS_ENCODING");
@@ -36,7 +50,7 @@
R_encoding(fenc);
if (line_width)
- R_line_width(atof(line_width));
+ R__line_width(atof(line_width));
if (text_size) {
double s = atof(text_size);
@@ -48,7 +62,7 @@
if (frame) {
double t, b, l, r;
sscanf(frame, "%lf,%lf,%lf,%lf", &t, &b, &l, &r);
- R_set_window(t, b, l, r);
+ set_window(t, b, l, r);
}
}
@@ -95,7 +109,7 @@
* \return void
*/
-void R_standard_color(int index)
+void R__standard_color(int index)
{
COM_Standard_color(index);
}
@@ -114,7 +128,7 @@
* \return void
*/
-void R_RGB_color(int red, int grn, int blu)
+void R__RGB_color(int red, int grn, int blu)
{
COM_Color_RGB(red, grn, blu);
}
@@ -128,7 +142,7 @@
* \return void
*/
-void R_line_width(double width)
+void R__line_width(double width)
{
COM_Line_width(width);
}
@@ -158,31 +172,12 @@
* \return void
*/
-void R_pos_abs(double x, double y)
+void R__pos_abs(double x, double y)
{
COM_Pos_abs(x, y);
}
/*!
- * \brief fill a box
- *
- * A box is drawn in the current color using the coordinates <b>x1,y1</b> and
- * <b>x2,y2</b> as opposite corners of the box. The current location is undefined
- * afterwards
- *
- * \param x1
- * \param y1
- * \param x2
- * \param y2
- * \return void
- */
-
-void R_box_abs(double x1, double y1, double x2, double y2)
-{
- COM_Box_abs(x1, y1, x2, y2);
-}
-
-/*!
* \brief set text size
*
* Sets text pixel width and height to <b>width</b> and <b>height.</b>
@@ -215,7 +210,7 @@
* \return void
*/
-void R_set_window(double t, double b, double l, double r)
+void set_window(double t, double b, double l, double r)
{
COM_Set_window(t, b, l, r);
}
@@ -269,7 +264,7 @@
* \return void
*/
-void R_get_text_box(const char *text, double *t, double *b, double *l, double *r)
+void R__get_text_box(const char *text, double *t, double *b, double *l, double *r)
{
COM_Get_text_box(text, t, b, l, r);
}
@@ -303,59 +298,54 @@
COM_Font_info(list, count);
}
-void R_begin_scaled_raster(int mask, int src[2][2], double dst[2][2])
+void R__begin_scaled_raster(int mask, int src[2][2], double dst[2][2])
{
COM_begin_raster(mask, src, dst);
}
-int R_scaled_raster(int n, int row,
- const unsigned char *red, const unsigned char *grn,
- const unsigned char *blu, const unsigned char *nul)
+int R__scaled_raster(int n, int row,
+ const unsigned char *red, const unsigned char *grn,
+ const unsigned char *blu, const unsigned char *nul)
{
return COM_raster(n, row, red, grn, blu, nul);
}
-void R_end_scaled_raster(void)
+void R__end_scaled_raster(void)
{
COM_end_raster();
}
-void R_bitmap(int ncols, int nrows, int threshold, const unsigned char *buf)
+void R__begin(void)
{
- COM_Bitmap(ncols, nrows, threshold, buf);
-}
-
-void R_begin(void)
-{
COM_Begin();
}
-void R_move(double x, double y)
+void R__move(double x, double y)
{
COM_Move(x, y);
}
-void R_cont(double x, double y)
+void R__cont(double x, double y)
{
COM_Cont(x, y);
}
-void R_close(void)
+void R__close(void)
{
COM_Close();
}
-void R_stroke(void)
+void R__stroke(void)
{
COM_Stroke();
}
-void R_fill(void)
+void R__fill(void)
{
COM_Fill();
}
-void R_point(double x, double y)
+void R__point(double x, double y)
{
COM_Point(x, y);
}
Modified: grass/trunk/lib/display/raster.c
===================================================================
--- grass/trunk/lib/display/raster.c 2009-06-20 12:38:05 UTC (rev 38000)
+++ grass/trunk/lib/display/raster.c 2009-06-20 14:28:17 UTC (rev 38001)
@@ -108,7 +108,7 @@
}
A_row =
- R_scaled_raster(ncols, A_row, red, grn, blu,
+ R__scaled_raster(ncols, A_row, red, grn, blu,
D__overlay_mode ? set : NULL);
return (A_row < src[1][1])
@@ -135,7 +135,7 @@
/* Set up the screen for drawing map */
D_get_a(src);
D_get_d(dst);
- R_begin_scaled_raster(D__overlay_mode, src, dst);
+ R__begin_scaled_raster(D__overlay_mode, src, dst);
}
int D_draw_raster_RGB(int A_row,
@@ -183,7 +183,7 @@
}
A_row =
- R_scaled_raster(ncols, A_row, r_buf, g_buf, b_buf,
+ R__scaled_raster(ncols, A_row, r_buf, g_buf, b_buf,
D__overlay_mode ? n_buf : NULL);
return (A_row < src[1][1])
@@ -192,5 +192,5 @@
void D_cell_draw_end(void)
{
- R_end_scaled_raster();
+ R__end_scaled_raster();
}
Modified: grass/trunk/lib/display/raster2.c
===================================================================
--- grass/trunk/lib/display/raster2.c 2009-06-20 12:38:05 UTC (rev 38000)
+++ grass/trunk/lib/display/raster2.c 2009-06-20 14:28:17 UTC (rev 38001)
@@ -137,7 +137,7 @@
int r, g, b;
G_get_raster_color(raster, &r, &g, &b, colors, data_type);
- R_RGB_color((unsigned char)r, (unsigned char)g, (unsigned char)b);
+ R__RGB_color((unsigned char)r, (unsigned char)g, (unsigned char)b);
return 0;
}
Modified: grass/trunk/lib/display/tran_colr.c
===================================================================
--- grass/trunk/lib/display/tran_colr.c 2009-06-20 12:38:05 UTC (rev 38000)
+++ grass/trunk/lib/display/tran_colr.c 2009-06-20 14:28:17 UTC (rev 38001)
@@ -144,14 +144,14 @@
return 0;
if (color < G_num_standard_colors()) {
- R_standard_color(color);
+ R__standard_color(color);
return 1;
}
if (color < ncolors) {
const struct color_rgb *c = &colors[color];
- R_RGB_color(c->r, c->g, c->b);
+ R__RGB_color(c->r, c->g, c->b);
return 1;
}
@@ -211,6 +211,6 @@
void D_RGB_color(int red, int grn, int blu)
{
- R_RGB_color(red, grn, blu);
+ R__RGB_color(red, grn, blu);
}
Modified: grass/trunk/lib/display/window.c
===================================================================
--- grass/trunk/lib/display/window.c 2009-06-20 12:38:05 UTC (rev 38000)
+++ grass/trunk/lib/display/window.c 2009-06-20 14:28:17 UTC (rev 38001)
@@ -21,12 +21,12 @@
D_use_color(colorindex);
/* Do the plotting */
- R_begin();
- R_move(l, b);
- R_cont(r, b);
- R_cont(r, t);
- R_cont(l, t);
- R_close();
- R_fill();
+ R__begin();
+ R__move(l, b);
+ R__cont(r, b);
+ R__cont(r, t);
+ R__cont(l, t);
+ R__close();
+ R__fill();
}
More information about the grass-commit
mailing list