RenderManAPI  24.0
RixDeepTexture::DeepPixel Class Referenceabstract

DeepPixel. More...

#include <RixDeepTexture.h>

Public Member Functions

virtual int Clear (int numChan)=0
 
virtual int Empty ()=0
 
virtual int SpecifyPixel (int numChan, int numPoints, float *data)=0
 Initialize this DeepPixel to the uncompressed values provided. More...
 
virtual int IsMonochrome ()=0
 Return 1 if this pixel has duplicates for all its values. More...
 
virtual int GetNumChan ()=0
 Return the number of channels in this pixel. More...
 
virtual int GetNumPoints ()=0
 Return the number of control points in this pixel. More...
 
virtual int GetPoint (int i, float *z, float *data)=0
 Get the i'th control point in the given pixel. More...
 
virtual int SetPoint (int i, float z, float *data)=0
 Modify the i'th control point in this pixel. More...
 
virtual int Copy (DeepPixel *src)=0
 Copy the source pixel state into ours. More...
 
virtual int Merge (DeepPixel *src)=0
 Merge a source pixel's state into ours. More...
 
virtual int Merge (DeepPixel *src, int rgbChannel, int alphaChannel)=0
 Merge a source pixel's state into ours, additionally taking into account volume segments in either input. More...
 
virtual int Finish ()=0
 If this pixel is in "compress mode" (non-zero compression), this function finished compression and sets compression error to zero. More...
 
virtual int Append (float z, float *data, float tolerance)=0
 Add a data point to the end of this pixel. More...
 
virtual int Eval (float z, float *data)=0
 Evaluate this pixels texture at depth z and put the result in data. More...
 
virtual int Composite (int rgbChannel, int alphaChannel, float *data)=0
 Composite four channel RGBA within the pixel and store the result in data. More...
 
virtual int GetZRange (float *zmin, float *zmax)=0
 Computes the range over which the specified pixel is defined. More...
 
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. More...
 
virtual int Compress (DeepPixel *src, float tolerance)=0
 Compress a src DeepPixel into this DeepPixel. More...
 

Protected Member Functions

virtual ~DeepPixel ()
 Internal only. Use RixDeepTexture::DestroyPixel. More...
 

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.

Constructor & Destructor Documentation

◆ ~DeepPixel()

virtual RixDeepTexture::DeepPixel::~DeepPixel ( )
inlineprotectedvirtual

Internal only. Use RixDeepTexture::DestroyPixel.

Member Function Documentation

◆ Append()

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.

◆ Average()

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.

◆ Clear()

virtual int RixDeepTexture::DeepPixel::Clear ( int  numChan)
pure virtual

◆ Composite()

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.

◆ Compress()

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).

◆ Copy()

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.

◆ Empty()

virtual int RixDeepTexture::DeepPixel::Empty ( )
pure virtual

◆ Eval()

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.

◆ Finish()

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.

◆ GetNumChan()

virtual int RixDeepTexture::DeepPixel::GetNumChan ( )
pure virtual

Return the number of channels in this pixel.

◆ GetNumPoints()

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.

◆ GetPoint()

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.

◆ GetZRange()

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.

◆ IsMonochrome()

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.

◆ Merge() [1/2]

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.

◆ Merge() [2/2]

virtual int RixDeepTexture::DeepPixel::Merge ( DeepPixel src,
int  rgbChannel,
int  alphaChannel 
)
pure virtual

Merge a source pixel's state into ours, additionally taking into account volume segments in either input.

Regions of volume are flagged with a negative alpha and extend to the next sample in the pixel. There must be at least one non-volume sample marking the end of chain (which may be completely transparent).

This assumes a four channel RGBA pixel function when splitting and merging volume regions. The rgbChannel must be the index of the first color channel, with the assumption that all three color channels are contiguous. The alphaChannel must be the index of the alpha channel. Any additional channels will be copied unchanged from the most recent volume sample.

◆ SetPoint()

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.

◆ SpecifyPixel()

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: