RixDeepTexture::DeepPixel Class Reference

DeepPixel. More...

#include <RixDeepTexture.h>

List of all members.

Public Member Functions

virtual int Clear (int numChan)=0
 use RixDeepTexture::DestroyPixel
virtual int Empty ()=0
virtual int SpecifyPixel (int numChan, int numPoints, float *data)=0
 Initialize this DeepPixel to the uncompressed values provided.
virtual int IsMonochrome ()=0
 Return 1 if this pixel has duplicates for all its values.
virtual int GetNumChan ()=0
 Return the number of channels in this pixel.
virtual int GetNumPoints ()=0
 Return the number of control points in this pixel.
virtual int GetPoint (int i, float *z, float *data)=0
 Get the i'th control point in the given pixel.
virtual int SetPoint (int i, float z, float *data)=0
 Modify the i'th control point in this pixel.
virtual int Copy (DeepPixel *src)=0
 Copy the source pixel state into ours.
virtual int Merge (DeepPixel *src)=0
 Merge a source pixel's state into ours.
virtual int Finish ()=0
 If this pixel is in "compress mode" (non-zero compression), this function finished compression and sets compression error to zero.
virtual int Append (float z, float *data, float tolerance)=0
 Add a data point to the end of this pixel.
virtual int Eval (float z, float *data)=0
 Evaluate this pixels texture at depth z and put the result in data.
virtual int Composite (int rgbChannel, int alphaChannel, float *data)=0
 Composite four channel RGBA within the pixel and store the result in data.
virtual int GetZRange (float *zmin, float *zmax)=0
 Computes the range over which the specified pixel is defined.
virtual int Average (int n, DeepPixel *pixels[], float weights[], float tolerance)=0
 Compute the weighted pointwise average of the incoming array of pixels and weights and place the result into this DeepPixel.
virtual int Compress (DeepPixel *src, float tolerance)=0
 Compress a src DeepPixel into this DeepPixel.


Detailed Description

DeepPixel.

Because deep texture pixels are varying in size, a pixel's storage must be dynamically allocated. Th DeepPixel allows users to build and evaluate pixels. The structure is fairly heavyweight because it stores auxiliary information related to compression. We don't recommend allocating an entire image of these structures yourself; keep * a small number of DeepPixels around, and use img->SetPixel to modify a DeepImage.

The following functions let you create, modify, and destroy DeepPixels. Pixels may be cleared with Clear(). New datapoints may be added (in increasing Z order) with Append(). If compression is used, a pixel must be Finish()'ed before lookups can be performed in the pixel.


Member Function Documentation

virtual int RixDeepTexture::DeepPixel::Append float  z,
float *  data,
float  tolerance
[pure virtual]
 

Add a data point to the end of this pixel.

tolerance provides an accuracy hint to compressors. The number of floats provided in data must be equal to the pixel's channel count.

virtual int RixDeepTexture::DeepPixel::Average int  n,
DeepPixel pixels[],
float  weights[],
float  tolerance
[pure virtual]
 

Compute the weighted pointwise average of the incoming array of pixels and weights and place the result into this DeepPixel.

virtual int RixDeepTexture::DeepPixel::Clear int  numChan  )  [pure virtual]
 

use RixDeepTexture::DestroyPixel

virtual int RixDeepTexture::DeepPixel::Composite int  rgbChannel,
int  alphaChannel,
float *  data
[pure virtual]
 

Composite four channel RGBA within the pixel and store the result in data.

rgbChannel must be the index of the first color channel, with the assumption that all three color channels are contiguous. alphaChannel must be the index of the alpha channel. data must be a buffer of at least four floats. If the pixel is empty, k_errEMPTY is returned and data is filled with zeros. Otherwise, data[0], data[1], and data[2] contain the composited color values and data[3] contains the composited alpha value, and the method returns k_errNOERR.

virtual int RixDeepTexture::DeepPixel::Compress DeepPixel src,
float  tolerance
[pure virtual]
 

Compress a src DeepPixel into this DeepPixel.

Currently you can't compress a DeepPixel into itself (so this != src).

virtual int RixDeepTexture::DeepPixel::Copy DeepPixel src  )  [pure virtual]
 

Copy the source pixel state into ours.

Ensure that our channel and compression state match that of src.

virtual int RixDeepTexture::DeepPixel::Eval float  z,
float *  data
[pure virtual]
 

Evaluate this pixels texture at depth z and put the result in data.

The amount of float storage in data must be equal to the pixel's channel count.

virtual int RixDeepTexture::DeepPixel::Finish  )  [pure virtual]
 

If this pixel is in "compress mode" (non-zero compression), this function finished compression and sets compression error to zero.

This must be called before any lookups on the pixel. If the pixel alred has a zero compression error, this method has no effect.

virtual int RixDeepTexture::DeepPixel::GetNumChan  )  [pure virtual]
 

Return the number of channels in this pixel.

virtual int RixDeepTexture::DeepPixel::GetNumPoints  )  [pure virtual]
 

Return the number of control points in this pixel.

Returns zero if there are no control points, k_ErrERROR if the pixel has unresolved compression state.

virtual int RixDeepTexture::DeepPixel::GetPoint int  i,
float *  z,
float *  data
[pure virtual]
 

Get the i'th control point in the given pixel.

If the indicated control point is accessible, z and data are set and k_ErrNOERR is return. If the pixel does not exist, k_ErrNOPOINT is returned and *z and *data are undefined. If the pixel has unresolved compression state, k_ErrUNFINISHED is returned and *z and *data are undefined.

virtual int RixDeepTexture::DeepPixel::GetZRange float *  zmin,
float *  zmax
[pure virtual]
 

Computes the range over which the specified pixel is defined.

If the pixel is non-empty, the range is returned in zmin and zmax and the method returns k_ErrNOERR. If this pixel is empty, we return k_ErrEMPTY and *zmin and *zmax are undefined. If this pixel has undefined compression state, k_ErrUNFINISHED is returned and *zmin and *zmax are undefined.

virtual int RixDeepTexture::DeepPixel::IsMonochrome  )  [pure virtual]
 

Return 1 if this pixel has duplicates for all its values.

Return 0 otherwise. If this pixel has no control points, return 1.

virtual int RixDeepTexture::DeepPixel::Merge DeepPixel src  )  [pure virtual]
 

Merge a source pixel's state into ours.

The result is that our pixel will contain all control points in both pixels. The channel count in the source pixel must match our own, and both pixels must not have any incomplete compression state.

virtual int RixDeepTexture::DeepPixel::SetPoint int  i,
float  z,
float *  data
[pure virtual]
 

Modify the i'th control point in this pixel.

If the indicated control point is accessible and if the supplied z is legal, the pixel is modified and kErrNOERR is returned. If the point does not exist, k_ErrNOPOINT is returned. If the pixel has unresolved compression state, k_ErrUNFINISHED is returned.

virtual int RixDeepTexture::DeepPixel::SpecifyPixel int  numChan,
int  numPoints,
float *  data
[pure virtual]
 

Initialize this DeepPixel to the uncompressed values provided.


The documentation for this class was generated from the following file:
Generated on Mon Nov 15 10:14:34 2010 for PRManHeaders by  doxygen 1.4.6