GRASS GIS 8 Programmer's Manual
8.2.2dev(2023)-3d2c704037
|
GRASS cairo display driver - header file. More...
#include <grass/config.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <cairo.h>
#include <grass/gis.h>
#include "driver.h"
#include "driverlib.h"
Go to the source code of this file.
Data Structures | |
struct | cairo_state |
Macros | |
#define | CAIRO_HAS_XLIB_XRENDER_SURFACE 0 |
#define | DEFAULT_FILE_NAME "map.png" |
#define | HEADER_SIZE 64 |
#define | COLORSCALE (1.0/255.0) |
#define | CAIROCOLOR(a) (((double)(a))*COLORSCALE) |
#define | FTYPE_UNKNOWN 0 |
#define | FTYPE_PPM 1 |
#define | FTYPE_BMP 2 |
#define | FTYPE_PNG 3 |
#define | FTYPE_PDF 4 |
#define | FTYPE_PS 5 |
#define | FTYPE_SVG 6 |
#define | FTYPE_X11 7 |
Functions | |
const struct driver * | Cairo_Driver (void) |
Initialize display driver. More... | |
void | Cairo_Client_Close (void) |
int | Cairo_Graph_set (void) |
Initialize driver. More... | |
const char * | Cairo_Graph_get_file (void) |
Get render file. More... | |
void | Cairo_Graph_close (void) |
Close driver. More... | |
void | Cairo_Box (double, double, double, double) |
Draw a (filled) rectangle. More... | |
void | Cairo_Set_window (double, double, double, double) |
Set window. More... | |
void | Cairo_Bitmap (int, int, int, const unsigned char *) |
Draw bitmap. More... | |
void | Cairo_Color (int, int, int) |
Set source color (opaque) More... | |
void | Cairo_Erase (void) |
Erase screen. More... | |
void | Cairo_begin_raster (int, int[2][2], double[2][2]) |
Start drawing raster. More... | |
int | Cairo_raster (int, int, const unsigned char *, const unsigned char *, const unsigned char *, const unsigned char *) |
Draw raster row. More... | |
void | Cairo_end_raster (void) |
Finish drawing raster. More... | |
void | Cairo_Begin (void) |
void | Cairo_Move (double, double) |
void | Cairo_Cont (double, double) |
void | Cairo_Close (void) |
void | Cairo_Stroke (void) |
void | Cairo_Fill (void) |
void | Cairo_Point (double, double) |
void | Cairo_Line_width (double) |
Set line width. More... | |
void | Cairo_Text (const char *) |
Draw text. More... | |
void | Cairo_text_box (const char *, double *, double *, double *, double *) |
void | Cairo_set_font (const char *) |
Set font. More... | |
void | Cairo_font_list (char ***, int *) |
Get list of fonts. More... | |
void | Cairo_font_info (char ***, int *) |
Get fonts into. More... | |
void | cairo_read_image (void) |
void | cairo_read_ppm (void) |
void | cairo_read_bmp (void) |
void | cairo_read_xid (void) |
void | cairo_write_image (void) |
void | cairo_write_ppm (void) |
void | cairo_write_bmp (void) |
void | cairo_write_xid (void) |
Variables | |
cairo_surface_t * | surface |
cairo_t * | cairo |
struct cairo_state | ca |
GRASS cairo display driver - header file.
(C) 2007-2008 by Lars Ahlzen and 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.
Definition in file cairodriver.h.
#define CAIRO_HAS_XLIB_XRENDER_SURFACE 0 |
Definition at line 28 of file cairodriver.h.
#define CAIROCOLOR | ( | a | ) | (((double)(a))*COLORSCALE) |
Definition at line 49 of file cairodriver.h.
Referenced by Cairo_Color(), and Cairo_Graph_set().
#define COLORSCALE (1.0/255.0) |
Definition at line 48 of file cairodriver.h.
#define DEFAULT_FILE_NAME "map.png" |
Definition at line 43 of file cairodriver.h.
#define FTYPE_BMP 2 |
Definition at line 54 of file cairodriver.h.
Referenced by cairo_read_image(), and cairo_write_image().
#define FTYPE_PDF 4 |
Definition at line 56 of file cairodriver.h.
#define FTYPE_PNG 3 |
Definition at line 55 of file cairodriver.h.
Referenced by cairo_read_image(), and cairo_write_image().
#define FTYPE_PPM 1 |
Definition at line 53 of file cairodriver.h.
Referenced by cairo_read_image(), and cairo_write_image().
#define FTYPE_PS 5 |
Definition at line 57 of file cairodriver.h.
#define FTYPE_SVG 6 |
Definition at line 58 of file cairodriver.h.
#define FTYPE_UNKNOWN 0 |
Definition at line 52 of file cairodriver.h.
#define FTYPE_X11 7 |
Definition at line 59 of file cairodriver.h.
Referenced by Cairo_Graph_close(), cairo_read_image(), and cairo_write_image().
#define HEADER_SIZE 64 |
Definition at line 45 of file cairodriver.h.
Referenced by cairo_read_bmp(), cairo_write_bmp(), read_bmp(), and write_bmp().
void Cairo_Begin | ( | void | ) |
Definition at line 17 of file cairodriver/draw.c.
References cairo.
void Cairo_begin_raster | ( | int | mask, |
int | s[2][2], | ||
double | d[2][2] | ||
) |
Start drawing raster.
mask | non-zero int for mask |
s | source (map) extent (left, right, top, bottom) |
d | destination (image) extent (left, right, top, bottom) |
Definition at line 71 of file cairodriver/raster.c.
void Cairo_Bitmap | ( | int | ncols, |
int | nrows, | ||
int | threshold, | ||
const unsigned char * | buf | ||
) |
Draw bitmap.
ncols,nrows | number of columns and rows |
threshold | threshold value |
buf | data buffer |
Definition at line 26 of file cairodriver/draw_bitmap.c.
void Cairo_Box | ( | double | x1, |
double | y1, | ||
double | x2, | ||
double | y2 | ||
) |
Draw a (filled) rectangle.
x1,y1,x2,y2 | rectangle coordinates |
Definition at line 22 of file cairodriver/box.c.
void Cairo_Client_Close | ( | void | ) |
void Cairo_Close | ( | void | ) |
Definition at line 32 of file cairodriver/draw.c.
References cairo.
void Cairo_Color | ( | int | r, |
int | g, | ||
int | b | ||
) |
Set source color (opaque)
This color will then be used for any subsequent drawing operation until a new source pattern is set.
r | red color value |
g | green color value |
b | blue color value |
Definition at line 27 of file cairodriver/color.c.
References cairo, CAIROCOLOR, and G_debug().
void Cairo_Cont | ( | double | , |
double | |||
) |
Definition at line 27 of file cairodriver/draw.c.
References cairo.
const struct driver* Cairo_Driver | ( | void | ) |
Initialize display driver.
Definition at line 22 of file cairodriver/driver.c.
void Cairo_end_raster | ( | void | ) |
Finish drawing raster.
Definition at line 175 of file cairodriver/raster.c.
void Cairo_Erase | ( | void | ) |
Erase screen.
Definition at line 20 of file cairodriver/erase.c.
References cairo_state::bgcolor_a, cairo_state::bgcolor_b, cairo_state::bgcolor_g, cairo_state::bgcolor_r, ca, cairo, G_debug(), and cairo_state::modified.
void Cairo_Fill | ( | void | ) |
Definition at line 43 of file cairodriver/draw.c.
References ca, cairo, and cairo_state::modified.
void Cairo_font_info | ( | char *** | list, |
int * | count | ||
) |
Get fonts into.
[out] | list | font list |
[out] | count | number of items in the list |
Definition at line 341 of file cairodriver/text.c.
void Cairo_font_list | ( | char *** | list, |
int * | count | ||
) |
Get list of fonts.
[out] | list | font list |
[out] | count | number of items in the list |
Definition at line 327 of file cairodriver/text.c.
void Cairo_Graph_close | ( | void | ) |
Close driver.
Definition at line 301 of file cairodriver/graph.c.
References ca, cairo, cairo_write_image(), cairo_state::file_type, FTYPE_X11, G_debug(), cairo_state::mapped, NULL, and surface.
const char* Cairo_Graph_get_file | ( | void | ) |
Get render file.
Definition at line 293 of file cairodriver/graph.c.
References ca, and cairo_state::file_name.
int Cairo_Graph_set | ( | void | ) |
Initialize driver.
Set background color, transparency, drawable, antialias mode, etc.
Definition at line 236 of file cairodriver/graph.c.
References cairo_state::bgcolor_a, cairo_state::bgcolor_b, cairo_state::bgcolor_g, cairo_state::bgcolor_r, ca, CAIROCOLOR, G_debug(), G_fatal_error(), G_gisinit, G_str_to_color(), G_strcasecmp(), and getenv().
void Cairo_Line_width | ( | double | width | ) |
Set line width.
width | line width (double precision) |
Definition at line 27 of file cairodriver/line_width.c.
void Cairo_Move | ( | double | , |
double | |||
) |
Definition at line 22 of file cairodriver/draw.c.
References cairo.
void Cairo_Point | ( | double | , |
double | |||
) |
Definition at line 49 of file cairodriver/draw.c.
References ca, cairo, and cairo_state::modified.
int Cairo_raster | ( | int | n, |
int | row, | ||
const unsigned char * | red, | ||
const unsigned char * | grn, | ||
const unsigned char * | blu, | ||
const unsigned char * | nul | ||
) |
Draw raster row.
n | number of cells |
row | raster row (starting at 0) |
red,grn,blu,nul | red,green,blue and null value |
Definition at line 127 of file cairodriver/raster.c.
void cairo_read_bmp | ( | void | ) |
Definition at line 81 of file cairodriver/read_bmp.c.
References HEADER_SIZE.
Referenced by cairo_read_image().
void cairo_read_image | ( | void | ) |
Definition at line 17 of file cairodriver/read.c.
References ca, cairo, cairo_read_bmp(), cairo_read_ppm(), cairo_read_xid(), cairo_state::file_name, cairo_state::file_type, FTYPE_BMP, FTYPE_PNG, FTYPE_PPM, FTYPE_X11, G_debug(), cairo_state::modified, and surface.
void cairo_read_ppm | ( | void | ) |
Definition at line 19 of file cairodriver/read_ppm.c.
References ca, cairo_state::file_name, and G_store().
Referenced by cairo_read_image().
void cairo_read_xid | ( | void | ) |
Definition at line 5 of file read_xid.c.
References _, ca, cairo_state::file_name, and G_fatal_error().
Referenced by cairo_read_image().
void Cairo_set_font | ( | const char * | name | ) |
void Cairo_Set_window | ( | double | t, |
double | b, | ||
double | l, | ||
double | r | ||
) |
Set window.
t,b,l,r | top, bottom, left, right |
Definition at line 22 of file cairodriver/set_window.c.
void Cairo_Stroke | ( | void | ) |
Definition at line 37 of file cairodriver/draw.c.
References ca, cairo, and cairo_state::modified.
void Cairo_Text | ( | const char * | str | ) |
void Cairo_text_box | ( | const char * | , |
double * | , | ||
double * | , | ||
double * | , | ||
double * | |||
) |
Definition at line 130 of file cairodriver/text.c.
void cairo_write_bmp | ( | void | ) |
Definition at line 65 of file cairodriver/write_bmp.c.
References _, ca, cairo_state::file_name, G_fatal_error(), HEADER_SIZE, and output().
Referenced by cairo_write_image().
void cairo_write_image | ( | void | ) |
Definition at line 17 of file cairodriver/write.c.
References ca, cairo, cairo_write_bmp(), cairo_write_ppm(), cairo_write_xid(), cairo_state::file_name, cairo_state::file_type, FTYPE_BMP, FTYPE_PNG, FTYPE_PPM, FTYPE_X11, G_debug(), cairo_state::mapped, cairo_state::modified, and surface.
Referenced by Cairo_Graph_close().
void cairo_write_ppm | ( | void | ) |
Definition at line 19 of file cairodriver/write_ppm.c.
References _, ca, cairo_state::file_name, G_fatal_error(), G_free(), G_store(), cairo_state::grid, cairo_state::height, output(), cairo_state::stride, cairo_state::width, and x.
Referenced by cairo_write_image().
void cairo_write_xid | ( | void | ) |
Definition at line 6 of file write_xid.c.
References _, ca, cairo_state::file_name, and G_fatal_error().
Referenced by cairo_write_image().
struct cairo_state ca |
Definition at line 42 of file cairodriver/graph.c.
Referenced by Cairo_Erase(), Cairo_Fill(), Cairo_Graph_close(), Cairo_Graph_get_file(), Cairo_Graph_set(), Cairo_Point(), cairo_read_image(), cairo_read_ppm(), cairo_read_xid(), Cairo_Stroke(), cairo_write_bmp(), cairo_write_image(), cairo_write_ppm(), and cairo_write_xid().
cairo_t* cairo |
Definition at line 46 of file cairodriver/graph.c.
Referenced by Cairo_Begin(), Cairo_Close(), Cairo_Color(), Cairo_Cont(), Cairo_end_raster(), Cairo_Erase(), Cairo_Fill(), Cairo_Graph_close(), Cairo_Move(), Cairo_Point(), cairo_read_image(), Cairo_Set_window(), Cairo_Stroke(), and cairo_write_image().
cairo_surface_t* surface |
Definition at line 45 of file cairodriver/graph.c.
Referenced by Cairo_Graph_close(), cairo_read_image(), and cairo_write_image().