summaryrefslogtreecommitdiff
path: root/src/FbTk/ImageControl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk/ImageControl.cc')
-rw-r--r--src/FbTk/ImageControl.cc28
1 files changed, 2 insertions, 26 deletions
diff --git a/src/FbTk/ImageControl.cc b/src/FbTk/ImageControl.cc
index d68ddb1..b9c3685 100644
--- a/src/FbTk/ImageControl.cc
+++ b/src/FbTk/ImageControl.cc
@@ -104,9 +104,8 @@ struct ImageControl::Cache {
104 unsigned long pixel1, pixel2, texture; 104 unsigned long pixel1, pixel2, texture;
105}; 105};
106 106
107ImageControl::ImageControl(int screen_num, bool dither, 107ImageControl::ImageControl(int screen_num,
108 int cpc, unsigned long cache_timeout, unsigned long cmax): 108 int cpc, unsigned long cache_timeout, unsigned long cmax):
109 m_dither(dither),
110 m_colors(0), 109 m_colors(0),
111 m_num_colors(0), 110 m_num_colors(0),
112 m_colors_per_channel(cpc) { 111 m_colors_per_channel(cpc) {
@@ -318,13 +317,6 @@ void ImageControl::colorTables(const unsigned char **rmt, const unsigned char **
318 if (bbit) *bbit = blue_bits; 317 if (bbit) *bbit = blue_bits;
319} 318}
320 319
321#ifdef NOT_USED
322void ImageControl::getXColorTable(XColor **c, int *n) {
323 if (c) *c = m_colors;
324 if (n) *n = m_num_colors;
325}
326#endif
327
328void ImageControl::getGradientBuffers(unsigned int w, 320void ImageControl::getGradientBuffers(unsigned int w,
329 unsigned int h, 321 unsigned int h,
330 unsigned int **xbuf, 322 unsigned int **xbuf,
@@ -380,15 +372,6 @@ void ImageControl::installRootColormap() {
380 XUngrabServer(disp); 372 XUngrabServer(disp);
381} 373}
382 374
383#ifdef NOT_USED
384void ImageControl::setColorsPerChannel(int cpc) {
385 if (cpc < 2) cpc = 2;
386 if (cpc > 6) cpc = 6;
387
388 m_colors_per_channel = cpc;
389}
390#endif
391
392unsigned long ImageControl::getSqrt(unsigned int x) const { 375unsigned long ImageControl::getSqrt(unsigned int x) const {
393 if (! sqrt_table) { 376 if (! sqrt_table) {
394 // build sqrt table for use with elliptic gradient 377 // build sqrt table for use with elliptic gradient
@@ -449,8 +432,6 @@ void ImageControl::createColorTable() {
449 432
450 if (bits_per_pixel == 0) 433 if (bits_per_pixel == 0)
451 bits_per_pixel = m_screen_depth; 434 bits_per_pixel = m_screen_depth;
452 if (bits_per_pixel >= 24)
453 setDither(false);
454 435
455 red_offset = green_offset = blue_offset = 0; 436 red_offset = green_offset = blue_offset = 0;
456 437
@@ -501,12 +482,7 @@ void ImageControl::createColorTable() {
501 482
502 m_colors = new XColor[m_num_colors]; 483 m_colors = new XColor[m_num_colors];
503 484
504 int bits = 256 / m_colors_per_channel; 485 int bits = 255 / (m_colors_per_channel - 1);
505
506#ifndef ORDEREDPSEUDO
507 bits = 255 / (m_colors_per_channel - 1);
508#endif // ORDEREDPSEUDO
509
510 red_bits = green_bits = blue_bits = bits; 486 red_bits = green_bits = blue_bits = bits;
511 487
512 for (unsigned int i = 0; i < 256; i++) { 488 for (unsigned int i = 0; i < 256; i++) {