KiCad PCB EDA Suite
Loading...
Searching...
No Matches
BITMAPCONV_INFO Class Reference

#include <bitmap2component.h>

Public Member Functions

 BITMAPCONV_INFO (std::string &aData)
 
int ConvertBitmap (potrace_bitmap_t *aPotrace_bitmap, OUTPUT_FMT_ID aFormat, int aDpi_X, int aDpi_Y, BMP2CMP_MOD_LAYER aModLayer)
 Run the conversion of the bitmap.
 
std::string & GetErrorMessages ()
 

Private Member Functions

void createOutputData (BMP2CMP_MOD_LAYER aModLayer=(BMP2CMP_MOD_LAYER) 0)
 Creates the data specified by m_Format.
 
void outputDataHeader (const char *aBrdLayerName)
 Function outputDataHeader write to file the header depending on file format.
 
void outputDataEnd ()
 Function outputDataEnd write to file the last strings depending on file format.
 
const char * getBoardLayerName (BMP2CMP_MOD_LAYER aChoice)
 
void outputOnePolygon (SHAPE_LINE_CHAIN &aPolygon, const char *aBrdLayerName)
 Function outputOnePolygon write one polygon to output file.
 

Private Attributes

enum OUTPUT_FMT_ID m_Format
 
int m_PixmapWidth
 
int m_PixmapHeight
 
double m_ScaleX
 
double m_ScaleY
 
potrace_path_t * m_Paths
 
std::string m_CmpName
 
std::string & m_Data
 
std::string m_errors
 

Detailed Description

Definition at line 59 of file bitmap2component.h.

Constructor & Destructor Documentation

◆ BITMAPCONV_INFO()

BITMAPCONV_INFO::BITMAPCONV_INFO ( std::string &  aData)

Member Function Documentation

◆ ConvertBitmap()

int BITMAPCONV_INFO::ConvertBitmap ( potrace_bitmap_t *  aPotrace_bitmap,
OUTPUT_FMT_ID  aFormat,
int  aDpi_X,
int  aDpi_Y,
BMP2CMP_MOD_LAYER  aModLayer 
)

◆ createOutputData()

◆ getBoardLayerName()

const char * BITMAPCONV_INFO::getBoardLayerName ( BMP2CMP_MOD_LAYER  aChoice)
private
Returns
the board layer name depending on the board layer selected
Parameters
aChoice= the choice (MOD_LYR_FSILKS to MOD_LYR_FINAL)

Definition at line 162 of file bitmap2component.cpp.

References MOD_LYR_COMMENTS, MOD_LYR_DRAWINGS, MOD_LYR_ECO1, MOD_LYR_ECO2, MOD_LYR_FAB, MOD_LYR_FSILKS, and MOD_LYR_FSOLDERMASK.

Referenced by createOutputData().

◆ GetErrorMessages()

std::string & BITMAPCONV_INFO::GetErrorMessages ( )
inline

Definition at line 82 of file bitmap2component.h.

References m_errors.

Referenced by BITMAP2CMP_PANEL::ExportToBuffer().

◆ outputDataEnd()

void BITMAPCONV_INFO::outputDataEnd ( )
private

Function outputDataEnd write to file the last strings depending on file format.

Definition at line 292 of file bitmap2component.cpp.

References EESCHEMA_FMT, KICAD_WKS_LOGO, m_Data, m_Format, PCBNEW_KICAD_MOD, and POSTSCRIPT_FMT.

Referenced by createOutputData().

◆ outputDataHeader()

void BITMAPCONV_INFO::outputDataHeader ( const char *  aBrdLayerName)
private

Function outputDataHeader write to file the header depending on file format.

Definition at line 200 of file bitmap2component.cpp.

References EESCHEMA_FMT, GetMajorMinorVersion(), KICAD_WKS_LOGO, m_CmpName, m_Data, m_Format, m_PixmapHeight, m_PixmapWidth, m_ScaleY, PCBNEW_KICAD_MOD, POSTSCRIPT_FMT, and SCH_IU_PER_MM.

Referenced by createOutputData().

◆ outputOnePolygon()

void BITMAPCONV_INFO::outputOnePolygon ( SHAPE_LINE_CHAIN aPolygon,
const char *  aBrdLayerName 
)
private

Function outputOnePolygon write one polygon to output file.

Polygon coordinates are expected scaled by the polygon extraction function

Definition at line 318 of file bitmap2component.cpp.

References SHAPE_LINE_CHAIN::CPoint(), EESCHEMA_FMT, KICAD_WKS_LOGO, m_Data, m_Format, m_PixmapHeight, m_PixmapWidth, m_ScaleX, m_ScaleY, PCB_IU_PER_MM, PCBNEW_KICAD_MOD, PL_IU_PER_MM, SHAPE_LINE_CHAIN::PointCount(), POSTSCRIPT_FMT, SCH_IU_PER_MM, SCH_LINE_THICKNESS_MM, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by createOutputData().

Member Data Documentation

◆ m_CmpName

std::string BITMAPCONV_INFO::m_CmpName
private

Definition at line 68 of file bitmap2component.h.

Referenced by BITMAPCONV_INFO(), and outputDataHeader().

◆ m_Data

std::string& BITMAPCONV_INFO::m_Data
private

Definition at line 69 of file bitmap2component.h.

Referenced by outputDataEnd(), outputDataHeader(), and outputOnePolygon().

◆ m_errors

std::string BITMAPCONV_INFO::m_errors
private

Definition at line 70 of file bitmap2component.h.

Referenced by ConvertBitmap(), createOutputData(), and GetErrorMessages().

◆ m_Format

enum OUTPUT_FMT_ID BITMAPCONV_INFO::m_Format
private

◆ m_Paths

potrace_path_t* BITMAPCONV_INFO::m_Paths
private

Definition at line 67 of file bitmap2component.h.

Referenced by BITMAPCONV_INFO(), ConvertBitmap(), and createOutputData().

◆ m_PixmapHeight

int BITMAPCONV_INFO::m_PixmapHeight
private

◆ m_PixmapWidth

int BITMAPCONV_INFO::m_PixmapWidth
private

◆ m_ScaleX

double BITMAPCONV_INFO::m_ScaleX
private

◆ m_ScaleY

double BITMAPCONV_INFO::m_ScaleY
private

The documentation for this class was generated from the following files: