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

#include <PXL_DeepPixel.h>

Classes

class  SampleKey
 

Public Member Functions

 PXL_DeepPixel (const PXL_DeepChannelListPtr &channels, int sample_lists_per_pixel)
 
 ~PXL_DeepPixel ()
 
bool isOpen () const
 Test whether the pixel is accepting samples. More...
 
bool isMipStyle () const
 
bool isRawStyle () const
 
const PXL_DeepChannelListPtrchannels () const
 Return channel list passed into the c-tor. More...
 
void startPixel (int x, int y, bool precomposted)
 
void store (const PXL_DeepSampleListPtr &sample)
 Store a sample for MIP style accumulation. More...
 
void store (float zfront, float zback, const float *channel_data, int flags, int sample_id)
 
PXL_DeepSampleListPtr closePixel (const PXL_DeepCompressorPtr &compress)
 
float samplez (const SampleKey &k) const
 
void dump (const char *msg="") const
 
int x () const
 
int y () const
 

Detailed Description

Class to accumulate multiple deep samples and merge them into a single list.

Since this class allocates memory, it can be reused for multiple pixels, reusing it's buffers.

There are two modes of operation for the class:

  • Accept a tuple of (int sample_id, uint8 flags, const float *data) representing a single deep sample. In this mode, the deep pixel accumulates mutiple sample tuples. The extract method will merge them into a single PXL_DeepSampleListPtr based on the compressor passed in.

Accept one to four PXL_DeepSampleListPtr objects. This mode is typically used when creating MIP maps. The extract method will call the compressor to merge the existing PXL_DeepSampleListPtr objects into a single PXL_DeepSampleListPtr.

Definition at line 35 of file PXL_DeepPixel.h.

Constructor & Destructor Documentation

PXL_DeepPixel::PXL_DeepPixel ( const PXL_DeepChannelListPtr channels,
int  sample_lists_per_pixel 
)
PXL_DeepPixel::~PXL_DeepPixel ( )

Member Function Documentation

const PXL_DeepChannelListPtr& PXL_DeepPixel::channels ( ) const
inline

Return channel list passed into the c-tor.

Definition at line 82 of file PXL_DeepPixel.h.

PXL_DeepSampleListPtr PXL_DeepPixel::closePixel ( const PXL_DeepCompressorPtr compress)

Close the pixel, returning the result of the compressor's merge operation.

void PXL_DeepPixel::dump ( const char *  msg = "") const
bool PXL_DeepPixel::isMipStyle ( ) const
inline

Test whether the pixel is collecting PXL_DeepSampleListPtr's (rather than raw float samples). Note, if no samples have been written, the pixel could be in both MIP and raw style.

Definition at line 75 of file PXL_DeepPixel.h.

bool PXL_DeepPixel::isOpen ( ) const
inline

Test whether the pixel is accepting samples.

Definition at line 70 of file PXL_DeepPixel.h.

bool PXL_DeepPixel::isRawStyle ( ) const
inline

Test whether the pixel is collecting raw float data (rather than PXL_DeepSampleListPtr's). Note, if no samples have been written, the pixel could be in both MIP and raw style.

Definition at line 79 of file PXL_DeepPixel.h.

float PXL_DeepPixel::samplez ( const SampleKey k) const
inline

Definition at line 124 of file PXL_DeepPixel.h.

void PXL_DeepPixel::startPixel ( int  x,
int  y,
bool  precomposted 
)

Start collecting samples for the given pixel. The precomposited flag indicates whether the incoming samples are pre-composited or uncomposited.

void PXL_DeepPixel::store ( const PXL_DeepSampleListPtr sample)

Store a sample for MIP style accumulation.

void PXL_DeepPixel::store ( float  zfront,
float  zback,
const float channel_data,
int  flags,
int  sample_id 
)

Store a raw sample. The samples do not have to be added in order.

  • zfront
    The nearest z value for the sample.
  • zback
    The far z value for the sample. For hard surfaces, this is likely the same as zfront.
  • channel_data
    The floating point data for all the channels. The length of this array should be channels()->totalSize() and the data in the array should be ordered according to the channel order.
  • flags
    Please see the list of flags in PXL_DeepSampleList.h
  • sample_id
    This represents the sub-pixel sample id. For example with 3x3 pixel sampling, the sample id's would run between 0 and 9. A value of -1 indicates that no sample id is available. The sample id is used in creating the coverage for the pixel.
int PXL_DeepPixel::x ( ) const
inline

Return coordinate passed into startPixel()

Definition at line 120 of file PXL_DeepPixel.h.

int PXL_DeepPixel::y ( ) const
inline

Return coordinate passed into startPixel()

Definition at line 121 of file PXL_DeepPixel.h.


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