HDK
|
#include <IMG_TileDevice.h>
Public Types | |
enum | IMG_TILE_ORDER { IMG_TILE_BOTTOM_FIRST = 0, IMG_TILE_RANDOM_ORDER = 1, IMG_TILE_TOP_FIRST = 2, IMG_TILE_HILBERT = 3 } |
typedef IMG_TileDevice *(* | IMG_TileDeviceCreator )(const char *filename, const UT_Options *options) |
Public Member Functions | |
IMG_TileDevice () | |
virtual | ~IMG_TileDevice () |
void | setVisibleRegion (int l, int r, int b, int t) |
void | setRenderSize (int rwidth, int rheight) |
void | setDeviceDataWindow (const UT_DimRect &w) |
Set the data window. More... | |
void | setDeviceRenderWindow (const UT_DimRect &w) |
virtual int | open (const IMG_TileOptions &info, int xres, int yres, int tile_device, int tile_height, fpreal aspect)=0 |
Open the device. More... | |
virtual int | openMulti (IMG_TileOptionList &flist, int xres, int yres, int tile_width, int tile_height, fpreal aspect) |
virtual void | setWhitePoint (fpreal white) |
virtual void | checkpoint () |
void | setRenderSourceName (const char *name) |
const char * | getRenderSourceName () const |
int | getFileCount () const |
IMG_DataType | getDataType (int idx=0) const |
bool | isRandomAccess () const |
int | getTileWidth () const |
Query tile width parameters. More... | |
int | getTileHeight () const |
int | getTileCountX () const |
int | getTileCountY () const |
IMG_ColorModel | getColorModel (int idx=0) const |
IMG_DataType * | getDataTypes () |
IMG_ColorModel * | getColorModels () |
virtual void | writeCustomTag (const char *tagname, int size, const char *const *values) |
void | writeKnownTag (IMG_TagType tag_id, int size, const char *const *values) |
virtual int | writeTile (const void *data, unsigned x0, unsigned x1, unsigned y0, unsigned y1)=0 |
virtual bool | writeSamples (int nsamples, int floats_per_sample, const UT_Vector3T< int > *samples, const float *data) |
virtual void | flush () |
virtual int | close (bool keep_alive=false)=0 |
virtual int | unsafeFlush () |
virtual bool | getNextTile (int &xl, int &xr, int &yb, int &yt, int &tx, int &ty) |
virtual bool | getClickedTile (int &tx, int &ty, float &radius) const |
virtual void | resetTileRequestor () |
virtual int | getTileMode () const |
virtual void | terminateOnConnectionLost (bool) |
virtual bool | wantsHoudiniPort () const |
virtual bool | isInteractive () const |
virtual void | setStyleSheets (UT_StringArray &) |
virtual bool | getMouseClickPosition (int &x, int &y) const |
virtual float | getMouseClickRadius () const |
virtual const char * | className () const =0 |
virtual void | getDescription (UT_WorkBuffer &wbuf) const |
int | xres () const |
int | yres () const |
Static Public Member Functions | |
static IMG_TileDevice * | newDevice (const char *filename, const UT_Options *options=NULL) |
static bool | isSpecialFileName (const char *filename) |
static bool | isNullDeviceName (const char *filename) |
static void | registerDevice (IMG_TileDeviceCreator creator, const char *label) |
static void | unregisterDevice (const char *label) |
Unregister a custom device. More... | |
static IMG_TileDevice * | newFileDevice () |
static IMG_TileDevice * | newNullDevice () |
static IMG_TileDevice * | newMPlayDevice (int from_middle=1) |
static IMG_TileDevice * | imdisplayFileDevice (const char *filename) |
static IMG_TileDevice * | newSocketDevice (const char *host) |
static void | setFileDevCreator (IMG_TileDevice *(*creator)()) |
static void | setMPlayDevCreator (IMG_TileDevice *(*creator)(int)) |
Protected Member Functions | |
void | setResolution (int xres, int yres, int tilewidth, int tileheight, int tile_order=IMG_TILE_BOTTOM_FIRST) |
void | setModel (const IMG_TileOptions &finfo) |
void | setModel (IMG_TileOptionList &flist) |
void | setModel (const IMG_DataType *dt, const IMG_ColorModel *cm) |
void | mapImageToTile (int ix, int iy, int &tx, int &ty) |
void | getTileBounds (int tx, int ty, int &xl, int &xr, int &yb, int &yt) |
bool | hasDataWindow (int full_xres, int full_yres) const |
int | getDataX () const |
int | getDataY () const |
int | getDataWidth () const |
int | getDataHeight () const |
void | setTileOrder (IMG_TILE_ORDER tile_order) |
Specify the desired tile order. More... | |
void | setFileCount (int count) |
In the open method, the sub-class should set the file count. More... | |
void | setTileSize (int width, int height) |
Set the tile width. More... | |
UT_InclusiveRect | getDataWindow () const |
const UT_DimRect & | dataWindow () const |
const UT_DimRect & | displayWindow () const |
const UT_DimRect & | renderWindow () const |
Definition at line 35 of file IMG_TileDevice.h.
typedef IMG_TileDevice*(* IMG_TileDevice::IMG_TileDeviceCreator)(const char *filename, const UT_Options *options) |
Definition at line 51 of file IMG_TileDevice.h.
Enumerator | |
---|---|
IMG_TILE_BOTTOM_FIRST | |
IMG_TILE_RANDOM_ORDER | |
IMG_TILE_TOP_FIRST | |
IMG_TILE_HILBERT |
Definition at line 43 of file IMG_TileDevice.h.
IMG_TileDevice::IMG_TileDevice | ( | ) |
|
virtual |
|
virtual |
Allow the device to perform any "checkpointing" needed. This is equivalent to "flushing" the device.
Reimplemented in IMG_TileFile.
|
pure virtual |
Query information about the tile device
Implemented in IMG_TileFile, TIL_TileMPlay, and IMG_TileSocket.
|
pure virtual |
Implemented in IMG_TileFile, TIL_TileMPlay, and IMG_TileSocket.
|
inlineprotected |
Accessors to data, display render windows
Definition at line 336 of file IMG_TileDevice.h.
|
inlineprotected |
Accessors to data, display render windows
Definition at line 337 of file IMG_TileDevice.h.
|
virtual |
Reimplemented in TIL_TileMPlay.
IMG_ColorModel IMG_TileDevice::getColorModel | ( | int | idx = 0 | ) | const |
|
inline |
Definition at line 176 of file IMG_TileDevice.h.
|
inlineprotected |
Definition at line 318 of file IMG_TileDevice.h.
IMG_DataType IMG_TileDevice::getDataType | ( | int | idx = 0 | ) | const |
|
inline |
Definition at line 175 of file IMG_TileDevice.h.
|
inlineprotected |
Definition at line 317 of file IMG_TileDevice.h.
|
protected |
|
inlineprotected |
Definition at line 315 of file IMG_TileDevice.h.
|
inlineprotected |
Definition at line 316 of file IMG_TileDevice.h.
|
virtual |
Query information about the tile device
Reimplemented in IMG_TileFile, TIL_TileMPlay, and IMG_TileSocket.
|
inline |
After the open() is called, then it's possible to query the data type that the device expects.
Definition at line 162 of file IMG_TileDevice.h.
Subclasses can override this method if they respond to mouse clicks. x and y should be set to the mouse position (in pixels) if the mouse has been clicked. The method returns true if the mouse has been clicked; otherwise, false. If the method returns false then the values of x and y are undefined.
Reimplemented in TIL_TileMPlay.
Definition at line 288 of file IMG_TileDevice.h.
|
inlinevirtual |
Subclasses can override this method if they respond to mouse clicks and specify a radius for the click.
Reimplemented in TIL_TileMPlay.
Definition at line 293 of file IMG_TileDevice.h.
|
virtual |
The renderer will ask us for the next tile location to be rendered. We give it the location (in renderable region coordinates). The function returns true if this is a valid tile, otherwise false. The tile mode maps to the enum of bottom/top first or random order. (tx,ty) will be the unique tile index tuple, between (0,0) inclusive and (myTileCountX,myTileCountY) exclusive.
NOTE: xl, xr, yb, and yt, are all inclusive! Also, xl <= yr and yb <= yt if the return value is true, i.e. at least one pixel.
|
inline |
Definition at line 157 of file IMG_TileDevice.h.
|
protected |
|
inline |
Definition at line 169 of file IMG_TileDevice.h.
|
inline |
Definition at line 170 of file IMG_TileDevice.h.
|
inline |
Definition at line 168 of file IMG_TileDevice.h.
|
virtual |
|
inline |
Query tile width parameters.
Definition at line 167 of file IMG_TileDevice.h.
|
static |
Static methods to allocate new devices of built-in device types
|
inlinevirtual |
If this tile device is interactive (i.e. a flipbook), this method should return true. When mantra runs in batch-mode, opening an interactive device will fail.
Reimplemented in TIL_TileMPlay.
Definition at line 271 of file IMG_TileDevice.h.
|
static |
Returns true if filename represents a null device, i.e. it will ignore everything sent to it. This is useful for avoiding work that will be ignored.
|
inline |
Definition at line 164 of file IMG_TileDevice.h.
|
static |
Returns true if filename represents a special device, not a regular file, i.e. everything that newDevice has a special case for.
|
static |
Create a new device based on the filename. This checks:
|
static |
Static methods to allocate new devices of built-in device types
|
static |
Static methods to allocate new devices of built-in device types
|
static |
Static methods to allocate new devices of built-in device types
|
static |
Static methods to allocate new devices of built-in device types
|
pure virtual |
Open the device.
Implemented in IMG_TileFile, TIL_TileMPlay, and IMG_TileSocket.
|
virtual |
The default implementation will just open the first entry of the flist by calling open().
Reimplemented in IMG_TileFile, and TIL_TileMPlay.
|
static |
Register a custom image device. The label should be specified without the colon (':'). For example:
The creator function will be called from newDevice() with the filename/options passed. newDevice() will invoke the creator if the filename begins with the label. For example, the following would invoke the socket device registered above:
|
inlineprotected |
Accessors to data, display render windows
Definition at line 338 of file IMG_TileDevice.h.
|
virtual |
|
inline |
Set the data window.
Definition at line 122 of file IMG_TileDevice.h.
|
inline |
Set the window of pixels that need to be rendered The render window is always bigger or equal to the data window. It might be larger due to pixel filters (i.e. samples outside the data window might need to be computed for filtering). The difference between the data window and the render window size is used to determine filter width.
Definition at line 131 of file IMG_TileDevice.h.
In the open method, the sub-class should set the file count.
Definition at line 325 of file IMG_TileDevice.h.
|
static |
Replace the creators for the file or mplay devices.
registerDevice()
.
|
protected |
|
protected |
|
protected |
|
static |
Replace the creators for the file or mplay devices.
registerDevice()
.
|
inline |
Definition at line 155 of file IMG_TileDevice.h.
|
protected |
|
inlinevirtual |
Reimplemented in TIL_TileMPlay.
Definition at line 281 of file IMG_TileDevice.h.
|
inlineprotected |
Specify the desired tile order.
Definition at line 321 of file IMG_TileDevice.h.
Reimplemented in TIL_TileMPlay.
|
inlinevirtual |
Reimplemented in TIL_TileMPlay.
Definition at line 262 of file IMG_TileDevice.h.
|
static |
Unregister a custom device.
|
virtual |
|
inlinevirtual |
Reimplemented in TIL_TileMPlay.
Definition at line 266 of file IMG_TileDevice.h.
|
virtual |
Reimplemented in IMG_TileFile, and TIL_TileMPlay.
|
inline |
Definition at line 184 of file IMG_TileDevice.h.
|
inlinevirtual |
This is just for sending sample data from Mantra to Houdini via TIL_TileMPlay. data contains nsamples tuples of floats_per_sample floats samples contains nsamples (x,y,pixel_sample) tuples
Reimplemented in TIL_TileMPlay.
Definition at line 222 of file IMG_TileDevice.h.
|
pure virtual |
The data written is in the format specified by the IMG_ColorModel and IMG_DataType parameters in the open. The size of the tile is smaller or equal to the sizes specified in the open. If the device was opened using openMulti(), the data is provided as a sequence of planes - first all pixels for plane 0, then all pixels for plane 1, etc.
The rectangle spectified by x0
, x1
, y0
and y1
is an inclusive rectangle. That is, the number of pixels in data
is: (x1-x0+1)*(y1-y0+1).
The first pixel in the data buffer is the bottom left corner of the tile (i.e. (x0,y0)).
The rectangle specified is also relative to the data window. So, to offset to get the absolute pixel location you need to take the data window (getDataWindow()) into account. You can also use the convenience methods getDataX()
and getDataY(). For example:
Implemented in IMG_TileFile, TIL_TileMPlay, and IMG_TileSocket.
|
inline |
Accessor
Definition at line 275 of file IMG_TileDevice.h.
|
inline |
Accessor
Definition at line 276 of file IMG_TileDevice.h.