GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
loc_proto.c File Reference
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <grass/gis.h>
#include <grass/raster.h>
#include <grass/graphics.h>
#include "driver.h"
#include "transport.h"
Include dependency graph for loc_proto.c:

Go to the source code of this file.

Functions

int LOC_screen_left (void)
 screen left edge More...
 
int LOC_screen_rite (void)
 screen right edge More...
 
int LOC_screen_bot (void)
 bottom of screen More...
 
int LOC_screen_top (void)
 top of screen More...
 
void LOC_get_num_colors (int *n)
 
void LOC_standard_color (int index)
 select standard color More...
 
void LOC_RGB_color (unsigned char red, unsigned char grn, unsigned char blu)
 select color More...
 
void LOC_line_width (int width)
 change the width of line More...
 
void LOC_erase (void)
 erase screen More...
 
void LOC_move_abs (int x, int y)
 move current location More...
 
void LOC_move_rel (int x, int y)
 move current location More...
 
void LOC_cont_abs (int x, int y)
 draw line More...
 
void LOC_cont_rel (int x, int y)
 draw line More...
 
void LOC_polydots_abs (const int *xarray, const int *yarray, int number)
 draw a series of dots More...
 
void LOC_polydots_rel (const int *xarray, const int *yarray, int number)
 draw a series of dots More...
 
void LOC_polyline_abs (const int *xarray, const int *yarray, int number)
 draw an open polygon More...
 
void LOC_polyline_rel (const int *xarray, const int *yarray, int number)
 draw an open polygon More...
 
void LOC_polygon_abs (const int *xarray, const int *yarray, int number)
 draw a closed polygon More...
 
void LOC_polygon_rel (const int *xarray, const int *yarray, int number)
 draw a closed polygon More...
 
void LOC_box_abs (int x1, int y1, int x2, int y2)
 fill a box More...
 
void LOC_box_rel (int x, int y)
 fill a box More...
 
void LOC_text_size (int width, int height)
 set text size More...
 
void LOC_text_rotation (float rotation)
 
void LOC_set_window (int t, int b, int l, int r)
 set text clipping frame More...
 
void LOC_text (const char *text)
 write text More...
 
void LOC_get_text_box (const char *text, int *t, int *b, int *l, int *r)
 get text extents More...
 
void LOC_font (const char *name)
 choose font More...
 
void LOC_charset (const char *name)
 
void LOC_font_list (char ***list, int *count)
 
void LOC_font_info (char ***list, int *count)
 
void LOC_panel_save (const char *name, int t, int b, int l, int r)
 
void LOC_panel_restore (const char *name)
 
void LOC_panel_delete (const char *name)
 
void LOC_begin_scaled_raster (int mask, int src[2][2], int dst[2][2])
 
int LOC_scaled_raster (int n, int row, const unsigned char *red, const unsigned char *grn, const unsigned char *blu, const unsigned char *nul)
 
void LOC_end_scaled_raster (void)
 
void LOC_bitmap (int ncols, int nrows, int threshold, const unsigned char *buf)
 

Function Documentation

void LOC_begin_scaled_raster ( int  mask,
int  src[2][2],
int  dst[2][2] 
)

Definition at line 538 of file loc_proto.c.

References COM_begin_scaled_raster().

void LOC_bitmap ( int  ncols,
int  nrows,
int  threshold,
const unsigned char *  buf 
)

Definition at line 555 of file loc_proto.c.

References COM_Bitmap().

void LOC_box_abs ( int  x1,
int  y1,
int  x2,
int  y2 
)

fill a box

A box is drawn in the current color using the coordinates x1,y1 and x2,y2 as opposite corners of the box. The current location is undefined afterwards

Parameters
x1
y1
x2
y2
Returns
int

Definition at line 366 of file loc_proto.c.

References COM_Box_abs().

void LOC_box_rel ( int  x,
int  y 
)

fill a box

A box is drawn in the current color using the current location as one corner and the current location plus x and y as the opposite corner of the box. The current location is undefined afterwards.

Parameters
x
y
Returns
int

Definition at line 384 of file loc_proto.c.

References COM_Box_rel().

void LOC_charset ( const char *  name)

Definition at line 501 of file loc_proto.c.

References COM_Font_init_charset().

void LOC_cont_abs ( int  x,
int  y 
)

draw line

Draw a line using the current color, selected via R_color, from the current location to the location specified by x,y. The current location is updated to x,y.

Parameters
x
y
Returns
int

Definition at line 206 of file loc_proto.c.

References COM_Cont_abs().

void LOC_cont_rel ( int  x,
int  y 
)

draw line

Draw a line using the current color, selected via R_color, from the current location to the relative location specified by x and y. The current location is updated:

Newx = Oldx + x;
Newy = Oldy + y;
Parameters
x
y
Returns
int

Definition at line 228 of file loc_proto.c.

References COM_Cont_rel().

void LOC_end_scaled_raster ( void  )

Definition at line 550 of file loc_proto.c.

References COM_end_scaled_raster().

void LOC_erase ( void  )

erase screen

Erases the entire screen to black.

Parameters
void
Returns
int

Definition at line 153 of file loc_proto.c.

References COM_Erase().

void LOC_font ( const char *  name)

choose font

Set current font to font name. Available fonts are:

Font NameDescription
cyrilc cyrillic
gothgbt Gothic Great Britain triplex
gothgrt Gothic German triplex
gothitt Gothic Italian triplex
greekc Greek complex
greekcs Greek complex script
greekp Greek plain
greeks Greek simplex
italicc Italian complex
italiccs Italian complex small
italict Italian triplex
romanc Roman complex
romancs Roman complex small
romand Roman duplex
romanp Roman plain
romans Roman simplex
romant Roman triplex
scriptc Script complex
scripts Script simplex
Parameters
name
Returns
int

Definition at line 496 of file loc_proto.c.

References COM_Font_get().

void LOC_font_info ( char ***  list,
int count 
)

Definition at line 511 of file loc_proto.c.

References COM_Font_info().

void LOC_font_list ( char ***  list,
int count 
)

Definition at line 506 of file loc_proto.c.

References COM_Font_list().

void LOC_get_num_colors ( int n)

Definition at line 89 of file loc_proto.c.

References COM_Number_of_colors().

void LOC_get_text_box ( const char *  text,
int t,
int b,
int l,
int r 
)

get text extents

The extent of the area enclosing the text is returned in the integer pointers top, bottom, left, and right. No text is actually drawn. This is useful for capturing the text extent so that the text location can be prepared with proper background or border.

Parameters
sometext
ttop
bbottom
lleft
rright
Returns
int

Definition at line 459 of file loc_proto.c.

References COM_Get_text_box().

void LOC_line_width ( int  width)

change the width of line

Changes the width of line to be used in subsequent draw commands.

Parameters
width
Returns
int

Definition at line 139 of file loc_proto.c.

References COM_Line_width().

void LOC_move_abs ( int  x,
int  y 
)

move current location

Move the current location to the absolute screen coordinate x,y. Nothing is drawn on the screen.

Parameters
x
y
Returns
int

Definition at line 169 of file loc_proto.c.

References COM_Move_abs().

void LOC_move_rel ( int  x,
int  y 
)

move current location

Shift the current screen location by the values in dx and dy:

Newx = Oldx + dx;
Newy = Oldy + dy;

Nothing is drawn on the screen.

Parameters
xdx
ydy
Returns
int

Definition at line 189 of file loc_proto.c.

References COM_Move_rel().

void LOC_panel_delete ( const char *  name)

Definition at line 530 of file loc_proto.c.

References COM_Panel_delete(), render::name, and R_stabilize().

void LOC_panel_restore ( const char *  name)

Definition at line 524 of file loc_proto.c.

References COM_Panel_restore(), and R_stabilize().

void LOC_panel_save ( const char *  name,
int  t,
int  b,
int  l,
int  r 
)

Definition at line 516 of file loc_proto.c.

References COM_Panel_save(), and R_stabilize().

void LOC_polydots_abs ( const int xarray,
const int yarray,
int  number 
)

draw a series of dots

Pixels at the num absolute positions in the x and y arrays are turned to the current color. The current location is left updated to the position of the last dot.

Parameters
xarrayx
yarrayy
number
Returns
int

Definition at line 246 of file loc_proto.c.

References COM_Polydots_abs().

void LOC_polydots_rel ( const int xarray,
const int yarray,
int  number 
)

draw a series of dots

Pixels at the number relative positions in the x and y arrays are turned to the current color. The first position is relative to the starting current location; the succeeding positions are then relative to the previous position. The current location is updated to the position of the last dot.

Parameters
xarrayx
yarrayy
number
Returns
int

Definition at line 266 of file loc_proto.c.

References COM_Polydots_rel().

void LOC_polygon_abs ( const int xarray,
const int yarray,
int  number 
)

draw a closed polygon

The number absolute positions in the x and y arrays outline a closed polygon which is filled with the current color. The current location is undefined afterwards.

Parameters
xarrayx
yarrayy
number
Returns
int

Definition at line 327 of file loc_proto.c.

References COM_Polygon_abs().

void LOC_polygon_rel ( const int xarray,
const int yarray,
int  number 
)

draw a closed polygon

The number relative positions in the x and y arrays outline a closed polygon which is filled with the current color. The first position is relative to the starting current location; the succeeding positions are then relative to the previous position. The current location is undefined afterwards.

Parameters
xarrayx
yarrayy
number
Returns
int

Definition at line 347 of file loc_proto.c.

References COM_Polygon_rel().

void LOC_polyline_abs ( const int xarray,
const int yarray,
int  number 
)

draw an open polygon

The number absolute positions in the x and y arrays are used to generate a multisegment line (often curved). This line is drawn with the current color. The current location is left updated to the position of the last point. Note. It is not assumed that the line is closed, i.e., no line is drawn from the last point to the first point.

Parameters
xarrayx
yarrayy
number
Returns
int

Definition at line 287 of file loc_proto.c.

References COM_Polyline_abs().

void LOC_polyline_rel ( const int xarray,
const int yarray,
int  number 
)

draw an open polygon

The number relative positions in the x and y arrays are used to generate a multisegment line (often curved). The first position is relative to the starting current location; the succeeding positions are then relative to the previous position. The current location is updated to the position of the last point. This line is drawn with the current color. Note. No line is drawn between the last point and the first point.

Parameters
xarrayx
yarrayy
number
Returns
int

Definition at line 309 of file loc_proto.c.

References COM_Polyline_rel().

void LOC_RGB_color ( unsigned char  red,
unsigned char  grn,
unsigned char  blu 
)

select color

When in float mode (see R_color_table_float), this call selects the color most closely matched to the red, grn, and blue intensities requested. These values must be in the range of 0-255.

Parameters
red
grn
blue
Returns
int

Definition at line 125 of file loc_proto.c.

References COM_Color_RGB().

int LOC_scaled_raster ( int  n,
int  row,
const unsigned char *  red,
const unsigned char *  grn,
const unsigned char *  blu,
const unsigned char *  nul 
)

Definition at line 543 of file loc_proto.c.

References COM_scaled_raster().

int LOC_screen_bot ( void  )

bottom of screen

Returns the coordinate of the bottom of the screen.

Parameters
void
Returns
int

Definition at line 61 of file loc_proto.c.

References b, and COM_Screen_bot().

int LOC_screen_left ( void  )

screen left edge

Returns the coordinate of the left edge of the screen.

Parameters
void
Returns
int

Definition at line 25 of file loc_proto.c.

References COM_Screen_left(), and l.

int LOC_screen_rite ( void  )

screen right edge

Returns the coordinate of the right edge of the screen.

Parameters
void
Returns
int

Definition at line 43 of file loc_proto.c.

References COM_Screen_rite(), and r.

int LOC_screen_top ( void  )

top of screen

Returns the coordinate of the top of the screen.

Parameters
void
Returns
int

Definition at line 80 of file loc_proto.c.

References COM_Screen_top().

void LOC_set_window ( int  t,
int  b,
int  l,
int  r 
)

set text clipping frame

Subsequent calls to R_text will have text strings clipped to the screen frame defined by top, bottom, left, right.

Parameters
ttop
bbottom
lleft
rright
Returns
int

Definition at line 422 of file loc_proto.c.

References COM_Set_window().

void LOC_standard_color ( int  index)

select standard color

Selects the standard color to be used in subsequent draw commands. The color value is best retrieved using D_translate_color. See Display_Graphics_Library.

Parameters
index
Returns
int

Definition at line 106 of file loc_proto.c.

References COM_Standard_color().

void LOC_text ( const char *  text)

write text

Writes text in the current color and font, at the current text width and height, starting at the current screen location.

Parameters
sometext
Returns
int

Definition at line 437 of file loc_proto.c.

References COM_Text().

void LOC_text_rotation ( float  rotation)

Definition at line 404 of file loc_proto.c.

References COM_Text_rotation().

void LOC_text_size ( int  width,
int  height 
)

set text size

Sets text pixel width and height to width and height.

Parameters
width
height
Returns
int

Definition at line 399 of file loc_proto.c.

References COM_Text_size().