#include <IMG_DeepShadow.h>
Public Member Functions | |
| IMG_DeepShadow () | |
| virtual | ~IMG_DeepShadow () |
| void | setOption (const char *option, const char *value) |
| void | setOptions (const UT_Options &options) |
| void | printArgs (UT_WorkBuffer &wbuf) |
| Print the current values of the file options into the work buffer. | |
| const char * | getDescription () |
| bool | addExtraChannel (const IMG_DeepShadowChannel &def, const UT_Options *options=0) |
| bool | open (const char *name, int xres, int yres) |
| bool | pixelStart (int x, int y) |
| bool | pixelWrite (float z, const float *data, int vsize) |
| bool | pixelWriteOrdered (float z, const float *data, int vsize) |
| bool | pixelClose () |
| Close a pixel and flush the pixel's data to file. | |
| bool | close () |
| Close the deep shadow map and write it to disk. | |
| UT_Options * | getTBFOptions () |
| bool | open (const char *name) |
| Open a deep shadow map for reading. | |
| void | resolution (int &xres, int &yres) |
| Get the resolution of the deep shadow map. | |
| int | getChannelCount () const |
| Get the number of channels in the DSM. | |
| const IMG_DeepShadowChannel * | getChannel (int i) const |
| Get a channel definition. | |
| float SYS_DEPRECATED * | pixelRead (int x, int y, float &z, int &vsize) |
| IMG_DepthInterp | depthInterp () |
Friends | |
| class | IMG_DeepPixelReader |
| class | img_DeepShadow |
This class provides a creation interface for deep shadow maps. The class can be used as follows:
setOption(...); setOption(...); ... open(fname, xres, yres); foreach pixel loop pixelStart(pixel); foreach record pixelWrite(record); end loop pixelClose() end loop close();
To read from an existing deep shadow map, the class can be used as follows:
IMG_DeepShadow dsm; IMG_DeepPixelReader pixel; dsm.open(fname); foreach (x,y) in raster: pixel.open(x, y) for (i = 0; i < pixel.getDepth(); i++) pixel.getData(chp, i); close();
Definition at line 209 of file IMG_DeepShadow.h.
| IMG_DeepShadow::IMG_DeepShadow | ( | ) |
| virtual IMG_DeepShadow::~IMG_DeepShadow | ( | ) | [virtual] |
| bool IMG_DeepShadow::addExtraChannel | ( | const IMG_DeepShadowChannel & | def, | |
| const UT_Options * | options = 0 | |||
| ) |
Add an extra channel to be stored along with Of and Pz. Any number of channels may be added (though the file size will increase accordingly).
| bool IMG_DeepShadow::close | ( | ) |
| IMG_DepthInterp IMG_DeepShadow::depthInterp | ( | ) |
| const IMG_DeepShadowChannel* IMG_DeepShadow::getChannel | ( | int | i | ) | const |
| int IMG_DeepShadow::getChannelCount | ( | ) | const |
| const char* IMG_DeepShadow::getDescription | ( | ) |
Get a description of the available options that can be provided in setOption()
| UT_Options* IMG_DeepShadow::getTBFOptions | ( | ) |
Get UT_Option structure from TBF. These options are stored with the file and may be queried in VEX using teximport().
| bool IMG_DeepShadow::open | ( | const char * | name | ) |
Open a deep shadow map for reading.
| bool IMG_DeepShadow::open | ( | const char * | name, | |
| int | xres, | |||
| int | yres | |||
| ) |
Open a deep shadow map for writing. This method will return false if there were errors opening the texture.
| bool IMG_DeepShadow::pixelClose | ( | ) |
| float SYS_DEPRECATED* IMG_DeepShadow::pixelRead | ( | int | x, | |
| int | y, | |||
| float & | z, | |||
| int & | vsize | |||
| ) |
Get the raw data values for a pixel, in the order that they appear in the file. This method should be called repeatedly for each pixel until a 0 is returned, indicating that all records have been read for that pixel. Reading pixels in a regular order will be more efficient than reading them in a random order.
| bool IMG_DeepShadow::pixelStart | ( | int | x, | |
| int | y | |||
| ) |
Start writing data to a pixel. This method must be called exactly once for each pixel. Starting pixels in a regular order will be more efficient than writing them in a random order, but is not required.
| bool IMG_DeepShadow::pixelWrite | ( | float | z, | |
| const float * | data, | |||
| int | vsize | |||
| ) |
Write data to the currently open pixel. This method inserts an unordered data record with the given z-value and data into the current pixel. vsize is the number of floats that are contained in the data array.
The first 3 floats of the data array must be the opacity (RGB). Any extra channel data follows this according to the float_offset associated with the channel. This data may be quantized to a single float depending on the options.
If vsize doesn't contain a full record, then this method will fail. vsize must be greater or equal to 3 (depending on extra channels)
Currently, mantra will always interpret the data as a rgb opacity triple.
| bool IMG_DeepShadow::pixelWriteOrdered | ( | float | z, | |
| const float * | data, | |||
| int | vsize | |||
| ) |
Perform the same operation as pixelWrite() except assume that data is pre-sorted by increasing z-value. This method will perform slightly better than pixelWrite() as data does not need to be sorted.
| void IMG_DeepShadow::printArgs | ( | UT_WorkBuffer & | wbuf | ) |
Print the current values of the file options into the work buffer.
| void IMG_DeepShadow::resolution | ( | int & | xres, | |
| int & | yres | |||
| ) |
| void IMG_DeepShadow::setOption | ( | const char * | option, | |
| const char * | value | |||
| ) |
Set a file creation option. Options must be set before the file is opened with open() below.
Currently (and this list may be out of date), the options are:
| void IMG_DeepShadow::setOptions | ( | const UT_Options & | options | ) |
Set options based on the "texture:*" options defined in the UT_Options. The UT_Options will be checked for options:
texture:ofstorage texture:pzstorage texture:ofsize etc.
friend class IMG_DeepPixelReader [friend] |
Definition at line 334 of file IMG_DeepShadow.h.
friend class img_DeepShadow [friend] |
Definition at line 351 of file IMG_DeepShadow.h.
1.5.9