20#ifndef GERBER_TO_PNG_H
21#define GERBER_TO_PNG_H
51std::unique_ptr<GERBER_FILE_IMAGE>
LoadGerberOrExcellon(
const wxString& aPath, wxString* aErrorMsg,
52 wxArrayString* aMessages =
nullptr );
118 wxString* aErrorMsg =
nullptr, wxArrayString* aMessages =
nullptr );
132 wxString* aErrorMsg =
nullptr, wxArrayString* aMessages =
nullptr );
Hold the image data and parameters for one gerber file and layer parameters.
Job to convert Gerber/Excellon files to PNG images.
A color representation with 4 components: red, green, blue, alpha.
static const COLOR4D BLACK
static constexpr int MIN_PIXEL_SIZE
GERBER_PLOTTER_VIEWPORT CalculatePlotterViewport(const BOX2I &aBBox, int aDpi, int aWidth, int aHeight)
Compute pixel dimensions and plotter scale from a bounding box and DPI/size settings.
std::unique_ptr< GERBER_FILE_IMAGE > LoadGerberOrExcellon(const wxString &aPath, wxString *aErrorMsg, wxArrayString *aMessages=nullptr)
Load a Gerber or Excellon file, auto-detecting by extension.
bool IsExcellonFile(const wxString &aPath)
Determine if a file is an Excellon drill file based on extension.
BOX2I CalculateGerberBoundingBox(GERBER_FILE_IMAGE *aImage)
Calculate bounding box for all draw items in a gerber image.
bool RenderGerberToPng(const wxString &aInputPath, const wxString &aOutputPath, const GERBER_RENDER_OPTIONS &aOptions, wxString *aErrorMsg=nullptr, wxArrayString *aMessages=nullptr)
Render a Gerber or Excellon file to PNG.
Computed plotter viewport parameters from a bounding box and render settings.
Render options for Gerber to PNG conversion.
double windowWidthMm
Viewport width in mm (> 0 enables viewport mode)
KIGFX::COLOR4D foregroundColor
KIGFX::COLOR4D backgroundColor
Transparent white.
int height
0 = calculate from DPI
int width
0 = calculate from DPI
double originYMm
Viewport origin Y in mm.
bool HasViewportOverride() const
double windowHeightMm
Viewport height in mm (> 0 enables viewport mode)
double originXMm
Viewport origin X in mm.
VECTOR2< int32_t > VECTOR2I