Blender V2.61 - r43446
|
base class for image filters More...
#include <ImageBase.h>
Public Member Functions | |
ImageBase (bool staticSrc=false) | |
constructor | |
virtual | ~ImageBase (void) |
destructor | |
virtual bool | release (void) |
release contained objects, if returns true, object should be deleted | |
bool | isImageAvailable (void) |
is an image available | |
unsigned int * | getImage (unsigned int texId=0, double timestamp=-1.0) |
get image | |
short * | getSize (void) |
get image size | |
unsigned long | getBuffSize (void) |
get image buffer size | |
virtual void | refresh (void) |
refresh image - invalidate its current content | |
bool | getScale (void) |
get scale | |
void | setScale (bool scale) |
set scale | |
bool | getFlip (void) |
get vertical flip | |
void | setFlip (bool flip) |
set vertical flip | |
PyImage * | getSource (const char *id) |
get source object | |
bool | setSource (const char *id, PyImage *source) |
set source object, return true, if source was set | |
PyFilter * | getFilter (void) |
get pixel filter | |
void | setFilter (PyFilter *filt) |
set pixel filter | |
Static Public Member Functions | |
static short | calcSize (short size) |
calculate size (nearest power of 2) | |
Public Attributes | |
int | m_exports |
number of buffer pointing to m_image, public because not handled by this class | |
Protected Member Functions | |
void | init (short width, short height) |
initialize image data | |
ImageSourceList::iterator | findSource (const char *id) |
find source | |
virtual ImageSource * | newSource (const char *id) |
create new source | |
bool | checkSourceSizes (void) |
check source sizes | |
virtual void | calcImage (unsigned int texId, double ts) |
calculate image from sources and set its availability | |
bool | loopDetect (ImageBase *img) |
perform loop detection | |
template<class FLT , class SRC > | |
void | convImage (FLT &filter, SRC srcBuff, short *srcSize) |
template for image conversion | |
template<class F , class SRC > | |
void | filterImage (F &filt, SRC srcBuff, short *srcSize) |
Protected Attributes | |
unsigned int * | m_image |
image buffer | |
unsigned int | m_imgSize |
image buffer size | |
short | m_size [2] |
image size | |
bool | m_avail |
image is available | |
bool | m_scale |
scale image to power 2 sizes | |
bool | m_scaleChange |
scale was changed | |
bool | m_flip |
flip image vertically | |
ImageSourceList | m_sources |
source image list | |
bool | m_staticSources |
flag for disabling addition and deletion of sources | |
PyFilter * | m_pyfilter |
pixel filter |
base class for image filters
Definition at line 50 of file ImageBase.h.
ImageBase::ImageBase | ( | bool | staticSrc = false | ) |
ImageBase::~ImageBase | ( | void | ) | [virtual] |
virtual void ImageBase::calcImage | ( | unsigned int | texId, |
double | ts | ||
) | [inline, protected, virtual] |
calculate image from sources and set its availability
Reimplemented in ImageMix, ImageRender, and ImageViewport.
Definition at line 136 of file ImageBase.h.
Referenced by getImage().
short ImageBase::calcSize | ( | short | size | ) | [static] |
calculate size (nearest power of 2)
Definition at line 261 of file ImageBase.cpp.
References size().
Referenced by ImageViewport::calcImage(), init(), ImageViewport::setWhole(), and Texture_refresh().
bool ImageBase::checkSourceSizes | ( | void | ) | [protected] |
check source sizes
Definition at line 233 of file ImageBase.cpp.
References m_sources, and NULL.
Referenced by ImageMix::calcImage().
void ImageBase::convImage | ( | FLT & | filter, |
SRC | srcBuff, | ||
short * | srcSize | ||
) | [inline, protected] |
template for image conversion
Definition at line 142 of file ImageBase.h.
References m_flip, m_image, and m_size.
Referenced by filterImage(), and ImageBuff::load().
void ImageBase::filterImage | ( | F & | filt, |
SRC | srcBuff, | ||
short * | srcSize | ||
) | [inline, protected] |
Definition at line 223 of file ImageBase.h.
References convImage(), FilterBase::findFirst(), m_avail, PyFilter::m_filter, m_pyfilter, NULL, and FilterBase::setPrevious().
Referenced by ImageViewport::calcImage(), ImageMix::calcImage(), and VideoBase::process().
ImageSourceList::iterator ImageBase::findSource | ( | const char * | id | ) | [protected] |
find source
Definition at line 220 of file ImageBase.cpp.
References m_sources.
Referenced by getSource(), ImageMix::getWeight(), setSource(), and ImageMix::setWeight().
unsigned long ImageBase::getBuffSize | ( | void | ) | [inline] |
PyFilter* ImageBase::getFilter | ( | void | ) | [inline] |
bool ImageBase::getFlip | ( | void | ) | [inline] |
unsigned int * ImageBase::getImage | ( | unsigned int | texId = 0 , |
double | timestamp = -1.0 |
||
) |
get image
Definition at line 86 of file ImageBase.cpp.
References calcImage(), getSize(), init(), m_avail, m_image, m_sources, and NULL.
Referenced by ImageSource::getImage().
bool ImageBase::getScale | ( | void | ) | [inline] |
short* ImageBase::getSize | ( | void | ) | [inline] |
get image size
Definition at line 66 of file ImageBase.h.
References m_size.
Referenced by ImageMix::calcImage(), getImage(), and ImageSource::getSize().
PyImage * ImageBase::getSource | ( | const char * | id | ) |
get source object
Definition at line 121 of file ImageBase.cpp.
References findSource(), m_sources, and NULL.
void ImageBase::init | ( | short | width, |
short | height | ||
) | [protected] |
initialize image data
Reimplemented in VideoBase.
Definition at line 183 of file ImageBase.cpp.
References calcSize(), m_exports, m_image, m_imgSize, m_scale, m_scaleChange, m_size, S_OK, and THRWEXCP.
Referenced by ImageViewport::calcImage(), ImageBuff::clear(), getImage(), ImageBuff::load(), ImageViewport::setCaptureSize(), and ImageViewport::setWhole().
bool ImageBase::isImageAvailable | ( | void | ) | [inline] |
bool ImageBase::loopDetect | ( | ImageBase * | img | ) | [protected] |
perform loop detection
Definition at line 273 of file ImageBase.cpp.
References m_sources, and NULL.
Referenced by setSource().
virtual ImageSource* ImageBase::newSource | ( | const char * | id | ) | [inline, protected, virtual] |
create new source
Reimplemented in ImageMix.
Definition at line 130 of file ImageBase.h.
References NULL.
Referenced by setSource().
void ImageBase::refresh | ( | void | ) | [virtual] |
refresh image - invalidate its current content
Reimplemented in ImageBuff.
Definition at line 110 of file ImageBase.cpp.
References m_avail, and m_sources.
Referenced by ImageSource::refresh(), and Video_refresh().
bool ImageBase::release | ( | void | ) | [virtual] |
release contained objects, if returns true, object should be deleted
Definition at line 69 of file ImageBase.cpp.
References m_pyfilter, m_sources, and NULL.
void ImageBase::setFilter | ( | PyFilter * | filt | ) |
void ImageBase::setFlip | ( | bool | flip | ) | [inline] |
void ImageBase::setScale | ( | bool | scale | ) | [inline] |
set scale
Definition at line 76 of file ImageBase.h.
References m_scale, and m_scaleChange.
Referenced by ImageBuff_init().
bool ImageBase::setSource | ( | const char * | id, |
PyImage * | source | ||
) |
set source object, return true, if source was set
Definition at line 131 of file ImageBase.cpp.
References findSource(), loopDetect(), PyImage::m_image, m_sources, m_staticSources, newSource(), NULL, and ImageSource::setSource().
bool ImageBase::m_avail [protected] |
image is available
Definition at line 106 of file ImageBase.h.
Referenced by ImageViewport::calcImage(), ImageRender::calcImage(), ImageBuff::clear(), filterImage(), getImage(), isImageAvailable(), ImageBuff::load(), VideoBase::process(), and refresh().
number of buffer pointing to m_image, public because not handled by this class
Definition at line 96 of file ImageBase.h.
Referenced by ImageBase(), and init().
bool ImageBase::m_flip [protected] |
flip image vertically
Definition at line 113 of file ImageBase.h.
Referenced by ImageViewport::calcImage(), convImage(), getFlip(), and setFlip().
unsigned int* ImageBase::m_image [protected] |
image buffer
Definition at line 100 of file ImageBase.h.
Referenced by ImageViewport::calcImage(), ImageBuff::clear(), convImage(), getImage(), Image_init(), ImageMirror_init(), ImageRender_init(), init(), ImageBuff::plot(), VideoBase::process(), and ~ImageBase().
unsigned int ImageBase::m_imgSize [protected] |
PyFilter* ImageBase::m_pyfilter [protected] |
pixel filter
Definition at line 121 of file ImageBase.h.
Referenced by ImageViewport::calcImage(), filterImage(), getFilter(), ImageBuff::load(), release(), and setFilter().
bool ImageBase::m_scale [protected] |
scale image to power 2 sizes
Definition at line 109 of file ImageBase.h.
Referenced by getScale(), init(), and setScale().
bool ImageBase::m_scaleChange [protected] |
scale was changed
Definition at line 111 of file ImageBase.h.
Referenced by ImageViewport::calcImage(), init(), VideoBase::process(), and setScale().
short ImageBase::m_size[2] [protected] |
image size
Definition at line 104 of file ImageBase.h.
Referenced by ImageViewport::calcImage(), ImageBuff::clear(), convImage(), getBuffSize(), getSize(), ImageBase(), init(), and ImageBuff::plot().
ImageSourceList ImageBase::m_sources [protected] |
source image list
Definition at line 116 of file ImageBase.h.
Referenced by ImageMix::calcImage(), checkSourceSizes(), findSource(), getImage(), getSource(), ImageMix::getWeight(), loopDetect(), refresh(), release(), setSource(), and ImageMix::setWeight().
bool ImageBase::m_staticSources [protected] |
flag for disabling addition and deletion of sources
Definition at line 118 of file ImageBase.h.
Referenced by setSource().