Dillo
|
#include <fltkimgbuf.hh>
Classes | |
class | GammaCorrectionTable |
Public Member Functions | |
FltkImgbuf (Type type, int width, int height, double gamma) | |
void | setCMap (int *colors, int num_colors) |
void | scaleRow (int row, const core::byte *data) |
void | scaleRowSimple (int row, const core::byte *data) |
void | scaleRowBeautiful (int row, const core::byte *data) |
void | newScan () |
void | copyRow (int row, const core::byte *data) |
core::Imgbuf * | getScaledBuf (int width, int height) |
void | getRowArea (int row, dw::core::Rectangle *area) |
int | getRootWidth () |
int | getRootHeight () |
core::Imgbuf * | createSimilarBuf (int width, int height) |
void | copyTo (Imgbuf *dest, int xDestRoot, int yDestRoot, int xSrc, int ySrc, int widthSrc, int heightSrc) |
void | ref () |
void | unref () |
bool | lastReference () |
void | setDeleteOnUnref (bool deleteOnUnref) |
bool | isReferred () |
void | draw (Fl_Widget *target, int xRoot, int yRoot, int x, int y, int width, int height) |
Public Member Functions inherited from dw::core::Imgbuf | |
Imgbuf () | |
~Imgbuf () | |
virtual void | copyTo (Imgbuf *dest, int xDestRoot, int yDestRoot, int xSrc, int ySrc, int widthSrc, int heightSrc)=0 |
Public Member Functions inherited from lout::object::Object | |
virtual | ~Object () |
The destructor is defined as virtual (but not abstract), so that destruction of Object's works properly. More... | |
virtual bool | equals (Object *other) |
Returns, whether two objects are equal. More... | |
virtual int | hashValue () |
Return a hash value for the object. More... | |
virtual Object * | clone () |
Return an exact copy of the object. More... | |
virtual void | intoStringBuffer (misc::StringBuffer *sb) |
Store a textual representation of the object in a misc::StringBuffer. More... | |
const char * | toString () |
Use object::Object::intoStringBuffer to return a textual representation of the object. More... | |
virtual size_t | sizeOf () |
Return the number of bytes, this object totally uses. More... | |
Public Member Functions inherited from lout::signal::ObservedObject | |
virtual | ~ObservedObject () |
void | connectDeletion (DeletionReceiver *receiver) |
Static Public Member Functions | |
static void | freeall () |
static void | scaleBuffer (const core::byte *src, int srcWidth, int srcHeight, core::byte *dest, int destWidth, int destHeight, int bpp, double gamma) |
Protected Member Functions | |
~FltkImgbuf () | |
Private Member Functions | |
FltkImgbuf (Type type, int width, int height, double gamma, FltkImgbuf *root) | |
void | init (Type type, int width, int height, double gamma, FltkImgbuf *root) |
int | scaledY (int ySrc) |
int | backscaledY (int yScaled) |
int | isRoot () |
void | detachScaledBuf (FltkImgbuf *scaledBuf) |
This method is called for the root buffer, when a scaled buffer removed. More... | |
Static Private Member Functions | |
static uchar * | findGammaCorrectionTable (double gamma) |
static bool | excessiveImageDimensions (int width, int height) |
Private Attributes | |
FltkImgbuf * | root |
int | refCount |
bool | deleteOnUnref |
lout::container::typed::List < FltkImgbuf > * | scaledBuffers |
int | width |
int | height |
Type | type |
double | gamma |
int | bpp |
uchar * | rawdata |
lout::misc::BitSet * | copiedRows |
Static Private Attributes | |
static lout::container::typed::Vector < GammaCorrectionTable > * | gammaCorrectionTables = new Vector <FltkImgbuf::GammaCorrectionTable> (true, 2) |
Additional Inherited Members | |
Public Types inherited from dw::core::Imgbuf | |
enum | Type { RGB, RGBA, GRAY, INDEXED, INDEXED_ALPHA } |
|
private |
References DBG_OBJ_CREATE, and lout::misc::init().
|
protected |
References DBG_OBJ_DELETE.
dw::fltk::FltkImgbuf::FltkImgbuf | ( | Type | type, |
int | width, | ||
int | height, | ||
double | gamma | ||
) |
References DBG_OBJ_CREATE, and lout::misc::init().
|
private |
|
virtual |
Implements dw::core::Imgbuf.
References DBG_IF_RTFL, DBG_OBJ_SET_SYM, lout::misc::StringBuffer::getChars(), lout::container::typed::Iterator< T >::hasNext(), and scaleRow().
void dw::fltk::FltkImgbuf::copyTo | ( | Imgbuf * | dest, |
int | xDestRoot, | ||
int | yDestRoot, | ||
int | xSrc, | ||
int | ySrc, | ||
int | widthSrc, | ||
int | heightSrc | ||
) |
References bpp, height, lout::misc::min(), rawdata, and width.
|
virtual |
Creates an image buffer with same parameters (type, gamma etc.) except size.
Implements dw::core::Imgbuf.
|
private |
This method is called for the root buffer, when a scaled buffer removed.
void dw::fltk::FltkImgbuf::draw | ( | Fl_Widget * | target, |
int | xRoot, | ||
int | yRoot, | ||
int | x, | ||
int | y, | ||
int | width, | ||
int | height | ||
) |
|
staticprivate |
References IMAGE_MAX_AREA.
|
staticprivate |
|
static |
Referenced by dw::fltk::freeall().
|
virtual |
Implements dw::core::Imgbuf.
|
virtual |
Implements dw::core::Imgbuf.
|
virtual |
Implements dw::core::Imgbuf.
References dw::core::Rectangle::height, dw::core::Rectangle::width, dw::core::Rectangle::x, and dw::core::Rectangle::y.
|
virtual |
Implements dw::core::Imgbuf.
References DBG_OBJ_ASSOC_CHILD, dw::core::Imgbuf::getScaledBuf(), lout::container::typed::Iterator< T >::hasNext(), height, MAX_HEIGHT, MAX_WIDTH, ref(), and width.
|
private |
|
virtual |
Implements dw::core::Imgbuf.
|
inlineprivate |
|
virtual |
Implements dw::core::Imgbuf.
|
virtual |
|
virtual |
Implements dw::core::Imgbuf.
Referenced by getScaledBuf().
|
inlinestatic |
General method to scale an image buffer. Used to scale single lines in scaleRowBeautiful.
The algorithm is rather simple. If the scaled buffer is smaller (both width and height) than the original buffer, each pixel in the scaled buffer is assigned a rectangle of pixels in the original buffer; the resulting pixel value (red, green, blue) is simply the average of all pixel values. This is pretty fast and leads to rather good results.
Nothing special (like interpolation) is done when scaling up.
If scaleMode is set to BEAUTIFUL_GAMMA, gamma correction is considered, see http://www.4p8.com/eric.brasseur/gamma.html.
TODO Could be optimized as in scaleRowSimple: when the destination image is larger, calculate only one row/column, and copy it to the other rows/columns.
References dw::fltk::BEAUTIFUL_GAMMA, lout::misc::max(), and dw::fltk::scaleMode.
|
private |
|
inline |
References dw::fltk::scaleMode, and dw::fltk::SIMPLE.
Referenced by copyRow().
|
inline |
References DBG_IF_RTFL, DBG_OBJ_SET_SYM, and lout::misc::StringBuffer::getChars().
|
inline |
References DBG_IF_RTFL, DBG_OBJ_SET_SYM, and lout::misc::StringBuffer::getChars().
|
virtual |
Implements dw::core::Imgbuf.
|
virtual |
Implements dw::core::Imgbuf.
|
virtual |
Implements dw::core::Imgbuf.
|
private |
|
private |
|
private |
|
staticprivate |
|
private |
Referenced by copyTo(), getScaledBuf(), and init().
|
private |
|
private |
|
private |
|
private |
|
private |
Referenced by copyTo(), getScaledBuf(), and init().