Plotting: Handle mask transparency
This handles images with transparent colors by mapping the transparent color to white. This only works when plotted into the background.
This commit is contained in:
parent
ddbc25077c
commit
b32439a694
|
@ -405,6 +405,16 @@ void PDF_PLOTTER::PlotImage( const wxImage & aImage, const wxPoint& aPos,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( aImage.HasMask() )
|
||||||
|
{
|
||||||
|
if( r == aImage.GetMaskRed() && g == aImage.GetMaskGreen() && b == aImage.GetMaskBlue() )
|
||||||
|
{
|
||||||
|
r = 0xFF;
|
||||||
|
g = 0xFF;
|
||||||
|
b = 0xFF;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// As usual these days, stdio buffering has to suffeeeeerrrr
|
// As usual these days, stdio buffering has to suffeeeeerrrr
|
||||||
if( colorMode )
|
if( colorMode )
|
||||||
{
|
{
|
||||||
|
|
|
@ -725,6 +725,17 @@ void PS_PLOTTER::PlotImage( const wxImage & aImage, const wxPoint& aPos,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( aImage.HasMask() )
|
||||||
|
{
|
||||||
|
if( red == aImage.GetMaskRed() && green == aImage.GetMaskGreen()
|
||||||
|
&& blue == aImage.GetMaskBlue() )
|
||||||
|
{
|
||||||
|
red = 0xFF;
|
||||||
|
green = 0xFF;
|
||||||
|
blue = 0xFF;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if( colorMode )
|
if( colorMode )
|
||||||
fprintf( outputFile, "%2.2X%2.2X%2.2X", red, green, blue );
|
fprintf( outputFile, "%2.2X%2.2X%2.2X", red, green, blue );
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue