gerbv  2.6A
gerb_image.c File Reference

Go to the source code of this file.

Functions

gerbv_image_tgerbv_create_image (gerbv_image_t *image, const gchar *type)
void gerbv_destroy_image (gerbv_image_t *image)
gerbv_image_tgerbv_image_duplicate_image (gerbv_image_t *sourceImage, gerbv_user_transformation_t *transform)
void gerbv_image_copy_image (gerbv_image_t *sourceImage, gerbv_user_transformation_t *transform, gerbv_image_t *destinationImage)
void gerbv_image_delete_net (gerbv_net_t *currentNet)
void gerbv_image_create_rectangle_object (gerbv_image_t *image, gdouble coordinateX, gdouble coordinateY, gdouble width, gdouble height)
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_line_object (gerbv_image_t *image, gdouble startX, gdouble startY, gdouble endX, gdouble endY, gdouble lineWidth, gerbv_aperture_type_t apertureType)
gerbv_net_tgerbv_image_return_next_renderable_object (gerbv_net_t *oldNet)
void gerbv_image_create_dummy_apertures (gerbv_image_t *parsed_image)

Detailed Description

This file contains general files for handling the gerbv_image_t structure.

Definition in file gerb_image.c.

Function Documentation

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
Examples:
example5.c.

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().

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
Examples:
example2.c.

Definition at line 562 of file gerb_image.c.

References gerbv_image_t::aperture, gerbv_image_t::layers, gerbv_image_t::netlist, gerbv_layer_t::next, gerbv_netstate_t::next, gerbv_net::next, and gerbv_image_t::states.

Referenced by merge_images().

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)
Examples:
example5.c.

Definition at line 752 of file gerb_image.c.

References gerbv_net::aperture, gerbv_net::aperture_state, gerbv_net::boundingBox, gerbv_net::cirseg, GERBV_APERTURE_STATE_ON, GERBV_INTERPOLATION_CCW_CIRCULAR, gerbv_net::interpolation, gerbv_net::start_x, gerbv_net::start_y, gerbv_net::stop_x, and gerbv_net::stop_y.

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 987 of file gerb_image.c.

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

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)
Examples:
example5.c.

Definition at line 795 of file gerb_image.c.

References gerbv_net::aperture, gerbv_net::aperture_state, gerbv_net::boundingBox, GERBV_APERTURE_STATE_FLASH, GERBV_APERTURE_STATE_ON, GERBV_INTERPOLATION_LINEARx1, gerbv_net::interpolation, gerbv_net::start_x, gerbv_net::start_y, gerbv_net::stop_x, and gerbv_net::stop_y.

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
Examples:
example5.c.

Definition at line 653 of file gerb_image.c.

References gerbv_net::aperture_state, gerbv_net::boundingBox, GERBV_APERTURE_STATE_OFF, GERBV_APERTURE_STATE_ON, GERBV_INTERPOLATION_LINEARx1, GERBV_INTERPOLATION_PAREA_END, GERBV_INTERPOLATION_PAREA_START, 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.

void gerbv_image_delete_net ( gerbv_net_t currentNet)

Delete a net in an existing image.

Parameters
currentNetthe net to delete
Examples:
example4.c.

Definition at line 606 of file gerb_image.c.

References gerbv_net::aperture, gerbv_net::aperture_state, GERBV_APERTURE_STATE_OFF, GERBV_INTERPOLATION_DELETED, GERBV_INTERPOLATION_PAREA_END, GERBV_INTERPOLATION_PAREA_START, gerbv_net::interpolation, and gerbv_net::next.

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
Examples:
example2.c.

Definition at line 524 of file gerb_image.c.

References gerbv_image_t::aperture, gerbv_create_image(), gerbv_image_t::info, gerbv_image_t::layers, gerbv_image_t::layertype, and gerbv_image_t::states.

Referenced by gerbv_export_drill_file_from_image(), gerbv_export_rs274x_file_from_image(), and merge_images().