bitmap2component: Handle mask/alpha

Use alpha and mask components of bitmaps to set boundaries for the image
tracing.

Fixes: lp:1815216
* https://bugs.launchpad.net/kicad/+bug/1815216
This commit is contained in:
Seth Hillbrand
2019-02-09 08:40:59 -08:00
parent c0a86d734d
commit 5cfa37da09
5 changed files with 185 additions and 805 deletions
+4 -1
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 1992-2013 jean-pierre.charras
* Copyright (C) 1992-2013 Kicad Developers, see change_log.txt for contributors.
* Copyright (C) 1992-2019 Kicad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -155,6 +155,7 @@ int bitmap2component( potrace_bitmap_t* aPotrace_bitmap, FILE* aOutfile,
return 1;
}
printf("Step 1\n");
BITMAPCONV_INFO info;
info.m_PixmapWidth = aPotrace_bitmap->w;
info.m_PixmapHeight = aPotrace_bitmap->h; // the bitmap size in pixels
@@ -434,6 +435,8 @@ void BITMAPCONV_INFO::CreateOutputFile( BMP2CMP_MOD_LAYER aModLayer )
* Bezier curves are approximated by a polyline
*/
potrace_path_t* paths = m_Paths; // the list of paths
if(!m_Paths)
printf("NULL Paths!\n");
while( paths != NULL )
{
int cnt = paths->curve.n;