HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TIL_TileMPlay Class Reference

#include <TIL_TileMPlay.h>

+ Inheritance diagram for TIL_TileMPlay:

Public Member Functions

 TIL_TileMPlay (int middle, bool isflipbook)
 
 ~TIL_TileMPlay () override
 
void noNewMPlay (bool enable)
 
void setSendPIDFlag (bool flag)
 
const char * className () const override
 
void getDescription (UT_WorkBuffer &wbuf) const override
 
int open (const IMG_TileOptions &finfo, int xres, int yres, int twidth, int theight, fpreal aspect) override
 Open the device. More...
 
int openMulti (IMG_TileOptionList &flist, int xres, int yres, int twidth, int theight, fpreal aspect) override
 
void setWhitePoint (fpreal w) override
 
void writeCustomTag (const char *tagname, int size, const char *const *values) override
 
int writeTile (const void *data, unsigned x0, unsigned x1, unsigned y0, unsigned y1) override
 
bool writeSamples (int nsamples, int floats_per_sample, const UT_Vector3T< int > *samples, const float *data) override
 
void flush () override
 
int close (bool keep_alive=false) override
 
int openDeep (const char *filename, const TIL_Sequence &info, int tilex, int tiley, bool startnew=false, const IMG_TileOptions *finfo=0)
 
int writeDeepTile (int plane_index, const void *data, int x0, int x1, int y0, int y1)
 
void setStatusMsg (const char *msg)
 
bool isOpen () const
 
bool checkInterrupt ()
 
bool getMouseClickPosition (int &x, int &y) const override
 
float getMouseClickRadius () const override
 
void setMouseClickPosition (int x, int y)
 
void streakEdges (int x1, int y1, int x2, int y2, int plane=-1)
 
bool wasRemoteQuitRequested ()
 
void terminateOnConnectionLost (bool) override
 
bool wantsHoudiniPort () const override
 
bool isInteractive () const override
 
void setStyleSheets (UT_StringArray &style_sheets) override
 
- Public Member Functions inherited from IMG_TileDevice
 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 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_DataTypegetDataTypes ()
 
IMG_ColorModelgetColorModels ()
 
void writeKnownTag (IMG_TagType tag_id, int size, const char *const *values)
 
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
 
int xres () const
 
int yres () const
 

Static Public Member Functions

static void getLockFile (UT_WorkBuffer &buf, bool isflipbook, const char *label)
 
static void enableColorCorrection (bool enable)
 
static void setColorCorrectionLUT (bool enable, const char *lut)
 
static void setColorCorrectionGamma (bool enable, fpreal gamma)
 
- Static Public Member Functions inherited from IMG_TileDevice
static IMG_TileDevicenewDevice (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_TileDevicenewFileDevice ()
 
static IMG_TileDevicenewNullDevice ()
 
static IMG_TileDevicenewMPlayDevice (int from_middle=1)
 
static IMG_TileDeviceimdisplayFileDevice (const char *filename)
 
static IMG_TileDevicenewSocketDevice (const char *host)
 
static void setFileDevCreator (IMG_TileDevice *(*creator)())
 
static void setMPlayDevCreator (IMG_TileDevice *(*creator)(int))
 

Additional Inherited Members

- Public Types inherited from IMG_TileDevice
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)
 
- Protected Member Functions inherited from IMG_TileDevice
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_DimRectdataWindow () const
 
const UT_DimRectdisplayWindow () const
 
const UT_DimRectrenderWindow () const
 

Detailed Description

Examples:
standalone/tiledevice.C.

Definition at line 35 of file TIL_TileMPlay.h.

Constructor & Destructor Documentation

TIL_TileMPlay::TIL_TileMPlay ( int  middle,
bool  isflipbook 
)
TIL_TileMPlay::~TIL_TileMPlay ( )
override

Member Function Documentation

bool TIL_TileMPlay::checkInterrupt ( )
inline

Definition at line 93 of file TIL_TileMPlay.h.

const char* TIL_TileMPlay::className ( ) const
overridevirtual

Query information about the tile device

Implements IMG_TileDevice.

int TIL_TileMPlay::close ( bool  keep_alive = false)
overridevirtual

Implements IMG_TileDevice.

static void TIL_TileMPlay::enableColorCorrection ( bool  enable)
static
void TIL_TileMPlay::flush ( )
overridevirtual

Reimplemented from IMG_TileDevice.

void TIL_TileMPlay::getDescription ( UT_WorkBuffer wbuf) const
overridevirtual

Query information about the tile device

Reimplemented from IMG_TileDevice.

static void TIL_TileMPlay::getLockFile ( UT_WorkBuffer buf,
bool  isflipbook,
const char *  label 
)
static
bool TIL_TileMPlay::getMouseClickPosition ( int x,
int y 
) const
overridevirtual

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 from IMG_TileDevice.

float TIL_TileMPlay::getMouseClickRadius ( ) const
overridevirtual

Subclasses can override this method if they respond to mouse clicks and specify a radius for the click.

Reimplemented from IMG_TileDevice.

bool TIL_TileMPlay::isInteractive ( ) const
inlineoverridevirtual

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 from IMG_TileDevice.

Definition at line 114 of file TIL_TileMPlay.h.

bool TIL_TileMPlay::isOpen ( ) const
inline

Definition at line 92 of file TIL_TileMPlay.h.

void TIL_TileMPlay::noNewMPlay ( bool  enable)
int TIL_TileMPlay::open ( const IMG_TileOptions info,
int  xres,
int  yres,
int  tile_device,
int  tile_height,
fpreal  aspect 
)
overridevirtual

Open the device.

Implements IMG_TileDevice.

int TIL_TileMPlay::openDeep ( const char *  filename,
const TIL_Sequence info,
int  tilex,
int  tiley,
bool  startnew = false,
const IMG_TileOptions finfo = 0 
)
int TIL_TileMPlay::openMulti ( IMG_TileOptionList flist,
int  xres,
int  yres,
int  tile_width,
int  tile_height,
fpreal  aspect 
)
overridevirtual

The default implementation will just open the first entry of the flist by calling open().

Reimplemented from IMG_TileDevice.

static void TIL_TileMPlay::setColorCorrectionGamma ( bool  enable,
fpreal  gamma 
)
static
static void TIL_TileMPlay::setColorCorrectionLUT ( bool  enable,
const char *  lut 
)
static
void TIL_TileMPlay::setMouseClickPosition ( int  x,
int  y 
)
inline

Definition at line 98 of file TIL_TileMPlay.h.

void TIL_TileMPlay::setSendPIDFlag ( bool  flag)
void TIL_TileMPlay::setStatusMsg ( const char *  msg)
void TIL_TileMPlay::setStyleSheets ( UT_StringArray style_sheets)
inlineoverridevirtual

Reimplemented from IMG_TileDevice.

Definition at line 120 of file TIL_TileMPlay.h.

void TIL_TileMPlay::setWhitePoint ( fpreal  w)
overridevirtual

Reimplemented from IMG_TileDevice.

void TIL_TileMPlay::streakEdges ( int  x1,
int  y1,
int  x2,
int  y2,
int  plane = -1 
)
void TIL_TileMPlay::terminateOnConnectionLost ( bool  )
overridevirtual

Reimplemented from IMG_TileDevice.

bool TIL_TileMPlay::wantsHoudiniPort ( ) const
inlineoverridevirtual

Reimplemented from IMG_TileDevice.

Definition at line 112 of file TIL_TileMPlay.h.

bool TIL_TileMPlay::wasRemoteQuitRequested ( )
inline

Definition at line 104 of file TIL_TileMPlay.h.

void TIL_TileMPlay::writeCustomTag ( const char *  tagname,
int  size,
const char *const values 
)
overridevirtual

Reimplemented from IMG_TileDevice.

int TIL_TileMPlay::writeDeepTile ( int  plane_index,
const void data,
int  x0,
int  x1,
int  y0,
int  y1 
)
bool TIL_TileMPlay::writeSamples ( int  nsamples,
int  floats_per_sample,
const UT_Vector3T< int > *  samples,
const float data 
)
overridevirtual

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 from IMG_TileDevice.

int TIL_TileMPlay::writeTile ( const void data,
unsigned  x0,
unsigned  x1,
unsigned  y0,
unsigned  y1 
)
overridevirtual

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:

unsigned pixel_x0 = x0 + getDataX();
unsigned pixel_x1 = x1 + getDataX();
unsigned pixel_y0 = y0 + getDataY();
unsigned pixel_y1 = y1 + getDataY();

Implements IMG_TileDevice.


The documentation for this class was generated from the following file: