gerbv  2.10.1-dev~93f1b5
gerbv.h File Reference

Go to the source code of this file.

Data Structures

struct  error_list
 
struct  gerbv_stats_t
 
struct  drill_list
 
struct  gerbv_drill_stats_t
 
struct  gerbv_selection_info_t
 
struct  gerbv_user_transformation_t
 
struct  gerbv_render_size_t
 
struct  gerbv_layer_t
 
struct  gerbv_netstate_t
 
struct  gerbv_net
 
struct  gerbv_format
 
struct  gerbv_image_info
 
struct  gerbv_image_t
 
struct  gerbv_fileinfo_t
 
struct  gerbv_project_t
 
struct  gerbv_layer_color
 
struct  gerbv_render_info_t
 

Typedefs

typedef struct error_list gerbv_error_list_t
 
typedef struct drill_list gerbv_drill_list_t
 
typedef struct gerbv_net gerbv_net_t
 
typedef struct gerbv_format gerbv_format_t
 
typedef struct gerbv_image_info gerbv_image_info_t
 

Enumerations

enum  gerbv_opcodes_t {
  GERBV_OPCODE_NOP , GERBV_OPCODE_PUSH , GERBV_OPCODE_PPUSH , GERBV_OPCODE_PPOP ,
  GERBV_OPCODE_ADD , GERBV_OPCODE_SUB , GERBV_OPCODE_MUL , GERBV_OPCODE_DIV ,
  GERBV_OPCODE_PRIM
}
 
enum  gerbv_message_type_t { GERBV_MESSAGE_FATAL , GERBV_MESSAGE_ERROR , GERBV_MESSAGE_WARNING , GERBV_MESSAGE_NOTE }
 
enum  gerbv_aperture_type_t {
  GERBV_APTYPE_NONE , GERBV_APTYPE_CIRCLE , GERBV_APTYPE_RECTANGLE , GERBV_APTYPE_OVAL ,
  GERBV_APTYPE_POLYGON , GERBV_APTYPE_MACRO , GERBV_APTYPE_MACRO_CIRCLE , GERBV_APTYPE_MACRO_OUTLINE ,
  GERBV_APTYPE_MACRO_POLYGON , GERBV_APTYPE_MACRO_MOIRE , GERBV_APTYPE_MACRO_THERMAL , GERBV_APTYPE_MACRO_LINE20 ,
  GERBV_APTYPE_MACRO_LINE21 , GERBV_APTYPE_MACRO_LINE22
}
 
enum  gerbv_aperture_state_t { GERBV_APERTURE_STATE_OFF , GERBV_APERTURE_STATE_ON , GERBV_APERTURE_STATE_FLASH }
 
enum  gerbv_aptype_macro_circle_index_t
 
enum  gerbv_aptype_macro_line20_index_t
 
enum  gerbv_aptype_macro_line21_index_t
 
enum  gerbv_aptype_macro_line22_index_t
 
enum  gerbv_unit_t { GERBV_UNIT_INCH , GERBV_UNIT_MM , GERBV_UNIT_UNSPECIFIED }
 
enum  gerbv_polarity_t { GERBV_POLARITY_POSITIVE , GERBV_POLARITY_NEGATIVE , GERBV_POLARITY_DARK , GERBV_POLARITY_CLEAR }
 
enum  gerbv_omit_zeros_t { GERBV_OMIT_ZEROS_LEADING , GERBV_OMIT_ZEROS_TRAILING , GERBV_OMIT_ZEROS_EXPLICIT , GERBV_OMIT_ZEROS_UNSPECIFIED }
 
enum  gerbv_coordinate_t { GERBV_COORDINATE_ABSOLUTE , GERBV_COORDINATE_INCREMENTAL }
 
enum  gerbv_interpolation_t {
  GERBV_INTERPOLATION_LINEARx1 , GERBV_INTERPOLATION_LINEARx10 , GERBV_INTERPOLATION_LINEARx01 , GERBV_INTERPOLATION_LINEARx001 ,
  GERBV_INTERPOLATION_CW_CIRCULAR , GERBV_INTERPOLATION_CCW_CIRCULAR , GERBV_INTERPOLATION_PAREA_START , GERBV_INTERPOLATION_PAREA_END ,
  GERBV_INTERPOLATION_DELETED
}
 
enum  gerbv_layertype_t { GERBV_LAYERTYPE_RS274X , GERBV_LAYERTYPE_DRILL , GERBV_LAYERTYPE_PICKANDPLACE_TOP , GERBV_LAYERTYPE_PICKANDPLACE_BOT }
 
enum  gerbv_selection_t { GERBV_SELECTION_POINT_CLICK = 1 , GERBV_SELECTION_DRAG_BOX }
 
enum  gerbv_render_types_t {
  GERBV_RENDER_TYPE_GDK , GERBV_RENDER_TYPE_GDK_XOR , GERBV_RENDER_TYPE_CAIRO_NORMAL , GERBV_RENDER_TYPE_CAIRO_HIGH_QUALITY ,
  GERBV_RENDER_TYPE_MAX
}
 

Functions

const char * gerbv_aperture_type_name (gerbv_aperture_type_t type)
 
const char * gerbv_interpolation_name (gerbv_interpolation_t interp)
 
gerbv_image_tgerbv_create_image (gerbv_image_t *image, const gchar *type)
 
void gerbv_destroy_image (gerbv_image_t *image)
 
void gerbv_image_copy_image (gerbv_image_t *sourceImage, gerbv_user_transformation_t *transform, gerbv_image_t *destinationImage)
 
gerbv_image_tgerbv_image_duplicate_image (gerbv_image_t *sourceImage, gerbv_user_transformation_t *transform)
 
void gerbv_image_delete_net (gerbv_net_t *currentNet)
 
gerbv_net_tgerbv_image_return_next_renderable_object (gerbv_net_t *oldNet)
 
gerbv_project_tgerbv_create_project (void)
 
void gerbv_destroy_project (gerbv_project_t *gerbvProject)
 
void gerbv_open_layer_from_filename (gerbv_project_t *gerbvProject, const gchar *filename)
 
void gerbv_open_layer_from_filename_with_color (gerbv_project_t *gerbvProject, const gchar *filename, guint16 red, guint16 green, guint16 blue, guint16 alpha)
 
void gerbv_destroy_fileinfo (gerbv_fileinfo_t *fileInfo)
 
void gerbv_render_zoom_to_fit_display (gerbv_project_t *gerbvProject, gerbv_render_info_t *renderInfo)
 
void gerbv_render_layer_to_cairo_target (cairo_t *cr, gerbv_fileinfo_t *fileInfo, gerbv_render_info_t *renderInfo)
 
void gerbv_export_png_file_from_project_autoscaled (gerbv_project_t *gerbvProject, int widthInPixels, int heightInPixels, const gchar *filename)
 
void gerbv_export_png_file_from_project (gerbv_project_t *gerbvProject, gerbv_render_info_t *renderInfo, const gchar *filename)
 
void gerbv_export_pdf_file_from_project_autoscaled (gerbv_project_t *gerbvProject, const gchar *filename)
 
void gerbv_export_pdf_file_from_project (gerbv_project_t *gerbvProject, gerbv_render_info_t *renderInfo, const gchar *filename)
 
void gerbv_export_postscript_file_from_project_autoscaled (gerbv_project_t *gerbvProject, const gchar *filename)
 
void gerbv_export_postscript_file_from_project (gerbv_project_t *gerbvProject, gerbv_render_info_t *renderInfo, const gchar *filename)
 
void gerbv_export_svg_file_from_project_autoscaled (gerbv_project_t *gerbvProject, const gchar *filename)
 
void gerbv_export_svg_file_from_project (gerbv_project_t *gerbvProject, gerbv_render_info_t *renderInfo, const gchar *filename)
 
gboolean gerbv_export_dxf_file_from_image (const gchar *filename, gerbv_image_t *image, gerbv_user_transformation_t *transform)
 
gerbv_image_tgerbv_create_rs274x_image_from_filename (const gchar *filename)
 
gboolean gerbv_export_rs274x_file_from_image (const gchar *filename, gerbv_image_t *image, gerbv_user_transformation_t *transform)
 
gboolean gerbv_export_drill_file_from_image (const gchar *filename, gerbv_image_t *image, gerbv_user_transformation_t *transform)
 
gboolean gerbv_export_isel_drill_file_from_image (const gchar *filename, gerbv_image_t *image, gerbv_user_transformation_t *transform)
 
gboolean gerbv_export_geda_pcb_file_from_image (const gchar *filename, gerbv_image_t *image, gerbv_user_transformation_t *transform)
 
void gerbv_image_create_line_object (gerbv_image_t *image, gdouble startX, gdouble startY, gdouble endX, gdouble endY, gdouble lineWidth, gerbv_aperture_type_t apertureType)
 
void gerbv_image_create_arc_object (gerbv_image_t *image, gdouble centerX, gdouble centerY, gdouble radius, gdouble startAngle, gdouble endAngle, gdouble lineWidth, gerbv_aperture_type_t apertureType)
 
void gerbv_image_create_rectangle_object (gerbv_image_t *image, gdouble coordinateX, gdouble coordinateY, gdouble width, gdouble height)
 
void gerbv_image_create_dummy_apertures (gerbv_image_t *parsed_image)
 
gerbv_drill_stats_tgerbv_drill_stats_new (void)
 
void gerbv_drill_stats_destroy (gerbv_drill_stats_t *)
 
void gerbv_drill_stats_add_layer (gerbv_drill_stats_t *accum_stats, gerbv_drill_stats_t *input_stats, int this_layer)
 
gerbv_stats_tgerbv_stats_new (void)
 
void gerbv_stats_destroy (gerbv_stats_t *)
 
void gerbv_stats_add_layer (gerbv_stats_t *accum_stats, gerbv_stats_t *input_stats, int this_layer)
 
gerbv_fileinfo_tgerbv_get_fileinfo_for_image (const gerbv_image_t *image, const gerbv_project_t *project)
 
int gerbv_transform_coord_for_image (double *x, double *y, const gerbv_image_t *image, const gerbv_project_t *project)
 
gboolean gerbv_endswith (const char *path, const char *ext)
 
void gerbv_transform_coord (double *x, double *y, const gerbv_user_transformation_t *trans)
 
void gerbv_rotate_coord (double *x, double *y, double rad)
 

Detailed Description

The main header file for the libgerbv library.

Definition in file gerbv.h.

Typedef Documentation

◆ gerbv_drill_list_t

Linked list of drills found in active layers. Used in reporting statistics

◆ gerbv_error_list_t

A linked list of errors found in the files

◆ gerbv_format_t

typedef struct gerbv_format gerbv_format_t

Struct holding info about interpreting the Gerber files read e.g. leading zeros, etc.

◆ gerbv_image_info_t

Struct holding info about a particular image

◆ gerbv_net_t

typedef struct gerbv_net gerbv_net_t

The structure used to hold a geometric entity (line/polygon/etc)

Enumeration Type Documentation

◆ gerbv_aperture_state_t

The current state of the aperture drawing tool

Enumerator
GERBV_APERTURE_STATE_OFF 

tool drawing is off, and nothing will be drawn

GERBV_APERTURE_STATE_ON 

tool drawing is on, and something will be drawn

GERBV_APERTURE_STATE_FLASH 

tool is flashing, and will draw a single aperture

Definition at line 170 of file gerbv.h.

◆ gerbv_aperture_type_t

The different aperture types available. Please keep these in sync with the aperture names defined in gerbv_aperture_type_name() in gerbv.c

Enumerator
GERBV_APTYPE_NONE 

no aperture used

GERBV_APTYPE_CIRCLE 

a round aperture

GERBV_APTYPE_RECTANGLE 

a rectangular aperture

GERBV_APTYPE_OVAL 

an ovular (obround) aperture

GERBV_APTYPE_POLYGON 

a polygon aperture

GERBV_APTYPE_MACRO 

a RS274X macro

GERBV_APTYPE_MACRO_CIRCLE 

a RS274X circle macro

GERBV_APTYPE_MACRO_OUTLINE 

a RS274X outline macro

GERBV_APTYPE_MACRO_POLYGON 

a RS274X polygon macro

GERBV_APTYPE_MACRO_MOIRE 

a RS274X moire macro

GERBV_APTYPE_MACRO_THERMAL 

a RS274X thermal macro

GERBV_APTYPE_MACRO_LINE20 

a RS274X vector line (code 20) macro

GERBV_APTYPE_MACRO_LINE21 

a RS274X centered line (code 21) macro

GERBV_APTYPE_MACRO_LINE22 

a RS274X lower left line (code 22) macro

Definition at line 150 of file gerbv.h.

◆ gerbv_aptype_macro_circle_index_t

The circle aperture macro parameter indexes

Definition at line 177 of file gerbv.h.

◆ gerbv_aptype_macro_line20_index_t

The vector line aperture macro parameter indexes

Definition at line 230 of file gerbv.h.

◆ gerbv_aptype_macro_line21_index_t

The centered line aperture macro parameter indexes

Definition at line 242 of file gerbv.h.

◆ gerbv_aptype_macro_line22_index_t

The lower left line aperture macro parameter indexes

Definition at line 252 of file gerbv.h.

◆ gerbv_coordinate_t

The coordinate system used

Enumerator
GERBV_COORDINATE_ABSOLUTE 

all coordinates are absolute from a common origin

GERBV_COORDINATE_INCREMENTAL 

all coordinates are relative to the previous coordinate

Definition at line 285 of file gerbv.h.

◆ gerbv_interpolation_t

The interpolation methods available. Please keep these in sync with the interpolation names defined in gerbv_interpolation_name() in gerbv.c

Enumerator
GERBV_INTERPOLATION_LINEARx1 

draw a line

GERBV_INTERPOLATION_LINEARx10 

draw a line

GERBV_INTERPOLATION_LINEARx01 

draw a line

GERBV_INTERPOLATION_LINEARx001 

draw a line

GERBV_INTERPOLATION_CW_CIRCULAR 

draw an arc in the clockwise direction

GERBV_INTERPOLATION_CCW_CIRCULAR 

draw an arc in the counter-clockwise direction

GERBV_INTERPOLATION_PAREA_START 

start a polygon draw

GERBV_INTERPOLATION_PAREA_END 

end a polygon draw

GERBV_INTERPOLATION_DELETED 

the net has been deleted by the user, and will not be drawn

Definition at line 293 of file gerbv.h.

◆ gerbv_layertype_t

The different layer types used

Enumerator
GERBV_LAYERTYPE_RS274X 

the file is a RS274X file

GERBV_LAYERTYPE_DRILL 

the file is an Excellon drill file

GERBV_LAYERTYPE_PICKANDPLACE_TOP 

the file is a CSV pick and place file, top side

GERBV_LAYERTYPE_PICKANDPLACE_BOT 

the file is a CSV pick and place file, bottom side

Definition at line 322 of file gerbv.h.

◆ gerbv_message_type_t

The different message types used in libgerbv

Enumerator
GERBV_MESSAGE_FATAL 

processing cannot continue

GERBV_MESSAGE_ERROR 

something went wrong, but processing can still continue

GERBV_MESSAGE_WARNING 

something was encountered that may provide the wrong output

GERBV_MESSAGE_NOTE 

an irregularity was encountered, but needs no intervention

Definition at line 140 of file gerbv.h.

◆ gerbv_omit_zeros_t

The decimal point parsing style used

Enumerator
GERBV_OMIT_ZEROS_LEADING 

omit extra zeros before the decimal point

GERBV_OMIT_ZEROS_TRAILING 

omit extra zeros after the decimal point

GERBV_OMIT_ZEROS_EXPLICIT 

explicitly specify how many decimal places are used

GERBV_OMIT_ZEROS_UNSPECIFIED 

use the default parsing style

Definition at line 277 of file gerbv.h.

◆ gerbv_opcodes_t

The aperture macro commands

Enumerator
GERBV_OPCODE_NOP 

no operation

GERBV_OPCODE_PUSH 

push the instruction onto the stack

GERBV_OPCODE_PPUSH 

push parameter onto stack

GERBV_OPCODE_PPOP 

pop parameter from stack

GERBV_OPCODE_ADD 

mathmatical add operation

GERBV_OPCODE_SUB 

mathmatical subtract operation

GERBV_OPCODE_MUL 

mathmatical multiply operation

GERBV_OPCODE_DIV 

mathmatical divide operation

GERBV_OPCODE_PRIM 

draw macro primative

Definition at line 127 of file gerbv.h.

◆ gerbv_polarity_t

The different drawing polarities available

Enumerator
GERBV_POLARITY_POSITIVE 

draw "positive", using the current layer's polarity

GERBV_POLARITY_NEGATIVE 

draw "negative", reversing the current layer's polarity

GERBV_POLARITY_DARK 

add to the current rendering

GERBV_POLARITY_CLEAR 

subtract from the current rendering

Definition at line 269 of file gerbv.h.

◆ gerbv_render_types_t

The different rendering modes available to libgerbv

Enumerator
GERBV_RENDER_TYPE_GDK 

render using normal GDK drawing functions

GERBV_RENDER_TYPE_GDK_XOR 

use the GDK_XOR mask to draw a pseudo-transparent scene

GERBV_RENDER_TYPE_CAIRO_NORMAL 

use the cairo library

GERBV_RENDER_TYPE_CAIRO_HIGH_QUALITY 

use the cairo library with the smoothest edges

GERBV_RENDER_TYPE_MAX 

End-of-enum indicator

Definition at line 367 of file gerbv.h.

◆ gerbv_selection_t

The different selection modes available

Enumerator
GERBV_SELECTION_POINT_CLICK 

the user clicked on a single point

GERBV_SELECTION_DRAG_BOX 

the user dragged a box to encompass one or more objects

Definition at line 354 of file gerbv.h.

◆ gerbv_unit_t

The current unit used

Enumerator
GERBV_UNIT_INCH 

inches

GERBV_UNIT_MM 

mm

GERBV_UNIT_UNSPECIFIED 

use default units

Definition at line 262 of file gerbv.h.

Function Documentation

◆ gerbv_create_image()

gerbv_image_t* gerbv_create_image ( gerbv_image_t image,
const gchar *  type 
)

Allocate a new gerbv_image structure.

Returns
the newly created image
Parameters
imagethe old image to free or NULL
typethe type of image to create

Definition at line 46 of file gerb_image.c.

References gerbv_image_t::drill_stats, gerbv_destroy_image(), GERBV_POLARITY_DARK, gerbv_image_t::gerbv_stats, gerbv_image_t::info, gerbv_net::layer, gerbv_image_t::layers, gerbv_image_t::netlist, gerbv_layer_t::polarity, gerbv_netstate_t::scaleA, gerbv_netstate_t::scaleB, gerbv_net::state, gerbv_image_t::states, and gerbv_layer_t::stepAndRepeat.

Referenced by gerbv_image_duplicate_image(), and parse_gerb().

◆ gerbv_create_rs274x_image_from_filename()

gerbv_image_t* gerbv_create_rs274x_image_from_filename ( const gchar *  filename)

Parse a RS274X file and return the parsed image.

Returns
the new gerbv_image_t, or NULL if not successful
Parameters
filenamethe filename of the file to be parsed

Definition at line 595 of file gerbv.c.

◆ gerbv_destroy_fileinfo()

void gerbv_destroy_fileinfo ( gerbv_fileinfo_t fileInfo)

Free a fileinfo structure.

Parameters
fileInfothe fileinfo to free

Definition at line 203 of file gerbv.c.

References gerbv_fileinfo_t::fullPathname, gerbv_destroy_image(), gerbv_fileinfo_t::image, gerbv_fileinfo_t::name, and gerbv_fileinfo_t::privateRenderData.

Referenced by gerbv_destroy_project().

◆ gerbv_destroy_image()

void gerbv_destroy_image ( gerbv_image_t image)

Free an image structure.

Parameters
imagethe image to free

Definition at line 104 of file gerb_image.c.

References gerbv_image_t::amacro, gerbv_image_t::aperture, and gerbv_netstate_t::next.

Referenced by gerbv_create_image(), and gerbv_destroy_fileinfo().

◆ gerbv_destroy_project()

void gerbv_destroy_project ( gerbv_project_t gerbvProject)

Free a project and all related variables.

Parameters
gerbvProjectthe project to destroy

Definition at line 181 of file gerbv.c.

References gerbv_project_t::execname, gerbv_project_t::execpath, gerbv_project_t::file, gerbv_destroy_fileinfo(), gerbv_project_t::last_loaded, gerbv_project_t::path, and gerbv_project_t::project.

◆ gerbv_drill_stats_add_layer()

void gerbv_drill_stats_add_layer ( gerbv_drill_stats_t accum_stats,
gerbv_drill_stats_t input_stats,
int  this_layer 
)

Add stats gathered from specified layer to accumulatedd drill stats compiled from all layers

Definition at line 111 of file drill_stats.c.

Referenced by generate_drill_analysis().

◆ gerbv_drill_stats_destroy()

void gerbv_drill_stats_destroy ( gerbv_drill_stats_t stats)

Free the memory for a drill stats struct

Definition at line 101 of file drill_stats.c.

◆ gerbv_drill_stats_new()

gerbv_drill_stats_t* gerbv_drill_stats_new ( void  )

Allocates a new drill_stats structure.

Create new struct for holding drill stats

Returns
drill_stats pointer on success, NULL on ERROR

Definition at line 48 of file drill_stats.c.

Referenced by generate_drill_analysis().

◆ gerbv_endswith()

gboolean gerbv_endswith ( const char *  path,
const char *  ext 
)

See if 'path' ends with the filename extension 'ext'

Definition at line 1070 of file gerbv.c.

◆ gerbv_export_drill_file_from_image()

gboolean gerbv_export_drill_file_from_image ( const gchar *  filename,
gerbv_image_t image,
gerbv_user_transformation_t transform 
)

Export an image to a new file in Excellon drill format.

Returns
TRUE if successful, or FALSE if not
Parameters
filenamethe filename for the new file
imagethe image to export
transformthe transformation to apply before exporting

Definition at line 43 of file export-drill.c.

References gerbv_net::aperture, gerbv_image_t::aperture, gerbv_net::aperture_state, GERBV_APERTURE_STATE_FLASH, GERBV_APTYPE_CIRCLE, gerbv_image_duplicate_image(), gerbv_image_t::netlist, and gerbv_net::next.

◆ gerbv_export_dxf_file_from_image()

gboolean gerbv_export_dxf_file_from_image ( const gchar *  filename,
gerbv_image_t image,
gerbv_user_transformation_t transform 
)

Export an image to a new file in DXF format.

Returns
TRUE if successful, or FALSE if not
Parameters
filenamethe filename for the new file
imagethe image to export
transformthe transformation to apply before exporting

Definition at line 77 of file export-dxf.cpp.

References gerbv_image_duplicate_image().

◆ gerbv_export_geda_pcb_file_from_image()

gboolean gerbv_export_geda_pcb_file_from_image ( const gchar *  filename,
gerbv_image_t image,
gerbv_user_transformation_t transform 
)

Export an image to a new file in gEDA PCB format.

Returns
TRUE if successful, or FALSE if not
Parameters
filenamethe filename for the new file
imagethe image to export
transformthe transformation to apply before exporting

Definition at line 101 of file export-geda-pcb.c.

References gerbv_net::aperture, gerbv_image_t::aperture, gerbv_net::aperture_state, GERBV_APERTURE_STATE_FLASH, GERBV_APTYPE_CIRCLE, gerbv_image_duplicate_image(), GERBV_INTERPOLATION_PAREA_END, GERBV_INTERPOLATION_PAREA_START, gerbv_image_t::info, gerbv_net::interpolation, gerbv_image_t::netlist, gerbv_net::next, gerbv_net::start_x, gerbv_net::start_y, gerbv_net::stop_x, and gerbv_net::stop_y.

◆ gerbv_export_isel_drill_file_from_image()

gboolean gerbv_export_isel_drill_file_from_image ( const gchar *  filename,
gerbv_image_t image,
gerbv_user_transformation_t transform 
)

Export an image to a new file in ISEL NCP drill format.

Returns
TRUE if successful, or FALSE if not
Parameters
filenamethe filename for the new file
imagethe image to export
transformthe transformation to apply before exporting

Definition at line 48 of file export-isel-drill.c.

References gerbv_net::aperture, gerbv_image_t::aperture, gerbv_net::aperture_state, GERBV_APERTURE_STATE_FLASH, GERBV_APTYPE_CIRCLE, gerbv_image_duplicate_image(), gerbv_image_t::netlist, and gerbv_net::next.

◆ gerbv_export_pdf_file_from_project()

void gerbv_export_pdf_file_from_project ( gerbv_project_t gerbvProject,
gerbv_render_info_t renderInfo,
const gchar *  filename 
)

Render a project to a PDF file using user-specified render info.

Parameters
gerbvProjectthe project to render
renderInfothe render settings for the rendered image
filenamethe filename for the exported PDF file

Definition at line 110 of file export-image.c.

References gerbv_render_info_t::displayHeight, and gerbv_render_info_t::displayWidth.

◆ gerbv_export_pdf_file_from_project_autoscaled()

void gerbv_export_pdf_file_from_project_autoscaled ( gerbv_project_t gerbvProject,
const gchar *  filename 
)

Render a project to a PDF file, autoscaling the layers to fit inside the specified image dimensions.

Parameters
gerbvProjectthe project to render
filenamethe filename for the exported PDF file

Definition at line 104 of file export-image.c.

◆ gerbv_export_png_file_from_project()

void gerbv_export_png_file_from_project ( gerbv_project_t gerbvProject,
gerbv_render_info_t renderInfo,
const gchar *  filename 
)

Render a project to a PNG file using user-specified render info.

Parameters
gerbvProjectthe project to render
renderInfothe render settings for the rendered image
filenamethe filename for the exported PNG file

Definition at line 89 of file export-image.c.

References gerbv_render_info_t::displayHeight, and gerbv_render_info_t::displayWidth.

Referenced by gerbv_export_png_file_from_project_autoscaled().

◆ gerbv_export_png_file_from_project_autoscaled()

void gerbv_export_png_file_from_project_autoscaled ( gerbv_project_t gerbvProject,
int  widthInPixels,
int  heightInPixels,
const gchar *  filename 
)

Render a project to a PNG file, autoscaling the layers to fit inside the specified image dimensions.

Parameters
gerbvProjectthe project to render
widthInPixelsthe width of the rendered picture (in pixels)
heightInPixelsthe height of the rendered picture (in pixels)
filenamethe filename for the exported PNG file

Definition at line 77 of file export-image.c.

References gerbv_export_png_file_from_project(), GERBV_RENDER_TYPE_CAIRO_HIGH_QUALITY, and gerbv_render_zoom_to_fit_display().

◆ gerbv_export_postscript_file_from_project()

void gerbv_export_postscript_file_from_project ( gerbv_project_t gerbvProject,
gerbv_render_info_t renderInfo,
const gchar *  filename 
)

Render a project to a Postscript file using user-specified render info.

Parameters
gerbvProjectthe project to render
renderInfothe render settings for the rendered image
filenamethe filename for the exported Postscript file

Definition at line 125 of file export-image.c.

References gerbv_render_info_t::displayHeight, and gerbv_render_info_t::displayWidth.

◆ gerbv_export_postscript_file_from_project_autoscaled()

void gerbv_export_postscript_file_from_project_autoscaled ( gerbv_project_t gerbvProject,
const gchar *  filename 
)

Render a project to a Postscript file, autoscaling the layers to fit inside the specified image dimensions.

Parameters
gerbvProjectthe project to render
filenamethe filename for the exported Postscript file

Definition at line 119 of file export-image.c.

◆ gerbv_export_rs274x_file_from_image()

gboolean gerbv_export_rs274x_file_from_image ( const gchar *  filename,
gerbv_image_t image,
gerbv_user_transformation_t transform 
)

Export an image to a new file in RS274X format.

Returns
TRUE if successful, or FALSE if not
Parameters
filenamethe filename for the new file
imagethe image to export
transformthe transformation to apply before exporting

Definition at line 190 of file export-rs274x.c.

References gerbv_image_duplicate_image(), GERBV_POLARITY_CLEAR, gerbv_image_t::info, and gerbv_user_transformation_t::rotation.

◆ gerbv_export_svg_file_from_project()

void gerbv_export_svg_file_from_project ( gerbv_project_t gerbvProject,
gerbv_render_info_t renderInfo,
const gchar *  filename 
)

Render a project to a file using user-specified render info.

Parameters
gerbvProjectthe project to render
renderInfothe render settings for the rendered image
filenamethe filename for the exported file

Definition at line 139 of file export-image.c.

References gerbv_render_info_t::displayHeight, and gerbv_render_info_t::displayWidth.

◆ gerbv_export_svg_file_from_project_autoscaled()

void gerbv_export_svg_file_from_project_autoscaled ( gerbv_project_t gerbvProject,
const gchar *  filename 
)

Render a project to a SVG file, autoscaling the layers to fit inside the specified image dimensions.

Parameters
gerbvProjectthe project to render
filenamethe filename for the exported file

Definition at line 133 of file export-image.c.

◆ gerbv_get_fileinfo_for_image()

gerbv_fileinfo_t* gerbv_get_fileinfo_for_image ( const gerbv_image_t image,
const gerbv_project_t project 
)

Return found fileinfo for image, or NULL

Definition at line 1018 of file gerbv.c.

References gerbv_project_t::file, gerbv_fileinfo_t::image, and gerbv_project_t::last_loaded.

Referenced by gerbv_transform_coord_for_image().

◆ gerbv_image_copy_image()

void gerbv_image_copy_image ( gerbv_image_t sourceImage,
gerbv_user_transformation_t transform,
gerbv_image_t destinationImage 
)

Copy an image into an existing image, effectively merging the two together.

Parameters
sourceImagethe source image
transformthe transformation to apply to the new image, or NULL for none
destinationImagethe destination image to copy to

Definition at line 854 of file gerb_image.c.

References gerbv_image_t::aperture.

◆ gerbv_image_create_arc_object()

void gerbv_image_create_arc_object ( gerbv_image_t image,
gdouble  centerX,
gdouble  centerY,
gdouble  radius,
gdouble  startAngle,
gdouble  endAngle,
gdouble  lineWidth,
gerbv_aperture_type_t  apertureType 
)

Draw an arc on the specified image.

Parameters
imagethe image to draw to
centerXthe center X coordinate
centerYthe center Y coordinate
radiusthe arc radius
startAnglethe start angle (in CCW degrees)
endAnglethe start angle (in CCW degrees)
lineWidththe width of the line to draw
apertureTypethe type of aperture to use (e.g. CIRCLE)

Definition at line 1029 of file gerb_image.c.

◆ gerbv_image_create_dummy_apertures()

void gerbv_image_create_dummy_apertures ( gerbv_image_t parsed_image)

Create any missing apertures in the specified image.

Parameters
parsed_imagethe image to repair

Definition at line 1276 of file gerb_image.c.

References gerbv_net::aperture, gerbv_image_t::aperture, GERBV_APTYPE_CIRCLE, gerbv_image_t::netlist, and gerbv_net::next.

◆ gerbv_image_create_line_object()

void gerbv_image_create_line_object ( gerbv_image_t image,
gdouble  startX,
gdouble  startY,
gdouble  endX,
gdouble  endY,
gdouble  lineWidth,
gerbv_aperture_type_t  apertureType 
)

Draw a line on the specified image.

Parameters
imagethe image to draw to
startXthe starting X coordinate
startYthe starting Y coordinate
endXthe ending X coordinate
endYthe ending Y coordinate
lineWidththe width of the line to draw
apertureTypethe type of aperture to use (e.g. CIRCLE)

Definition at line 1072 of file gerb_image.c.

◆ gerbv_image_create_rectangle_object()

void gerbv_image_create_rectangle_object ( gerbv_image_t image,
gdouble  coordinateX,
gdouble  coordinateY,
gdouble  width,
gdouble  height 
)

Draw a filled rectangle on the specified image.

Parameters
imagethe image to draw to
coordinateXthe X coordinate of the lower left corner
coordinateYthe Y coordinate of the lower left corner
widththe width of the drawn rectangle
heightthe height of the drawn rectangle

Definition at line 934 of file gerb_image.c.

References gerbv_image_t::netlist, and gerbv_net::next.

◆ gerbv_image_delete_net()

void gerbv_image_delete_net ( gerbv_net_t currentNet)

◆ gerbv_image_duplicate_image()

gerbv_image_t* gerbv_image_duplicate_image ( gerbv_image_t sourceImage,
gerbv_user_transformation_t transform 
)

Duplicate an existing image and return the new copy.

Returns
the newly created image
Parameters
sourceImagethe source image
transformthe transformation to apply to the new image, or NULL for none

Definition at line 815 of file gerb_image.c.

References gerbv_create_image(), gerbv_image_t::info, and gerbv_image_t::layertype.

Referenced by gerbv_export_drill_file_from_image(), gerbv_export_dxf_file_from_image(), gerbv_export_geda_pcb_file_from_image(), gerbv_export_isel_drill_file_from_image(), and gerbv_export_rs274x_file_from_image().

◆ gerbv_open_layer_from_filename()

void gerbv_open_layer_from_filename ( gerbv_project_t gerbvProject,
const gchar *  filename 
)

Open a file, parse the contents, and add a new layer to an existing project.

Parameters
gerbvProjectthe existing project to add the new layer to
filenamethe full pathname of the file to be parsed

Definition at line 214 of file gerbv.c.

◆ gerbv_open_layer_from_filename_with_color()

void gerbv_open_layer_from_filename_with_color ( gerbv_project_t gerbvProject,
const gchar *  filename,
guint16  red,
guint16  green,
guint16  blue,
guint16  alpha 
)

Open a file, parse the contents, and add a new layer to an existing project while setting the color of the layer.

Parameters
gerbvProjectthe existing project to add the new layer to
filenamethe full pathname of the file to be parsed
redthe value for the red color component
greenthe value for the green color component
bluethe value for the blue color component
alphathe value for the alpha color component

Definition at line 230 of file gerbv.c.

◆ gerbv_render_layer_to_cairo_target()

void gerbv_render_layer_to_cairo_target ( cairo_t *  cr,
gerbv_fileinfo_t fileInfo,
gerbv_render_info_t renderInfo 
)

Render a layer to a cairo context.

Parameters
crthe cairo context
fileInfothe layer fileinfo pointer
renderInfothe scene render info

Definition at line 916 of file gerbv.c.

◆ gerbv_render_zoom_to_fit_display()

void gerbv_render_zoom_to_fit_display ( gerbv_project_t gerbvProject,
gerbv_render_info_t renderInfo 
)

Calculate the zoom and translations to fit the rendered scene inside the given scene size.

Parameters
gerbvProjectthe project to use for calculating
renderInfothe scene render pointer (updates the values in this parameter)

Definition at line 683 of file gerbv.c.

Referenced by gerbv_export_png_file_from_project_autoscaled(), and open_files().

◆ gerbv_rotate_coord()

void gerbv_rotate_coord ( double *  x,
double *  y,
double  rad 
)
inline

Rotate coordinate x and y buy angle in radians

Definition at line 1030 of file gerbv.c.

Referenced by gerbv_transform_coord().

◆ gerbv_stats_add_layer()

void gerbv_stats_add_layer ( gerbv_stats_t accum_stats,
gerbv_stats_t input_stats,
int  this_layer 
)

Add stats gathered from specified layer to accumulated Gerber stats compiled from all layers

This fcn is called with a two gerbv_stats_t structs: accum_stats and input_stats. Accum_stats holds a list of stats accumulated for all layers. This will be reported in the report window. Input_stats holds a list of the stats for one particular layer to be added to the accumulated list.

Definition at line 121 of file gerb_stats.c.

Referenced by generate_gerber_analysis().

◆ gerbv_stats_destroy()

void gerbv_stats_destroy ( gerbv_stats_t stats)

Free the memory for a stats struct

Definition at line 104 of file gerb_stats.c.

◆ gerbv_stats_new()

gerbv_stats_t* gerbv_stats_new ( void  )

Allocates a new gerbv_stats structure.

Create new struct for holding Gerber stats

Returns
gerbv_stats pointer on success, NULL on ERROR

Definition at line 46 of file gerb_stats.c.

Referenced by generate_gerber_analysis(), and parse_gerb().

◆ gerbv_transform_coord()

◆ gerbv_transform_coord_for_image()

int gerbv_transform_coord_for_image ( double *  x,
double *  y,
const gerbv_image_t image,
const gerbv_project_t project 
)

Transform coordinate x and y for image in project

Definition at line 1056 of file gerbv.c.

References gerbv_get_fileinfo_for_image(), gerbv_transform_coord(), and gerbv_fileinfo_t::transform.