GDS-Render v1.2.1
Collaboration diagram for Cairo Renderer:

Data Structures

struct  _CairoRenderer
 
struct  cairo_layer
 The cairo_layer struct Each rendered layer is represented by this struct. More...
 

Macros

#define GDS_RENDER_TYPE_CAIRO_RENDERER   (cairo_renderer_get_type())
 
#define MAX_LAYERS   (5000)
 Maximum layer count the output renderer can process. Typically GDS only specifies up to 255 layers. More...
 

Functions

CairoRenderer * cairo_renderer_new_svg ()
 Create new CairoRenderer for SVG output. More...
 
CairoRenderer * cairo_renderer_new_pdf ()
 Create new CairoRenderer for PDF output. More...
 
static void revert_inherited_transform (struct cairo_layer *layers)
 Revert the last transformation on all layers. More...
 
static void apply_inherited_transform_to_all_layers (struct cairo_layer *layers, const struct gds_point *origin, double magnification, gboolean flipping, double rotation, double scale)
 Applies transformation to all layers. More...
 
static void render_cell (struct gds_cell *cell, struct cairo_layer *layers, double scale)
 render_cell Render a cell with its sub-cells More...
 
static int read_line_from_fd (int fd, char *buff, size_t buff_size)
 Read a line from a file descriptor. More...
 
static int cairo_renderer_render_cell_to_vector_file (GdsOutputRenderer *renderer, struct gds_cell *cell, GList *layer_infos, const char *pdf_file, const char *svg_file, double scale)
 Render cell to a PDF file specified by pdf_file. More...
 
static void cairo_renderer_init (CairoRenderer *self)
 
static int cairo_renderer_render_output (GdsOutputRenderer *renderer, struct gds_cell *cell, double scale)
 
static void cairo_renderer_class_init (CairoRendererClass *klass)
 

Detailed Description

Macro Definition Documentation

◆ GDS_RENDER_TYPE_CAIRO_RENDERER

#define GDS_RENDER_TYPE_CAIRO_RENDERER   (cairo_renderer_get_type())

Definition at line 39 of file cairo-renderer.h.

◆ MAX_LAYERS

#define MAX_LAYERS   (5000)

Maximum layer count the output renderer can process. Typically GDS only specifies up to 255 layers.

Definition at line 41 of file cairo-renderer.h.

Function Documentation

◆ apply_inherited_transform_to_all_layers()

static void apply_inherited_transform_to_all_layers ( struct cairo_layer layers,
const struct gds_point origin,
double  magnification,
gboolean  flipping,
double  rotation,
double  scale 
)
static

Applies transformation to all layers.

Parameters
layersArray of layers
originOrigin translation
magnificationScaling
flippingMirror image on x-axis before rotating
rotationRotation in degrees
scaleScale the image down by. Only used for sclaing origin coordinates. Not applied to layer.

Definition at line 81 of file cairo-renderer.c.

Here is the caller graph for this function:

◆ cairo_renderer_class_init()

static void cairo_renderer_class_init ( CairoRendererClass *  klass)
static

Definition at line 484 of file cairo-renderer.c.

Here is the call graph for this function:

◆ cairo_renderer_init()

static void cairo_renderer_init ( CairoRenderer *  self)
static

Definition at line 442 of file cairo-renderer.c.

◆ cairo_renderer_new_pdf()

CairoRenderer * cairo_renderer_new_pdf ( )

Create new CairoRenderer for PDF output.

Returns
New object

Definition at line 491 of file cairo-renderer.c.

Here is the caller graph for this function:

◆ cairo_renderer_new_svg()

CairoRenderer * cairo_renderer_new_svg ( )

Create new CairoRenderer for SVG output.

Returns
New object

Definition at line 501 of file cairo-renderer.c.

Here is the caller graph for this function:

◆ cairo_renderer_render_cell_to_vector_file()

static int cairo_renderer_render_cell_to_vector_file ( GdsOutputRenderer *  renderer,
struct gds_cell cell,
GList *  layer_infos,
const char *  pdf_file,
const char *  svg_file,
double  scale 
)
static

Render cell to a PDF file specified by pdf_file.

Parameters
rendererThe current renderer this function is running from
cellToplevel cell to Cairo Renderer
layer_infosList of layer information. Specifies color and layer stacking
pdf_filePDF output file. Set to NULL if no PDF file has to be generated
svg_fileSVG output file. Set to NULL if no SVG file has to be generated
scaleScale the output image down by scale
Returns
Error

Definition at line 233 of file cairo-renderer.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cairo_renderer_render_output()

static int cairo_renderer_render_output ( GdsOutputRenderer *  renderer,
struct gds_cell cell,
double  scale 
)
static

Definition at line 448 of file cairo-renderer.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_line_from_fd()

static int read_line_from_fd ( int  fd,
char *  buff,
size_t  buff_size 
)
static

Read a line from a file descriptor.

In case of a broken pipe / closed writing end, it will terminate

Parameters
fdFile descriptor to read from
buffBuffer to write data in
buff_sizeBuffer size
Returns
length of read data

Definition at line 203 of file cairo-renderer.c.

Here is the caller graph for this function:

◆ render_cell()

static void render_cell ( struct gds_cell cell,
struct cairo_layer layers,
double  scale 
)
static

render_cell Render a cell with its sub-cells

Parameters
cellCell to render
layersCell will be rendered into these layers
scalesclae image down by this factor

Definition at line 111 of file cairo-renderer.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ revert_inherited_transform()

static void revert_inherited_transform ( struct cairo_layer layers)
static

Revert the last transformation on all layers.

Parameters
layersPointer to cairo_layer structures

Definition at line 61 of file cairo-renderer.c.

Here is the caller graph for this function: