summaryrefslogtreecommitdiffstats
path: root/src/image.cpp
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2010-06-25 11:31:51 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2010-06-25 11:31:51 (GMT)
commitd0412f05557d55f465407a9337553c0a6ee0396f (patch)
treefa51c4ac8c1fe241b2d6c4af9d2f9a1297ce8e0a /src/image.cpp
parent1cbd7d2faa8d543f521b144a8120c3a1ba2f832f (diff)
downloadDoxygen-d0412f05557d55f465407a9337553c0a6ee0396f.zip
Doxygen-d0412f05557d55f465407a9337553c0a6ee0396f.tar.gz
Doxygen-d0412f05557d55f465407a9337553c0a6ee0396f.tar.bz2
Release-1.7.1
Diffstat (limited to 'src/image.cpp')
-rw-r--r--src/image.cpp48
1 files changed, 25 insertions, 23 deletions
diff --git a/src/image.cpp b/src/image.cpp
index 76f9661..ac7c8d1 100644
--- a/src/image.cpp
+++ b/src/image.cpp
@@ -166,28 +166,6 @@ static Color palette[] =
{ 0xc0, 0xc0, 0xc0, 0xff }
};
-#if 0
-static Color palette2[] =
-{
- { 0xff, 0xff, 0xff },
- { 0xe0, 0xe0, 0xe0 },
- { 0xd0, 0xd0, 0xd0 },
- { 0xc0, 0xc0, 0xc0 },
- { 0xb0, 0xb0, 0xb0 },
- { 0xa0, 0xa0, 0xa0 },
- { 0x90, 0x90, 0x90 },
- { 0x80, 0x80, 0x80 },
- { 0x70, 0x70, 0x70 },
- { 0x60, 0x60, 0x60 },
- { 0x50, 0x50, 0x50 },
- { 0x40, 0x40, 0x40 },
- { 0x30, 0x30, 0x30 },
- { 0x20, 0x20, 0x20 },
- { 0x10, 0x10, 0x10 },
- { 0x00, 0x00, 0x00 }
-};
-#endif
-
// for alpha we use x^(1/1.3)
static Color palette2[] =
{
@@ -209,6 +187,27 @@ static Color palette2[] =
{ 0x00, 0x00, 0x00, 0xff }
};
+static Color palette3[] =
+{
+ { 0xff, 0xff, 0xff, 0xff },
+ { 0xe0, 0xe0, 0xe0, 0xff },
+ { 0xd0, 0xd0, 0xd0, 0xff },
+ { 0xc0, 0xc0, 0xc0, 0xff },
+ { 0xb0, 0xb0, 0xb0, 0xff },
+ { 0xa0, 0xa0, 0xa0, 0xff },
+ { 0x90, 0x90, 0x90, 0xff },
+ { 0x80, 0x80, 0x80, 0xff },
+ { 0x70, 0x70, 0x70, 0xff },
+ { 0x60, 0x60, 0x60, 0xff },
+ { 0x50, 0x50, 0x50, 0xff },
+ { 0x40, 0x40, 0x40, 0xff },
+ { 0x30, 0x30, 0x30, 0xff },
+ { 0x20, 0x20, 0x20, 0xff },
+ { 0x10, 0x10, 0x10, 0xff },
+ { 0x00, 0x00, 0x00, 0xff }
+};
+
+
Image::Image(int w,int h)
{
static int hue = Config_getInt("HTML_COLORSTYLE_HUE");
@@ -401,12 +400,15 @@ bool Image::save(const char *fileName,int mode)
return FALSE;
}
#endif
+ static bool useTransparency = Config_getBool("FORMULA_TRANSPARENT");
uchar* buffer;
size_t bufferSize;
LodePNG_Encoder encoder;
LodePNG_Encoder_init(&encoder);
int numCols = mode==0 ? 8 : 16;
- Color *pPal = mode==0 ? palette : palette2;
+ Color *pPal = mode==0 ? palette :
+ useTransparency ? palette2 :
+ palette3 ;
int i;
for (i=0;i<numCols;i++,pPal++)
{