dillo  3.0.5
About: dillo is a small, fast, extensible Web browser particularly suitable for older or smaller computers and embedded systems (but only limited or no support for frames, CSS, JavaScript, Java).
  Fossies Dox: dillo-3.0.5.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

fltkimgbuf.cc
Go to the documentation of this file.
1 /*
2  * Dillo Widget
3  *
4  * Copyright 2005-2007, 2012-2013 Sebastian Geerken <sgeerken@dillo.org>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #include "fltkcore.hh"
21 #include "../lout/msg.h"
22 #include "../lout/misc.hh"
23 
24 #include <FL/fl_draw.H>
25 #include <math.h>
26 
27 #define IMAGE_MAX_AREA (6000 * 6000)
28 
29 #define MAX_WIDTH 0x8000
30 #define MAX_HEIGHT 0x8000
31 
32 namespace dw {
33 namespace fltk {
34 
35 using namespace lout::container::typed;
36 
39 
42 
44 {
45  // Since the number of possible keys is low, a linear search is
46  // sufficiently fast.
47 
48  for (int i = 0; i < gammaCorrectionTables->size(); i++) {
49  GammaCorrectionTable *gct = gammaCorrectionTables->get(i);
50  if (gct->gamma == gamma)
51  return gct->map;
52  }
53 
54  _MSG("Creating new table for gamma = %g\n", gamma);
55 
57  gct->gamma = gamma;
58 
59  for (int i = 0; i < 256; i++)
60  gct->map[i] = 255 * pow((double)i / 255, gamma);
61 
62  gammaCorrectionTables->put (gct);
63  return gct->map;
64 }
65 
66 bool FltkImgbuf::excessiveImageDimensions (int width, int height)
67 {
68  return width <= 0 || height <= 0 ||
69  width > IMAGE_MAX_AREA / height;
70 }
71 
73 {
74  _MSG("Deleting gammaCorrectionTables\n");
75  delete gammaCorrectionTables;
76  gammaCorrectionTables = NULL;
77 }
78 
79 FltkImgbuf::FltkImgbuf (Type type, int width, int height, double gamma)
80 {
81  DBG_OBJ_CREATE ("dw::fltk::FltkImgbuf");
82 
83  _MSG ("FltkImgbuf::FltkImgbuf: new root %p\n", this);
84  init (type, width, height, gamma, NULL);
85 }
86 
87 FltkImgbuf::FltkImgbuf (Type type, int width, int height, double gamma,
88  FltkImgbuf *root)
89 {
90  DBG_OBJ_CREATE ("dw::fltk::FltkImgbuf");
91 
92  _MSG ("FltkImgbuf::FltkImgbuf: new scaled %p, root is %p\n", this, root);
93  init (type, width, height, gamma, root);
94 }
95 
96 void FltkImgbuf::init (Type type, int width, int height, double gamma,
97  FltkImgbuf *root)
98 {
99  if (excessiveImageDimensions (width, height)) {
100  // Excessive image sizes which would cause crashes due to too
101  // big allocations for the image buffer (for root buffers, when
102  // the image was specially prepared). In this case we use a 1 x
103  // 1 size.
104  MSG("FltkImgbuf::init: suspicious image size request %d x %d\n",
105  width, height);
106  init (type, 1, 1, gamma, root);
107  } else if (width > MAX_WIDTH) {
108  // Too large dimensions cause dangerous overflow errors, so we
109  // limit dimensions to harmless values.
110  //
111  // Example: 65535 * 65536 / 65536 (see scaling below) results in
112  // the negative value -1.
113 
114  MSG("FltkImgbuf::init: cannot handle large width %d\n", width);
115  init (type, MAX_WIDTH, height, gamma, root);
116  } else if (height > MAX_HEIGHT) {
117  MSG("FltkImgbuf::init: cannot handle large height %d\n", height);
118  init (type, width, MAX_HEIGHT, gamma, root);
119  } else if (gamma <= 0) {
120  MSG("FltkImgbuf::init: non-positive gamma %g\n", gamma);
121  init (type, width, height, 1, root);
122  } else {
123  this->root = root;
124  this->type = type;
125  this->width = width;
126  this->height = height;
127  this->gamma = gamma;
128 
129  DBG_OBJ_SET_NUM ("width", width);
130  DBG_OBJ_SET_NUM ("height", height);
131 
132  // TODO: Maybe this is only for root buffers
133  switch (type) {
134  case RGBA: bpp = 4; break;
135  case RGB: bpp = 3; break;
136  default: bpp = 1; break;
137  }
138  _MSG("FltkImgbuf::init this=%p width=%d height=%d bpp=%d gamma=%g\n",
139  this, width, height, bpp, gamma);
140  rawdata = new uchar[bpp * width * height];
141  // Set light-gray as interim background color.
142  memset(rawdata, 222, width*height*bpp);
143 
144  refCount = 1;
145  deleteOnUnref = true;
146  copiedRows = new lout::misc::BitSet (height);
147 
148  // The list is only used for root buffers.
149  if (isRoot())
150  scaledBuffers = new lout::container::typed::List <FltkImgbuf> (true);
151  else
152  scaledBuffers = NULL;
153 
154  if (!isRoot()) {
155  // Scaling
156  for (int row = 0; row < root->height; row++) {
157  if (root->copiedRows->get (row))
158  scaleRow (row, root->rawdata + row*root->width*root->bpp);
159  }
160  }
161  }
162 }
163 
165 {
166  _MSG ("FltkImgbuf::~FltkImgbuf\n");
167 
168  if (!isRoot())
169  root->detachScaledBuf (this);
170 
171  delete[] rawdata;
172  delete copiedRows;
173 
174  if (scaledBuffers)
175  delete scaledBuffers;
176 
177  DBG_OBJ_DELETE ();
178 }
179 
185 {
186  scaledBuffers->detachRef (scaledBuf);
187 
188  _MSG("FltkImgbuf[root %p]: scaled buffer %p is detached, %d left\n",
189  this, scaledBuf, scaledBuffers->size ());
190 
191  if (refCount == 0 && scaledBuffers->isEmpty () && deleteOnUnref)
192  // If the root buffer is not used anymore, but this is the last scaled
193  // buffer.
194  // See also: FltkImgbuf::unref().
195  delete this;
196 }
197 
198 void FltkImgbuf::setCMap (int *colors, int num_colors)
199 {
200 }
201 
202 inline void FltkImgbuf::scaleRow (int row, const core::byte *data)
203 {
204  if (row < root->height) {
205  if (scaleMode == SIMPLE)
206  scaleRowSimple (row, data);
207  else
208  scaleRowBeautiful (row, data);
209  }
210 }
211 
212 inline void FltkImgbuf::scaleRowSimple (int row, const core::byte *data)
213 {
214  int sr1 = scaledY (row);
215  int sr2 = scaledY (row + 1);
216 
217  for (int sr = sr1; sr < sr2; sr++) {
218  // Avoid multiple passes.
219  if (copiedRows->get(sr)) continue;
220 
221  copiedRows->set (sr, true);
222  if (sr == sr1) {
223  for (int px = 0; px < root->width; px++) {
224  int px1 = px * width / root->width;
225  int px2 = (px+1) * width / root->width;
226  for (int sp = px1; sp < px2; sp++) {
227  memcpy(rawdata + (sr*width + sp)*bpp, data + px*bpp, bpp);
228  }
229  }
230  } else {
231  memcpy(rawdata + sr*width*bpp, rawdata + sr1*width*bpp, width*bpp);
232  }
233  }
234 }
235 
236 inline void FltkImgbuf::scaleRowBeautiful (int row, const core::byte *data)
237 {
238  int sr1 = scaledY (row);
239  int sr2 = scaledY (row + 1);
240  bool allRootRows = false;
241 
242  // Don't rescale rows!
243  if (copiedRows->get(sr1)) return;
244 
245  if (height > root->height) {
246  scaleBuffer (data, root->width, 1,
247  rawdata + sr1 * width * bpp, width, sr2 - sr1,
248  bpp, gamma);
249  // Mark scaled rows done
250  for (int sr = sr1; sr < sr2 || sr == sr1; sr++)
251  copiedRows->set (sr, true);
252  } else {
253  assert (sr1 == sr2 || sr1 + 1 == sr2);
254  int row1 = backscaledY(sr1), row2 = backscaledY(sr1 + 1);
255 
256  // Check all the necessary root lines already arrived,
257  // a larger area than a single row may be accessed here.
258  for (int r=row1; (allRootRows=root->copiedRows->get(r)) && ++r < row2; );
259  if (allRootRows) {
260  scaleBuffer (root->rawdata + row1 * root->width * bpp,
261  root->width, row2 - row1,
262  rawdata + sr1 * width * bpp, width, 1,
263  bpp, gamma);
264  // Mark scaled row done
265  copiedRows->set (sr1, true);
266  }
267  }
268 }
269 
290 inline void FltkImgbuf::scaleBuffer (const core::byte *src, int srcWidth,
291  int srcHeight, core::byte *dest,
292  int destWidth, int destHeight, int bpp,
293  double gamma)
294 {
295  uchar *gammaMap1, *gammaMap2;
296 
297  if (scaleMode == BEAUTIFUL_GAMMA) {
298  gammaMap1 = findGammaCorrectionTable (gamma);
299  gammaMap2 = findGammaCorrectionTable (1 / gamma);
300  }
301 
302  for(int x = 0; x < destWidth; x++)
303  for(int y = 0; y < destHeight; y++) {
304  int xo1 = x * srcWidth / destWidth;
305  int xo2 = lout::misc::max ((x + 1) * srcWidth / destWidth, xo1 + 1);
306  int yo1 = y * srcHeight / destHeight;
307  int yo2 = lout::misc::max ((y + 1) * srcHeight / destHeight, yo1 + 1);
308  int n = (xo2 - xo1) * (yo2 - yo1);
309 
310  int v[bpp];
311  for(int i = 0; i < bpp; i++)
312  v[i] = 0;
313 
314  for(int xo = xo1; xo < xo2; xo++)
315  for(int yo = yo1; yo < yo2; yo++) {
316  const core::byte *ps = src + bpp * (yo * srcWidth + xo);
317  for(int i = 0; i < bpp; i++)
318  v[i] +=
319  (scaleMode == BEAUTIFUL_GAMMA ? gammaMap2[ps[i]] : ps[i]);
320  }
321 
322  core::byte *pd = dest + bpp * (y * destWidth + x);
323  for(int i = 0; i < bpp; i++)
324  pd[i] =
325  scaleMode == BEAUTIFUL_GAMMA ? gammaMap1[v[i] / n] : v[i] / n;
326  }
327 }
328 
329 void FltkImgbuf::copyRow (int row, const core::byte *data)
330 {
331  assert (isRoot());
332 
333  if (row < height) {
334  // Flag the row done and copy its data.
335  copiedRows->set (row, true);
336  memcpy(rawdata + row * width * bpp, data, width * bpp);
337 
338  // Update all the scaled buffers of this root image.
339  for (Iterator <FltkImgbuf> it = scaledBuffers->iterator();
340  it.hasNext(); ) {
341  FltkImgbuf *sb = it.getNext ();
342  sb->scaleRow (row, data);
343  }
344  }
345 }
346 
348 {
349  if (isRoot()) {
350  for (Iterator<FltkImgbuf> it = scaledBuffers->iterator(); it.hasNext();){
351  FltkImgbuf *sb = it.getNext ();
352  sb->copiedRows->clear();
353  }
354  }
355 }
356 
357 core::Imgbuf* FltkImgbuf::getScaledBuf (int width, int height)
358 {
359  if (!isRoot())
360  return root->getScaledBuf (width, height);
361 
362  if (width > MAX_WIDTH) {
363  // Similar to init.
364  MSG("FltkImgbuf::getScaledBuf: cannot handle large width %d\n", width);
365  return getScaledBuf (MAX_WIDTH, height);
366  }
367  if (height > MAX_HEIGHT) {
368  MSG("FltkImgbuf::getScaledBuf: cannot handle large height %d\n", height);
369  return getScaledBuf (width, MAX_HEIGHT);
370  }
371 
372  if (width == this->width && height == this->height) {
373  ref ();
374  return this;
375  }
376 
377  for (Iterator <FltkImgbuf> it = scaledBuffers->iterator(); it.hasNext(); ) {
378  FltkImgbuf *sb = it.getNext ();
379  if (sb->width == width && sb->height == height) {
380  sb->ref ();
381  return sb;
382  }
383  }
384 
385  // Check for excessive image sizes which would cause crashes due to
386  // too big allocations for the image buffer. In this case we return
387  // a pointer to the unscaled image buffer.
388  if (excessiveImageDimensions (width, height)) {
389  MSG("FltkImgbuf::getScaledBuf: suspicious image size request %d x %d\n",
390  width, height);
391  ref ();
392  return this;
393  }
394 
395  // This size is not yet used, so a new buffer has to be created.
396  FltkImgbuf *sb = new FltkImgbuf (type, width, height, gamma, this);
397  scaledBuffers->append (sb);
398  DBG_OBJ_ASSOC_CHILD (sb);
399 
400  return sb;
401 }
402 
404 {
405  // TODO: May have to be adjusted.
406 
407  if (isRoot()) {
408  /* root buffer */
409  area->x = 0;
410  area->y = row;
411  area->width = width;
412  area->height = 1;
413  _MSG("::getRowArea: area x=%d y=%d width=%d height=%d\n",
414  area->x, area->y, area->width, area->height);
415  } else {
416  if (row > root->height)
417  area->x = area->y = area->width = area->height = 0;
418  else {
419  // scaled buffer
420  int sr1 = scaledY (row);
421  int sr2 = scaledY (row + 1);
422 
423  area->x = 0;
424  area->y = sr1;
425  area->width = width;
426  area->height = sr2 - sr1;
427  _MSG("::getRowArea: area x=%d y=%d width=%d height=%d\n",
428  area->x, area->y, area->width, area->height);
429  }
430  }
431 }
432 
434 {
435  return root ? root->width : width;
436 }
437 
439 {
440  return root ? root->height : height;
441 }
442 
444 {
445  return new FltkImgbuf (type, width, height, gamma);
446 }
447 
448 void FltkImgbuf::copyTo (Imgbuf *dest, int xDestRoot, int yDestRoot,
449  int xSrc, int ySrc, int widthSrc, int heightSrc)
450 {
451  FltkImgbuf *fDest = (FltkImgbuf*)dest;
452  assert (bpp == fDest->bpp);
453 
454  int xSrc2 = lout::misc::min (xSrc + widthSrc, fDest->width - xDestRoot);
455  int ySrc2 = lout::misc::min (ySrc + heightSrc, fDest->height - yDestRoot);
456 
457  //printf ("copying from (%d, %d), %d x %d to (%d, %d) (root) => "
458  // "xSrc2 = %d, ySrc2 = %d\n",
459  // xSrc, ySrc, widthSrc, heightSrc, xDestRoot, yDestRoot,
460  // xSrc2, ySrc2);
461 
462  for (int x = xSrc; x < xSrc2; x++)
463  for (int y = ySrc; y < ySrc2; y++) {
464  int iSrc = x + width * y;
465  int iDest = xDestRoot + x + fDest->width * (yDestRoot + y);
466 
467  //printf (" (%d, %d): %d -> %d\n", x, y, iSrc, iDest);
468 
469  for (int b = 0; b < bpp; b++)
470  fDest->rawdata[bpp * iDest + b] = rawdata[bpp * iSrc + b];
471  }
472 }
473 
475 {
476  refCount++;
477 
478  //if (root)
479  // MSG("FltkImgbuf[scaled %p, root is %p]: ref() => %d\n",
480  // this, root, refCount);
481  //else
482  // MSG("FltkImgbuf[root %p]: ref() => %d\n", this, refCount);
483 }
484 
486 {
487  //if (root)
488  // MSG("FltkImgbuf[scaled %p, root is %p]: ref() => %d\n",
489  // this, root, refCount - 1);
490  //else
491  // MSG("FltkImgbuf[root %p]: ref() => %d\n", this, refCount - 1);
492 
493  if (--refCount == 0) {
494  if (isRoot ()) {
495  // Root buffer, it must be ensured that no scaled buffers are left.
496  // See also FltkImgbuf::detachScaledBuf().
497  if (scaledBuffers->isEmpty () && deleteOnUnref) {
498  delete this;
499  } else {
500  _MSG("FltkImgbuf[root %p]: not deleted. numScaled=%d\n",
501  this, scaledBuffers->size ());
502  }
503  } else
504  // Scaled buffer buffer, simply delete it.
505  delete this;
506  }
507 }
508 
510 {
511  return refCount == 1 &&
512  (scaledBuffers == NULL || scaledBuffers->isEmpty ());
513 }
514 
515 void FltkImgbuf::setDeleteOnUnref (bool deleteOnUnref)
516 {
517  assert (isRoot ());
518  this->deleteOnUnref = deleteOnUnref;
519 }
520 
522 {
523  return refCount != 0 ||
524  (scaledBuffers != NULL && !scaledBuffers->isEmpty ());
525 }
526 
527 
528 int FltkImgbuf::scaledY(int ySrc)
529 {
530  // TODO: May have to be adjusted.
531  assert (root != NULL);
532  return ySrc * height / root->height;
533 }
534 
535 int FltkImgbuf::backscaledY(int yScaled)
536 {
537  assert (root != NULL);
538 
539  // Notice that rounding errors because of integers do not play a
540  // role. This method cannot be the exact inverse of scaledY, since
541  // scaleY is not bijective, and so not invertible. Instead, both
542  // values always return the smallest value.
543  return yScaled * root->height / height;
544 }
545 
546 void FltkImgbuf::draw (Fl_Widget *target, int xRoot, int yRoot,
547  int x, int y, int width, int height)
548 {
549  // TODO: Clarify the question, whether "target" is the current widget
550  // (and so has not to be passed at all).
551 
552  _MSG("::draw: xRoot=%d x=%d yRoot=%d y=%d width=%d height=%d\n"
553  " this->width=%d this->height=%d\n",
554  xRoot, x, yRoot, y, width, height, this->width, this->height);
555 
556  if (x > this->width || y > this->height) {
557  return;
558  }
559 
560  if (x + width > this->width) {
561  width = this->width - x;
562  }
563 
564  if (y + height > this->height) {
565  height = this->height - y;
566  }
567 
568  fl_draw_image(rawdata+bpp*(y*this->width + x), xRoot + x, yRoot + y, width,
569  height, bpp, this->width * bpp);
570 
571 }
572 
573 } // namespace fltk
574 } // namespace dw
DBG_OBJ_DELETE
#define DBG_OBJ_DELETE()
Definition: debug.hh:176
dw::fltk::FltkImgbuf::scaleRowSimple
void scaleRowSimple(int row, const core::byte *data)
Definition: fltkimgbuf.cc:212
dw::fltk::FltkImgbuf::bpp
int bpp
Definition: fltkimgbuf.hh:31
fltkcore.hh
dw::fltk::FltkImgbuf::createSimilarBuf
core::Imgbuf * createSimilarBuf(int width, int height)
Definition: fltkimgbuf.cc:443
dw::fltk::FltkImgbuf::detachScaledBuf
void detachScaledBuf(FltkImgbuf *scaledBuf)
This method is called for the root buffer, when a scaled buffer removed.
Definition: fltkimgbuf.cc:184
dw::fltk::FltkImgbuf::setCMap
void setCMap(int *colors, int num_colors)
Definition: fltkimgbuf.cc:198
dw::fltk::FltkImgbuf::backscaledY
int backscaledY(int yScaled)
Definition: fltkimgbuf.cc:535
dw::fltk::FltkImgbuf::draw
void draw(Fl_Widget *target, int xRoot, int yRoot, int x, int y, int width, int height)
Definition: fltkimgbuf.cc:546
dw::fltk::BEAUTIFUL_GAMMA
Definition: fltkimgbuf.cc:37
DBG_OBJ_CREATE
#define DBG_OBJ_CREATE(klass)
Definition: debug.hh:175
MSG
#define MSG(...)
Definition: bookmarks.c:45
dw::fltk::FltkImgbuf::scaleRow
void scaleRow(int row, const core::byte *data)
Definition: fltkimgbuf.cc:202
dw::fltk::FltkImgbuf::height
int height
Definition: fltkimgbuf.hh:26
dw::fltk::FltkImgbuf::unref
void unref()
Definition: fltkimgbuf.cc:485
IMAGE_MAX_AREA
#define IMAGE_MAX_AREA
Definition: fltkimgbuf.cc:27
dw::fltk::FltkImgbuf::copiedRows
lout::misc::BitSet * copiedRows
Definition: fltkimgbuf.hh:37
dw::fltk::FltkImgbuf::getRootWidth
int getRootWidth()
Definition: fltkimgbuf.cc:433
lout::container::typed::Iterator::hasNext
bool hasNext()
Definition: container.hh:369
lout::misc::BitSet::clear
void clear()
Definition: misc.cc:180
dw::core::Imgbuf::getScaledBuf
virtual Imgbuf * getScaledBuf(int width, int height)=0
dw::core::Rectangle::x
int x
Definition: types.hh:72
lout::misc::BitSet
A bit set, which automatically reallocates when needed.
Definition: misc.hh:527
MAX_WIDTH
#define MAX_WIDTH
Definition: fltkimgbuf.cc:29
dw::fltk::FltkImgbuf
Definition: fltkimgbuf.hh:11
lout::container::typed::Vector
Typed version of container::untyped::Vector.
Definition: container.hh:399
dw::fltk::BEAUTIFUL
Definition: fltkimgbuf.cc:37
dw::fltk::FltkImgbuf::freeall
static void freeall()
Definition: fltkimgbuf.cc:72
lout::misc::max
T max(T a, T b)
Definition: misc.hh:20
DBG_OBJ_ASSOC_CHILD
#define DBG_OBJ_ASSOC_CHILD(child)
Definition: debug.hh:179
dw::fltk::FltkImgbuf::width
int width
Definition: fltkimgbuf.hh:26
lout::misc::min
T min(T a, T b)
Definition: misc.hh:19
dw::fltk::FltkImgbuf::init
void init(Type type, int width, int height, double gamma, FltkImgbuf *root)
Definition: fltkimgbuf.cc:96
dw::fltk::ScaleMode
ScaleMode
Definition: fltkimgbuf.cc:37
lout::container::typed::Iterator
Typed version of container::untyped::Iterator.
Definition: container.hh:352
dw::fltk::FltkImgbuf::setDeleteOnUnref
void setDeleteOnUnref(bool deleteOnUnref)
Definition: fltkimgbuf.cc:515
dw::fltk::FltkImgbuf::ref
void ref()
Definition: fltkimgbuf.cc:474
dw::fltk::FltkImgbuf::scaleBuffer
static void scaleBuffer(const core::byte *src, int srcWidth, int srcHeight, core::byte *dest, int destWidth, int destHeight, int bpp, double gamma)
Definition: fltkimgbuf.cc:290
dw::fltk::FltkImgbuf::gammaCorrectionTables
static lout::container::typed::Vector< GammaCorrectionTable > * gammaCorrectionTables
Definition: fltkimgbuf.hh:40
dw::fltk::FltkImgbuf::findGammaCorrectionTable
static uchar * findGammaCorrectionTable(double gamma)
Definition: fltkimgbuf.cc:43
dw::fltk::FltkImgbuf::FltkImgbuf
FltkImgbuf(Type type, int width, int height, double gamma, FltkImgbuf *root)
Definition: fltkimgbuf.cc:87
dw::core::Rectangle::height
int height
Definition: types.hh:75
dw::fltk::FltkImgbuf::~FltkImgbuf
~FltkImgbuf()
Definition: fltkimgbuf.cc:164
lout::misc::BitSet::get
bool get(int i) const
Definition: misc.cc:154
dw::fltk::FltkImgbuf::lastReference
bool lastReference()
Definition: fltkimgbuf.cc:509
dw::fltk::FltkImgbuf::copyTo
void copyTo(Imgbuf *dest, int xDestRoot, int yDestRoot, int xSrc, int ySrc, int widthSrc, int heightSrc)
Definition: fltkimgbuf.cc:448
dw::core::Imgbuf
The platform independent interface for image buffers.
Definition: imgbuf.hh:161
dw::fltk::FltkImgbuf::getScaledBuf
core::Imgbuf * getScaledBuf(int width, int height)
Definition: fltkimgbuf.cc:357
dw::fltk::FltkImgbuf::copyRow
void copyRow(int row, const core::byte *data)
Definition: fltkimgbuf.cc:329
dw::core::Rectangle
dw::core::Shape implemtation for simple rectangles.
Definition: types.hh:69
dw::fltk::FltkImgbuf::excessiveImageDimensions
static bool excessiveImageDimensions(int width, int height)
Definition: fltkimgbuf.cc:66
lout::container::typed::List
Typed version of container::untyped::List.
Definition: container.hh:425
dw::core::Imgbuf::Type
Type
Definition: imgbuf.hh:164
dw::fltk::scaleMode
enum dw::fltk::ScaleMode scaleMode
dw::fltk::FltkImgbuf::GammaCorrectionTable::gamma
double gamma
Definition: fltkimgbuf.hh:17
dw::fltk::FltkImgbuf::getRootHeight
int getRootHeight()
Definition: fltkimgbuf.cc:438
lout::misc::init
void init(int argc, char *argv[])
Definition: misc.cc:35
dw::fltk::SIMPLE
Definition: fltkimgbuf.cc:37
dw::fltk::FltkImgbuf::getRowArea
void getRowArea(int row, dw::core::Rectangle *area)
Definition: fltkimgbuf.cc:403
dw::fltk::FltkImgbuf::GammaCorrectionTable
Definition: fltkimgbuf.hh:14
_MSG
#define _MSG(...)
Definition: bookmarks.c:44
dw::core::byte
unsigned char byte
Definition: core.hh:22
dw::fltk::FltkImgbuf::newScan
void newScan()
Definition: fltkimgbuf.cc:347
MAX_HEIGHT
#define MAX_HEIGHT
Definition: fltkimgbuf.cc:30
dw::fltk::FltkImgbuf::scaleRowBeautiful
void scaleRowBeautiful(int row, const core::byte *data)
Definition: fltkimgbuf.cc:236
dw::fltk::FltkImgbuf::isReferred
bool isReferred()
Definition: fltkimgbuf.cc:521
dw
Dw is in this namespace, or sub namespaces of this one.
Definition: alignedtextblock.cc:26
dw::fltk::FltkImgbuf::rawdata
uchar * rawdata
Definition: fltkimgbuf.hh:32
dw::fltk::FltkImgbuf::scaledY
int scaledY(int ySrc)
Definition: fltkimgbuf.cc:528
DBG_OBJ_SET_NUM
#define DBG_OBJ_SET_NUM(var, val)
Definition: debug.hh:181
dw::fltk::FltkImgbuf::GammaCorrectionTable::map
uchar map[256]
Definition: fltkimgbuf.hh:18
lout::container::typed
This namespace provides thin wrappers, implemented as C++ templates, to gain type-safety.
Definition: container.hh:345
dw::core::Rectangle::width
int width
Definition: types.hh:74
dw::core::Rectangle::y
int y
Definition: types.hh:73