gerbv
draw.c File Reference

Go to the source code of this file.

Functions

void draw_cairo_line_to (cairo_t *cairoTarget, gdouble x, gdouble y, gboolean adjustByHalf, gboolean pixelOutput)
 
void draw_cairo_move_to (cairo_t *cairoTarget, gdouble x, gdouble y, gboolean oddWidth, gboolean pixelOutput)
 
void draw_cairo_translate_adjust (cairo_t *cairoTarget, gdouble x, gdouble y, gboolean pixelOutput)
 
static gboolean draw_net_is_in_selection_buffer_remove (gerbv_net_t *net, gerbv_selection_info_t *selectionInfo, gboolean remove)
 
static void gerbv_draw_circle (cairo_t *cairoTarget, gdouble diameter)
 
static void gerbv_draw_rectangle (cairo_t *cairoTarget, gdouble width, gdouble height, gboolean pixelOutput)
 
static void gerbv_draw_oblong (cairo_t *cairoTarget, gdouble width, gdouble height)
 
static void draw_cairo_cross (cairo_t *cairoTarget, gdouble xc, gdouble yc, gdouble r)
 
static void draw_render_block_nets (cairo_t *cairoTarget, gerbv_image_t *image, gerbv_net_t *block_netlist, gerbv_net_t *flash_net, enum draw_mode drawMode, gerbv_selection_info_t *selectionInfo, gboolean pixelOutput, gdouble pixelWidth, gdouble lineWidth, cairo_operator_t drawOperatorClear, cairo_operator_t drawOperatorDark)
 

Detailed Description

Cairo rendering functions and the related selection calculating functions.

Definition in file draw.c.

Function Documentation

◆ draw_cairo_cross()

static void draw_cairo_cross ( cairo_t *  cairoTarget,
gdouble  xc,
gdouble  yc,
gdouble  r 
)
static

Draw Cairo cross.

Parameters
xcCross center x coordinate.
ycCross center y coordinate.
rCross half size.

Definition at line 881 of file draw.c.

◆ draw_cairo_line_to()

void draw_cairo_line_to ( cairo_t *  cairoTarget,
gdouble  x,
gdouble  y,
gboolean  adjustByHalf,
gboolean  pixelOutput 
)

Draw Cairo line from current coordinates.

Parameters
xEnd of line x coordinate.
yEnd of line y coordinate.
adjustByHalfIncrease x and y by 0.5.
pixelOutputRound x and y coordinates to pixels.

Definition at line 55 of file draw.c.

◆ draw_cairo_move_to()

void draw_cairo_move_to ( cairo_t *  cairoTarget,
gdouble  x,
gdouble  y,
gboolean  oddWidth,
gboolean  pixelOutput 
)

Move Cairo coordinates.

Parameters
xMove to x coordinate.
yMove to y coordinate.
oddWidthIncrease x and y by 0.5.
pixelOutputRound x and y coordinates to pixels.

Definition at line 78 of file draw.c.

◆ draw_cairo_translate_adjust()

void draw_cairo_translate_adjust ( cairo_t *  cairoTarget,
gdouble  x,
gdouble  y,
gboolean  pixelOutput 
)

Cairo translate user-space origin.

Parameters
xThe x coordinate.
yThe y coordinate.
pixelOutputRound x and y coordinates to pixels.

Definition at line 100 of file draw.c.

◆ draw_net_is_in_selection_buffer_remove()

static gboolean draw_net_is_in_selection_buffer_remove ( gerbv_net_t net,
gerbv_selection_info_t selectionInfo,
gboolean  remove 
)
static

Check if net is in selection buffer and possibly deselect it.

Returns
TRUE if net is selected, FALSE if not selected.
Parameters
netChecked net.
selectionInfoSelection buffer.
removeTRUE for deselect net.

Definition at line 120 of file draw.c.

◆ draw_render_block_nets()

static void draw_render_block_nets ( cairo_t *  cairoTarget,
gerbv_image_t image,
gerbv_net_t block_netlist,
gerbv_net_t flash_net,
enum draw_mode  drawMode,
gerbv_selection_info_t selectionInfo,
gboolean  pixelOutput,
gdouble  pixelWidth,
gdouble  lineWidth,
cairo_operator_t  drawOperatorClear,
cairo_operator_t  drawOperatorDark 
)
static

Render all nets within a block aperture's net list.

Handles linear draws, arc strokes, rectangle draw strokes, polygon regions (PAREA), and flash sub-types (circle, rect, oval, polygon, macro, and nested blocks via recursion).

Parameters
cairoTargetCairo context to render into.
imageThe Gerber image (for aperture table lookup).
block_netlistHead of the block's net list (iteration starts at ->next).
flash_netThe outer flash net (used by draw_stroke/draw_fill for selection tracking).
drawModeCurrent draw mode (normal / selections / etc.).
selectionInfoSelection state for highlight rendering.
pixelOutputTRUE when rendering to a pixel surface.
pixelWidthWidth of one pixel in user coordinates.
lineWidthDefault line width from enclosing scope.
drawOperatorClearCairo operator for clear polarity primitives.
drawOperatorDarkCairo operator for dark polarity primitives.

Definition at line 950 of file draw.c.

References GERBV_INTERPOLATION_PAREA_START, gerbv_net::interpolation, and gerbv_net::next.

◆ gerbv_draw_circle()

static void gerbv_draw_circle ( cairo_t *  cairoTarget,
gdouble  diameter 
)
static

Draw the circle centered at current Cairo coordinates.

Parameters
diameterCircle diameter.

Definition at line 231 of file draw.c.

Referenced by gerbv_draw_oblong().

◆ gerbv_draw_oblong()

static void gerbv_draw_oblong ( cairo_t *  cairoTarget,
gdouble  width,
gdouble  height 
)
static

Draw the oblong centered at current Cairo coordinates.

Parameters
widthWidth of the oblong.
heightHeight of the oblong.

Definition at line 264 of file draw.c.

References gerbv_draw_circle().

◆ gerbv_draw_rectangle()

static void gerbv_draw_rectangle ( cairo_t *  cairoTarget,
gdouble  width,
gdouble  height,
gboolean  pixelOutput 
)
static

Draw the rectangle centered at current Cairo coordinates.

Parameters
widthWidth of the rectangle.
heightHeight of the rectangle.
pixelOutputRound width and height to pixels.

Definition at line 244 of file draw.c.