1 #include <grass/raster.h> 2 #include "clr.h" 3 4 /* Font sizes */ 5 #define PS_FONT_MAX_SIZE 50 6 #define PS_FONT_MIN_SIZE 1 7 #define PS_FONT_DEFAULT_SIZE 8 8 9 #define DELTA_Y 0.05 10 #define MAX_PSFILES 20 11 12 #define PAGE_PORTRAIT 1 13 #define PAGE_LANDSCAPE 2 14 15 /* Following XCONV, YCONV were commented because of using G_plot_where_xy() 16 * and uncommented again because G_adjust_easting 17 * in it is not best for each case, RB Jan 2000 18 */ 19 #define XCONV(E_COORD) (PS.map_left + PS.ew_to_x * ((E_COORD) - PS.w.west)) 20 #define YCONV(N_COORD) (PS.map_bot + PS.ns_to_y * ((N_COORD) - PS.w.south)) 21 22 23 struct PS_data 24 { 25 struct Cell_head w; 26 struct Colors colors; 27 struct Categories cats; 28 CELL min_color, max_color; 29 const char *cell_mapset; 30 char *cell_name; 31 char *plfile; 32 char *commentfile; 33 char *grid_font, *geogrid_font; 34 char *psfiles[MAX_PSFILES]; 35 char scaletext[100]; 36 char celltitle[100]; 37 int level; 38 int grey; 39 int mask_needed; 40 int do_header; 41 int do_raster; 42 int do_colortable; 43 int do_border; 44 int do_scalebar; 45 int num_psfiles; 46 int grid, grid_numbers, grid_fontsize; 47 PSCOLOR grid_color, grid_numbers_color; 48 float grid_cross; 49 char geogridunit[64]; 50 int geogrid, geogrid_numbers, geogrid_fontsize; 51 PSCOLOR geogrid_color, geogrid_numbers_color; 52 double grid_width, geogrid_width; 53 int do_outline; 54 PSCOLOR outline_color; 55 int cell_fd; 56 int row_delta, col_delta; 57 int cells_wide, cells_high; 58 int num_panels, startpanel, endpanel; 59 int res; 60 double page_width, page_height; 61 double left_marg, right_marg, top_marg, bot_marg; 62 double map_x_orig, map_y_orig, map_y_loc, min_y, set_y; 63 /* map_y_loc is set by 'maploc' as distance from top 64 * map_x_orig is from left, map_y_orig is from bottom */ 65 double map_pix_wide, map_pix_high; 66 double map_width, map_height; 67 double map_top, map_bot, map_left, map_right; 68 double ew_res, ns_res; 69 double ew_to_x, ns_to_y; 70 double r0, g0, b0; 71 int mask_color; 72 double mask_r, mask_g, mask_b; 73 double outline_width; 74 FILE *fp; 75 }; 76 77 #ifdef WHITE 78 #undef WHITE 79 #endif 80 #ifdef BLACK 81 #undef BLACK 82 #endif 83 #ifdef GREY 84 #undef GREY 85 #endif 86 87 extern struct PS_data PS; 88 extern int WHITE, BLACK, GREY, sec_draw; 89