Public Member Functions | |
bool | beginSet (const CudaImage< T > &img, rutz::mutex_lock_class *l) |
Acquire an exclusive lock on the mutex so that we can set a new pyramid for the given image. | |
void | endSet (const CudaImage< T > &img, const CudaImageSet< T > &pyr, rutz::mutex_lock_class *l) |
Install a new image/pyramid pair using a lock previous acquired from beginSet(). | |
const CudaImageSet< T > * | get (const CudaImage< T > &img) const |
Returns a pointer to the cached pyramid for img, or null if there is no such cached pyramid. |
Definition at line 55 of file CudaPyramidCache.H.
bool CudaPyramidCache< T >::Item::beginSet | ( | const CudaImage< T > & | img, | |
rutz::mutex_lock_class * | l | |||
) | [inline] |
Acquire an exclusive lock on the mutex so that we can set a new pyramid for the given image.
If we already have a pyramid for the given image, then the return value here will be false, indicating that there is no need to set the pyramid again.
If we do need a new pyramid for the given image, then the return value will be true and the Lock will be filled in with lock information that must be passed back to endSet().
Typical usage would look like this:
rutz::mutex_lock_class lock; if (cache->gaussian5.beginSet(img, &lock)) { ImageSet<float> pyr = doSomethingToComputePyramid(img); cache->gaussian5.endSet(img, pyr, &lock); }
Definition at line 70 of file CudaPyramidCache.C.
References ASSERT.
void CudaPyramidCache< T >::Item::endSet | ( | const CudaImage< T > & | img, | |
const CudaImageSet< T > & | pyr, | |||
rutz::mutex_lock_class * | l | |||
) | [inline] |
Install a new image/pyramid pair using a lock previous acquired from beginSet().
Definition at line 91 of file CudaPyramidCache.C.
References ASSERT.
const CudaImageSet< T > * CudaPyramidCache< T >::Item::get | ( | const CudaImage< T > & | img | ) | const [inline] |
Returns a pointer to the cached pyramid for img, or null if there is no such cached pyramid.
Definition at line 111 of file CudaPyramidCache.C.