#include <IMG_DeepShadow.h>
Public Member Functions | |
| IMG_DeepPixelReader (IMG_DeepShadow &dsm) | |
| ~IMG_DeepPixelReader () | |
| bool | open (int x, int y) |
| Open a pixel for reading. | |
| void | close () |
| int | getDepth () const |
| Returns the number of z-records. | |
| const fpreal * | getData (const IMG_DeepShadowChannel &chp, int depth_index) |
| Return the data for the channel at the given depth index. | |
| 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) |
This is a thread-safe convenience class to wrap around reading pixels which ensures that the pixel is closed properly.
IMG_DeepPixelReader pixel(dsm); for (x, y) in raster { if (pixel.open(x, y)) { for (i = 0; i < pixel.getDepth(); i++) data = pixel.getData(chp, i); } }
Definition at line 66 of file IMG_DeepShadow.h.
| IMG_DeepPixelReader::IMG_DeepPixelReader | ( | IMG_DeepShadow & | dsm | ) |
| IMG_DeepPixelReader::~IMG_DeepPixelReader | ( | ) |
| 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 fpreal* IMG_DeepPixelReader::getData | ( | const IMG_DeepShadowChannel & | chp, | |
| int | depth_index | |||
| ) |
| int IMG_DeepPixelReader::getDepth | ( | ) | const |
| bool IMG_DeepPixelReader::open | ( | int | x, | |
| int | y | |||
| ) |
| void IMG_DeepPixelReader::uncomposite | ( | const IMG_DeepShadowChannel & | pz, | |
| const IMG_DeepShadowChannel & | of, | |||
| bool | force = false | |||
| ) |
1.5.9