HDK
|
Thread-safe convenience class to make reading DSM pixels easy. More...
#include <IMG_DeepShadow.h>
Public Member Functions | |
IMG_DeepPixelReader () | |
IMG_DeepPixelReader (const IMG_DeepShadow &dsm) | |
~IMG_DeepPixelReader () | |
bool | isValid () const |
void | init (const IMG_DeepShadow &dsm) |
void | clear () |
bool | open (int x, int y) |
Open a pixel for reading. More... | |
void | close () |
int | getDepth () const |
Returns the number of z-records. More... | |
const float * | getData (const IMG_DeepShadowChannel &chp, int depth_index) |
Return the data for the channel at the given depth index. More... | |
bool | readPixel (int x, int y, PXL_DeepSampleList &pixel) const |
void | composite (const IMG_DeepShadowChannel &pz, const IMG_DeepShadowChannel &of, bool force=false) |
void | uncomposite (const IMG_DeepShadowChannel &pz, const IMG_DeepShadowChannel &of, bool force=false) |
Thread-safe convenience class to make reading DSM pixels easy.
This is a thread-safe convenience class to wrap around reading pixels which ensures that the pixel is closed properly.
The class should be used as follows:
Definition at line 60 of file IMG_DeepShadow.h.
|
inline |
Definition at line 64 of file IMG_DeepShadow.h.
|
inline |
Definition at line 67 of file IMG_DeepShadow.h.
|
inline |
Definition at line 72 of file IMG_DeepShadow.h.
void IMG_DeepPixelReader::clear | ( | ) |
void IMG_DeepPixelReader::close | ( | ) |
Close the pixel. This is called automatically on destruction. However, if an IMG_DeepPixelReader and IMG_DeepShadow are created in the same scope, the IMG_DeepPixelReader may hold onto references (and cause crashing errors). Calling close() manually is a safe thing to do.
void IMG_DeepPixelReader::composite | ( | const IMG_DeepShadowChannel & | pz, |
const IMG_DeepShadowChannel & | of, | ||
bool | force = false |
||
) |
After opening, you can call either of these methods to ensure that the data is in the correct form for your application. "composited" pixels will have the data accumulated over from front to back. "uncomposited" pixels will have the raw data for each z-record.
If the force flag is false, then the state of the file will be used to determine whether the deep records need to be processed or not.
These methods should be called after the pixel has been opened.
const float* IMG_DeepPixelReader::getData | ( | const IMG_DeepShadowChannel & | chp, |
int | depth_index | ||
) |
Return the data for the channel at the given depth index.
int IMG_DeepPixelReader::getDepth | ( | ) | const |
Returns the number of z-records.
void IMG_DeepPixelReader::init | ( | const IMG_DeepShadow & | dsm | ) |
|
inline |
Definition at line 80 of file IMG_DeepShadow.h.
Open a pixel for reading.
bool IMG_DeepPixelReader::readPixel | ( | int | x, |
int | y, | ||
PXL_DeepSampleList & | pixel | ||
) | const |
Alternately, just fill a PXL_DeepSampleList with the appropriate data. This manages zback, coverage, flags and other special deep channels.
void IMG_DeepPixelReader::uncomposite | ( | const IMG_DeepShadowChannel & | pz, |
const IMG_DeepShadowChannel & | of, | ||
bool | force = false |
||
) |