Image cache for the viewer. More...
Classes | |
struct | LineEnds |
Public Types | |
enum | StartType { START_PAUSED, START_NEVER, START_PLAYBACK, START_IF_NO_IMAGE, START_CONTEXT } |
Public Member Functions | |
void | preload (DD::Image::Hash viewer_hash) |
virtual void | read_from_cache (DD::Image::Hash viewer_hash, StartType what) |
virtual void | write_to_cache (DD::Image::Hash hash) |
void | deallocateAll () |
bool | lineDone (int y) const |
const DD::Image::Box & | get_roi () const |
Static Public Member Functions | |
static DD::Image::Hash | MakeFileHash (DD::Image::Hash hash, int scale, DD::Image::ChannelSet channels) |
static void | InitCache () |
static bool | BoxPresent (const DD::Image::Hash &hash, const DD::Image::Box &box, int downrez_y) |
Protected Member Functions | |
void | allocateLine (int y) |
void | deallocateLine (int y) |
virtual double | pixelAspect () const =0 |
virtual DD::Image::Box | bbox () const =0 |
virtual void | updateBBox (DD::Image::Box newBBox) |
virtual void | readFromCacheDone (bool failed, bool allDone, bool skippedStuff) |
virtual void | updateFrameRange (int first, int last) |
void | setFrameRange (int first, int last) |
Protected Attributes | |
AccountedVector< U32 * > | lineBuffers |
Array of line pointers. | |
AccountedVector< LineEnds > | lineEnds |
Array of left/right ends. | |
int | alloc_w |
int | alloc_h |
Size of image buffer. | |
int | width |
int | height |
Size we are using. | |
bool | one_block |
Indicates a single allocation of line data. | |
DD::Image::Box | roi |
BBox of area to calculate. | |
int | viewer_downrez_y |
Viewer downrez factor (integer of 1/yzoom) | |
int | processing_downrez_y |
Processing downrez factor. Either the same as viewer_downrez_y or 1, if we're in full frame mode (processing all scanlines regardless of zoom level) | |
bool | userRoiEnable |
True if user enabled roi. | |
DD::Image::Box | userRoi |
Roi selected by user. | |
bool | image_done_ |
All visible lines are up to date. | |
bool | look_in_cache |
False if we know there is nothing useful in cache file. | |
int | scale_ |
Size of each channel of a pixel in image buffer. | |
Static Protected Attributes | |
static int | sAllocFudge |
Image cache for the viewer.
void ViewerCache::preload | ( | DD::Image::Hash | viewer_hash | ) |
Read into the memory cache (but don't try and actually load lines out of this file)
References DD::Image::Image_Cache::mainCache().
|
virtual |
Update the viewer from the cache file. Turn on image_done_ if all the visible data has been updated.
References DD::Image::ImageCacheReadI::close(), height, image_done_, lineBuffers, lineEnds, look_in_cache, DD::Image::Image_Cache::mainCache(), one_block, DD::Image::Image_Cache::open(), processing_downrez_y, DD::Image::Box::r(), DD::Image::ImageCacheReadI::read(), DD::Image::Image_Cache::remove(), roi, scale_, DD::Image::ImageCacheReadI::seekRelative(), DD::Image::Box::t(), userRoi, userRoiEnable, DD::Image::Box::x(), and DD::Image::Box::y().
|
static |
Is the given box present in the memory cache for the viewer cache file identified by /hash/
Only lines required for the passed-in downrez will be considered.
References DD::Image::ImageCacheReadI::close(), DD::Image::Image_Cache::mainCache(), DD::Image::Image_Cache::open(), and DD::Image::ImageCacheReadI::uniqueID().
©2021 The Foundry Visionmongers, Ltd. All Rights Reserved. |