Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
51a84547
Commit
51a84547
authored
Oct 26, 2011
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bitmap2component: use BOOST:POLYGON instead of KBool, and minor enhancements.
parent
4cbcf56c
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
145 additions
and
198 deletions
+145
-198
bitmap2cmp_gui.cpp
bitmap2component/bitmap2cmp_gui.cpp
+17
-6
bitmap2component.cpp
bitmap2component/bitmap2component.cpp
+123
-188
potracelib.h
potrace/potracelib.h
+5
-4
No files found.
bitmap2component/bitmap2cmp_gui.cpp
View file @
51a84547
...
@@ -45,6 +45,8 @@
...
@@ -45,6 +45,8 @@
#define KEYWORD_FRAME_SIZEY wxT( "Bmconverter_Size_y" )
#define KEYWORD_FRAME_SIZEY wxT( "Bmconverter_Size_y" )
#define KEYWORD_LAST_INPUT_FILE wxT( "Last_input" )
#define KEYWORD_LAST_INPUT_FILE wxT( "Last_input" )
#define KEYWORD_LAST_OUTPUT_FILE wxT( "Last_output" )
#define KEYWORD_LAST_OUTPUT_FILE wxT( "Last_output" )
#define KEYWORD_BINARY_THRESHOLD wxT( "Threshold" )
#define KEYWORD_BW_NEGATIVE wxT( "Negative_choice" )
extern
int
bitmap2component
(
potrace_bitmap_t
*
aPotrace_bitmap
,
FILE
*
aOutfile
,
int
aFormat
);
extern
int
bitmap2component
(
potrace_bitmap_t
*
aPotrace_bitmap
,
FILE
*
aOutfile
,
int
aFormat
);
...
@@ -88,6 +90,7 @@ private:
...
@@ -88,6 +90,7 @@ private:
BM2CMP_FRAME
::
BM2CMP_FRAME
()
:
BM2CMP_FRAME_BASE
(
NULL
)
BM2CMP_FRAME
::
BM2CMP_FRAME
()
:
BM2CMP_FRAME_BASE
(
NULL
)
{
{
int
tmp
;
m_Config
=
new
wxConfig
();
m_Config
=
new
wxConfig
();
m_Config
->
Read
(
KEYWORD_FRAME_POSX
,
&
m_FramePos
.
x
,
-
1
);
m_Config
->
Read
(
KEYWORD_FRAME_POSX
,
&
m_FramePos
.
x
,
-
1
);
m_Config
->
Read
(
KEYWORD_FRAME_POSY
,
&
m_FramePos
.
y
,
-
1
);
m_Config
->
Read
(
KEYWORD_FRAME_POSY
,
&
m_FramePos
.
y
,
-
1
);
...
@@ -95,6 +98,11 @@ BM2CMP_FRAME::BM2CMP_FRAME() : BM2CMP_FRAME_BASE( NULL )
...
@@ -95,6 +98,11 @@ BM2CMP_FRAME::BM2CMP_FRAME() : BM2CMP_FRAME_BASE( NULL )
m_Config
->
Read
(
KEYWORD_FRAME_SIZEY
,
&
m_FrameSize
.
y
,
-
1
);
m_Config
->
Read
(
KEYWORD_FRAME_SIZEY
,
&
m_FrameSize
.
y
,
-
1
);
m_Config
->
Read
(
KEYWORD_LAST_INPUT_FILE
,
&
m_BitmapFileName
);
m_Config
->
Read
(
KEYWORD_LAST_INPUT_FILE
,
&
m_BitmapFileName
);
m_Config
->
Read
(
KEYWORD_LAST_OUTPUT_FILE
,
&
m_ConvertedFileName
);
m_Config
->
Read
(
KEYWORD_LAST_OUTPUT_FILE
,
&
m_ConvertedFileName
);
if
(
m_Config
->
Read
(
KEYWORD_BINARY_THRESHOLD
,
&
tmp
)
)
m_sliderThreshold
->
SetValue
(
tmp
);
if
(
m_Config
->
Read
(
KEYWORD_BW_NEGATIVE
,
&
tmp
)
)
m_rbOptions
->
SetSelection
(
tmp
?
1
:
0
);
// Give an icon
// Give an icon
wxIcon
icon
;
wxIcon
icon
;
...
@@ -127,6 +135,8 @@ BM2CMP_FRAME::~BM2CMP_FRAME()
...
@@ -127,6 +135,8 @@ BM2CMP_FRAME::~BM2CMP_FRAME()
m_Config
->
Write
(
KEYWORD_FRAME_SIZEY
,
(
long
)
m_FrameSize
.
y
);
m_Config
->
Write
(
KEYWORD_FRAME_SIZEY
,
(
long
)
m_FrameSize
.
y
);
m_Config
->
Write
(
KEYWORD_LAST_INPUT_FILE
,
m_BitmapFileName
);
m_Config
->
Write
(
KEYWORD_LAST_INPUT_FILE
,
m_BitmapFileName
);
m_Config
->
Write
(
KEYWORD_LAST_OUTPUT_FILE
,
m_ConvertedFileName
);
m_Config
->
Write
(
KEYWORD_LAST_OUTPUT_FILE
,
m_ConvertedFileName
);
m_Config
->
Write
(
KEYWORD_BINARY_THRESHOLD
,
m_sliderThreshold
->
GetValue
()
);
m_Config
->
Write
(
KEYWORD_BW_NEGATIVE
,
m_rbOptions
->
GetSelection
()
);
delete
m_Config
;
delete
m_Config
;
...
@@ -390,16 +400,12 @@ void BM2CMP_FRAME::ExportFile( FILE* aOutfile, int aFormat )
...
@@ -390,16 +400,12 @@ void BM2CMP_FRAME::ExportFile( FILE* aOutfile, int aFormat )
}
}
// BM_TO_CMP_APP
// EDA_APP
void
EDA_APP
::
MacOpenFile
(
const
wxString
&
fileName
)
{
}
IMPLEMENT_APP
(
EDA_APP
)
IMPLEMENT_APP
(
EDA_APP
)
///-----------------------------------------------------------------------------
///-----------------------------------------------------------------------------
//
BM_TO_CMP
_APP
//
EDA
_APP
// main program
// main program
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
...
@@ -415,3 +421,8 @@ bool EDA_APP::OnInit()
...
@@ -415,3 +421,8 @@ bool EDA_APP::OnInit()
return
true
;
return
true
;
}
}
void
EDA_APP
::
MacOpenFile
(
const
wxString
&
fileName
)
{
}
bitmap2component/bitmap2component.cpp
View file @
51a84547
This diff is collapsed.
Click to expand it.
potrace/potracelib.h
View file @
51a84547
...
@@ -77,10 +77,11 @@ typedef struct potrace_dpoint_s potrace_dpoint_t;
...
@@ -77,10 +77,11 @@ typedef struct potrace_dpoint_s potrace_dpoint_t;
/* closed curve segment */
/* closed curve segment */
struct
potrace_curve_s
struct
potrace_curve_s
{
{
int
n
;
/* number of segments */
int
n
;
// number of segments
int
*
tag
;
/* tag[n]: POTRACE_CURVETO or POTRACE_CORNER */
int
*
tag
;
// tag[n]: POTRACE_CURVETO or POTRACE_CORNER
potrace_dpoint_t
(
*
c
)[
3
];
/* c[n][3]: control points.
potrace_dpoint_t
(
*
c
)[
3
];
/* c[n][3]: control points.
* c[n][0] is unused for tag[n]=POTRACE_CORNER */
* c[n][0] is unused for tag[n]=POTRACE_CORNER
*/
};
};
typedef
struct
potrace_curve_s
potrace_curve_t
;
typedef
struct
potrace_curve_s
potrace_curve_t
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment