diff options
author | Sebastian Geerken <devnull@localhost> | 2013-06-17 12:35:29 +0200 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2013-06-17 12:35:29 +0200 |
commit | 3747d005fdb2832edce3713dfec41f16ce494a60 (patch) | |
tree | 7caa13cd53c23a6666b34fcf6eed0cfbc41c6397 /dw/fltkimgbuf.hh | |
parent | 0653ceedf59ca312563a1afe6a541c55138fb6c4 (diff) |
Considering gamma correction when scaling images.
Diffstat (limited to 'dw/fltkimgbuf.hh')
-rw-r--r-- | dw/fltkimgbuf.hh | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/dw/fltkimgbuf.hh b/dw/fltkimgbuf.hh index f7455807..81419494 100644 --- a/dw/fltkimgbuf.hh +++ b/dw/fltkimgbuf.hh @@ -11,6 +11,13 @@ namespace fltk { class FltkImgbuf: public core::Imgbuf { private: + class GammaCorrectionTable: public lout::object::Object + { + public: + double gamma; + uchar map[256]; + }; + FltkImgbuf *root; int refCount; bool deleteOnUnref; @@ -29,6 +36,12 @@ private: // the image buffer. lout::misc::BitSet *copiedRows; + static lout::container::typed::Vector <GammaCorrectionTable> + *gammaCorrectionTables; + + static uchar *findGammaCorrectionTable (double gamma); + static bool excessiveImageDimensions (int width, int height); + FltkImgbuf (Type type, int width, int height, double gamma, FltkImgbuf *root); void init (Type type, int width, int height, double gamma, FltkImgbuf *root); @@ -49,7 +62,8 @@ public: inline void scaleRowBeautiful (int row, const core::byte *data); inline static void scaleBuffer (const core::byte *src, int srcWidth, int srcHeight, core::byte *dest, - int destWidth, int destHeight, int bpp); + int destWidth, int destHeight, int bpp, + double gamma); void newScan (); void copyRow (int row, const core::byte *data); |