GRASS Programmer's Manual
6.4.2(2012)
|
00001 00002 #include <stdio.h> 00003 00004 #include <sys/types.h> 00005 #include <sys/stat.h> 00006 #include <fcntl.h> 00007 #include <unistd.h> 00008 00009 #include <grass/gis.h> 00010 #include <grass/raster.h> 00011 #include <grass/graphics.h> 00012 00013 #include "driver.h" 00014 #include "transport.h" 00015 00025 int LOC_screen_left(void) 00026 { 00027 int l; 00028 00029 COM_Screen_left(&l); 00030 00031 return l; 00032 } 00033 00043 int LOC_screen_rite(void) 00044 { 00045 int r; 00046 00047 COM_Screen_rite(&r); 00048 00049 return r; 00050 } 00051 00061 int LOC_screen_bot(void) 00062 { 00063 int b; 00064 00065 COM_Screen_bot(&b); 00066 00067 return b; 00068 } 00069 00070 00080 int LOC_screen_top(void) 00081 { 00082 int t; 00083 00084 COM_Screen_top(&t); 00085 00086 return t; 00087 } 00088 00089 void LOC_get_num_colors(int *n) 00090 { 00091 COM_Number_of_colors(n); 00092 } 00093 00106 void LOC_standard_color(int index) 00107 { 00108 COM_Standard_color(index); 00109 } 00110 00125 void LOC_RGB_color(unsigned char red, unsigned char grn, unsigned char blu) 00126 { 00127 COM_Color_RGB(red, grn, blu); 00128 } 00129 00139 void LOC_line_width(int width) 00140 { 00141 COM_Line_width(width); 00142 } 00143 00153 void LOC_erase(void) 00154 { 00155 COM_Erase(); 00156 } 00157 00169 void LOC_move_abs(int x, int y) 00170 { 00171 COM_Move_abs(x, y); 00172 } 00173 00189 void LOC_move_rel(int x, int y) 00190 { 00191 COM_Move_rel(x, y); 00192 } 00193 00206 void LOC_cont_abs(int x, int y) 00207 { 00208 COM_Cont_abs(x, y); 00209 } 00210 00228 void LOC_cont_rel(int x, int y) 00229 { 00230 COM_Cont_rel(x, y); 00231 } 00232 00246 void LOC_polydots_abs(const int *xarray, const int *yarray, int number) 00247 { 00248 COM_Polydots_abs(xarray, yarray, number); 00249 } 00250 00266 void LOC_polydots_rel(const int *xarray, const int *yarray, int number) 00267 { 00268 COM_Polydots_rel(xarray, yarray, number); 00269 } 00270 00287 void LOC_polyline_abs(const int *xarray, const int *yarray, int number) 00288 { 00289 COM_Polyline_abs(xarray, yarray, number); 00290 } 00291 00309 void LOC_polyline_rel(const int *xarray, const int *yarray, int number) 00310 { 00311 COM_Polyline_rel(xarray, yarray, number); 00312 } 00313 00327 void LOC_polygon_abs(const int *xarray, const int *yarray, int number) 00328 { 00329 COM_Polygon_abs(xarray, yarray, number); 00330 } 00331 00347 void LOC_polygon_rel(const int *xarray, const int *yarray, int number) 00348 { 00349 COM_Polygon_rel(xarray, yarray, number); 00350 } 00351 00366 void LOC_box_abs(int x1, int y1, int x2, int y2) 00367 { 00368 COM_Box_abs(x1, y1, x2, y2); 00369 } 00370 00371 00384 void LOC_box_rel(int x, int y) 00385 { 00386 COM_Box_rel(x, y); 00387 } 00388 00399 void LOC_text_size(int width, int height) 00400 { 00401 COM_Text_size(width, height); 00402 } 00403 00404 void LOC_text_rotation(float rotation) 00405 { 00406 COM_Text_rotation(rotation); 00407 } 00408 00422 void LOC_set_window(int t, int b, int l, int r) 00423 { 00424 COM_Set_window(t, b, l, r); 00425 } 00426 00437 void LOC_text(const char *text) 00438 { 00439 COM_Text(text); 00440 } 00441 00459 void LOC_get_text_box(const char *text, int *t, int *b, int *l, int *r) 00460 { 00461 COM_Get_text_box(text, t, b, l, r); 00462 } 00463 00496 void LOC_font(const char *name) 00497 { 00498 COM_Font_get(name); 00499 } 00500 00501 void LOC_charset(const char *name) 00502 { 00503 COM_Font_init_charset(name); 00504 } 00505 00506 void LOC_font_list(char ***list, int *count) 00507 { 00508 COM_Font_list(list, count); 00509 } 00510 00511 void LOC_font_info(char ***list, int *count) 00512 { 00513 COM_Font_info(list, count); 00514 } 00515 00516 void LOC_panel_save(const char *name, int t, int b, int l, int r) 00517 { 00518 close(creat(name, 0666)); 00519 00520 COM_Panel_save(name, t, b, l, r); 00521 R_stabilize(); 00522 } 00523 00524 void LOC_panel_restore(const char *name) 00525 { 00526 COM_Panel_restore(name); 00527 R_stabilize(); 00528 } 00529 00530 void LOC_panel_delete(const char *name) 00531 { 00532 COM_Panel_delete(name); 00533 R_stabilize(); 00534 00535 remove(name); 00536 } 00537 00538 void LOC_begin_scaled_raster(int mask, int src[2][2], int dst[2][2]) 00539 { 00540 COM_begin_scaled_raster(mask, src, dst); 00541 } 00542 00543 int LOC_scaled_raster(int n, int row, 00544 const unsigned char *red, const unsigned char *grn, 00545 const unsigned char *blu, const unsigned char *nul) 00546 { 00547 return COM_scaled_raster(n, row, red, grn, blu, nul); 00548 } 00549 00550 void LOC_end_scaled_raster(void) 00551 { 00552 COM_end_scaled_raster(); 00553 } 00554 00555 void LOC_bitmap(int ncols, int nrows, int threshold, const unsigned char *buf) 00556 { 00557 COM_Bitmap(ncols, nrows, threshold, buf); 00558 }