vrpn 07.35
Virtual Reality Peripheral Network
Loading...
Searching...
No Matches
vrpn_Imager_Region Class Reference

Helper function to convert data for a sub-region of one channel of. More...

#include <vrpn_Imager.h>

Public Member Functions

 vrpn_Imager_Region (void)
 
vrpn_uint32 getNumVals () const
 Returns the number of values in the region.
 
bool read_unscaled_pixel (vrpn_uint16 c, vrpn_uint16 r, vrpn_uint8 &val, vrpn_uint16 d=0) const
 Reads pixel from the region with no scale and offset applied to the value. Not the most efficient way to read the pixels out – use the block read routines.
 
bool read_unscaled_pixel (vrpn_uint16 c, vrpn_uint16 r, vrpn_uint16 &val, vrpn_uint16 d=0) const
 Reads pixel from the region with no scale and offset applied to the value. Not.
 
bool read_unscaled_pixel (vrpn_uint16 c, vrpn_uint16 r, vrpn_float32 &val, vrpn_uint16 d=0) const
 Reads pixel from the region with no scale and offset applied to the value. Not.
 
bool decode_unscaled_region_using_base_pointer (vrpn_uint8 *data, vrpn_uint32 colStride, vrpn_uint32 rowStride, vrpn_uint32 depthStride=0, vrpn_uint16 nRows=0, bool invert_rows=false, unsigned repeat=1) const
 As efficiently as possible, pull the values out of the VRPN buffer and put them into the array whose pointer is passed in, transcoding as needed to convert it into the type of the pointer passed in.
 
bool decode_unscaled_region_using_base_pointer (vrpn_uint16 *data, vrpn_uint32 colStride, vrpn_uint32 rowStride, vrpn_uint32 depthStride=0, vrpn_uint16 nRows=0, bool invert_rows=false, unsigned repeat=1) const
 
bool decode_unscaled_region_using_base_pointer (vrpn_float32 *data, vrpn_uint32 colStride, vrpn_uint32 rowStride, vrpn_uint32 depthStride=0, vrpn_uint16 nRows=0, bool invert_rows=false, unsigned repeat=1) const
 
vrpn_uint16 get_val_type (void) const
 

Public Attributes

vrpn_int16 d_chanIndex
 
vrpn_uint16 d_rMin
 
vrpn_uint16 d_rMax
 
vrpn_uint16 d_cMin
 
vrpn_uint16 d_cMax
 
vrpn_uint16 d_dMin
 
vrpn_uint16 d_dMax
 

Protected Attributes

const void * d_valBuf
 
vrpn_uint16 d_valType
 
bool d_valid
 

Friends

class VRPN_API vrpn_Imager_Remote
 
void VRPN_CALLBACK java_vrpn_handle_region_change (void *userdata, const vrpn_IMAGERREGIONCB info)
 

Detailed Description

Helper function to convert data for a sub-region of one channel of.

Definition at line 442 of file vrpn_Imager.h.

Constructor & Destructor Documentation

◆ vrpn_Imager_Region()

vrpn_Imager_Region::vrpn_Imager_Region ( void  )
inline

Definition at line 449 of file vrpn_Imager.h.

References vrpn_IMAGER_VALTYPE_UNKNOWN.

Member Function Documentation

◆ decode_unscaled_region_using_base_pointer() [1/3]

bool vrpn_Imager_Region::decode_unscaled_region_using_base_pointer ( vrpn_float32 *  data,
vrpn_uint32  colStride,
vrpn_uint32  rowStride,
vrpn_uint32  depthStride = 0,
vrpn_uint16  nRows = 0,
bool  invert_rows = false,
unsigned  repeat = 1 
) const

◆ decode_unscaled_region_using_base_pointer() [2/3]

bool vrpn_Imager_Region::decode_unscaled_region_using_base_pointer ( vrpn_uint16 *  data,
vrpn_uint32  colStride,
vrpn_uint32  rowStride,
vrpn_uint32  depthStride = 0,
vrpn_uint16  nRows = 0,
bool  invert_rows = false,
unsigned  repeat = 1 
) const

◆ decode_unscaled_region_using_base_pointer() [3/3]

bool vrpn_Imager_Region::decode_unscaled_region_using_base_pointer ( vrpn_uint8 *  data,
vrpn_uint32  colStride,
vrpn_uint32  rowStride,
vrpn_uint32  depthStride = 0,
vrpn_uint16  nRows = 0,
bool  invert_rows = false,
unsigned  repeat = 1 
) const

As efficiently as possible, pull the values out of the VRPN buffer and put them into the array whose pointer is passed in, transcoding as needed to convert it into the type of the pointer passed in.

data: Points at the (0,0) element of the 2D array that is to hold the image. It is assumed that the data values should be copied exactly, and that offset and scale should be applied at the reading end by the user if they want to get them back into absolute units. repeat: How many times to copy each element (for example, this will be 3 if we are copying an unsigned 8-bit value from the network into the Red, Green, and Blue entries of a color map. colStride, rowStride: Number of elements (size of data type) to skip along a column and row. This tells how far to jump ahead when writing the next element in the row (must be larger or the same as the repeat) and how make elements to skip to get to the beginning of the next column. For example, copying a uint from the network into the Red, Green, and Blue elements of an RGBA texture would have repeat=3, colStride=4, and rowStride=4*(number of columns). numRows, invert_rows: numRows needs to equal the number of rows in the entire image if invert_rows is true; it is not used otherwise. invert_rows inverts the image in y as it is copying it into the user's buffer.

Definition at line 1441 of file vrpn_Imager.C.

References d_cMax, d_cMin, d_dMax, d_dMin, d_rMax, d_rMin, d_valBuf, d_valType, vrpn_IMAGER_VALTYPE_FLOAT32, vrpn_IMAGER_VALTYPE_UINT16, and vrpn_IMAGER_VALTYPE_UINT8.

◆ get_val_type()

vrpn_uint16 vrpn_Imager_Region::get_val_type ( void  ) const
inline

Definition at line 611 of file vrpn_Imager.h.

◆ getNumVals()

vrpn_uint32 vrpn_Imager_Region::getNumVals ( ) const
inline

Returns the number of values in the region.

Definition at line 459 of file vrpn_Imager.h.

◆ read_unscaled_pixel() [1/3]

bool vrpn_Imager_Region::read_unscaled_pixel ( vrpn_uint16  c,
vrpn_uint16  r,
vrpn_float32 &  val,
vrpn_uint16  d = 0 
) const
inline

Reads pixel from the region with no scale and offset applied to the value. Not.

Definition at line 552 of file vrpn_Imager.h.

References vrpn_IMAGER_VALTYPE_FLOAT32.

◆ read_unscaled_pixel() [2/3]

bool vrpn_Imager_Region::read_unscaled_pixel ( vrpn_uint16  c,
vrpn_uint16  r,
vrpn_uint16 &  val,
vrpn_uint16  d = 0 
) const
inline

Reads pixel from the region with no scale and offset applied to the value. Not.

Definition at line 509 of file vrpn_Imager.h.

References vrpn_IMAGER_VALTYPE_UINT12IN16, and vrpn_IMAGER_VALTYPE_UINT16.

◆ read_unscaled_pixel() [3/3]

bool vrpn_Imager_Region::read_unscaled_pixel ( vrpn_uint16  c,
vrpn_uint16  r,
vrpn_uint8 &  val,
vrpn_uint16  d = 0 
) const
inline

Reads pixel from the region with no scale and offset applied to the value. Not the most efficient way to read the pixels out – use the block read routines.

Definition at line 473 of file vrpn_Imager.h.

References vrpn_IMAGER_VALTYPE_UINT8.

Friends And Related Function Documentation

◆ java_vrpn_handle_region_change

void VRPN_CALLBACK java_vrpn_handle_region_change ( void *  userdata,
const vrpn_IMAGERREGIONCB  info 
)
friend

◆ vrpn_Imager_Remote

friend class VRPN_API vrpn_Imager_Remote
friend

Definition at line 443 of file vrpn_Imager.h.

Member Data Documentation

◆ d_chanIndex

vrpn_int16 vrpn_Imager_Region::d_chanIndex

Definition at line 613 of file vrpn_Imager.h.

Referenced by vrpn_Imager_Remote::handle_region_message().

◆ d_cMax

vrpn_uint16 vrpn_Imager_Region::d_cMax

◆ d_cMin

vrpn_uint16 vrpn_Imager_Region::d_cMin

◆ d_dMax

vrpn_uint16 vrpn_Imager_Region::d_dMax

◆ d_dMin

vrpn_uint16 vrpn_Imager_Region::d_dMin

◆ d_rMax

vrpn_uint16 vrpn_Imager_Region::d_rMax

◆ d_rMin

vrpn_uint16 vrpn_Imager_Region::d_rMin

◆ d_valBuf

const void* vrpn_Imager_Region::d_valBuf
protected

◆ d_valid

bool vrpn_Imager_Region::d_valid
protected

Definition at line 621 of file vrpn_Imager.h.

Referenced by vrpn_Imager_Remote::handle_region_message().

◆ d_valType

vrpn_uint16 vrpn_Imager_Region::d_valType
protected

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