Man Page for vtkAGraymap
Table of Contents

NAME

vtkAGraymap - scalar data in intensity + alpha (grayscale + opacity) form

SYNOPSIS


#include "/opt/vtk-c++/common/vtkAGraymap.h"

class VTK_EXPORT vtkAGraymap : public vtkColorScalars

vtkAGraymap();
vtkAGraymap(const vtkAGraymap& fs);
vtkAGraymap(const int sz, const int ext=1000);
~vtkAGraymap();
int Allocate(const int sz, const int ext=1000) {return this->S->Allocate(2*sz,2*ext);};
void Initialize() {this->S->Initialize();};
static vtkAGraymap *New() {return new vtkAGraymap;};
const char *GetClassName() {return "vtkAGraymap";};
vtkScalars *MakeObject(int sze, int ext=1000);
int GetNumberOfScalars() {return (this->S->GetMaxId()+1)/2;};
void Squeeze() {this->S->Squeeze();};
int GetNumberOfValuesPerScalar() {return 2;};
float GetScalar(int i);
vtkAGraymap &operator=(const vtkAGraymap& fs);
void operator+=(const vtkAGraymap& fs) {*(this->S) += *(fs.S);};
void Reset() {this->S->Reset();};
unsigned char *GetPointer(const int id);
unsigned char *WritePointer(const int id, const int number);
unsigned char *GetColor(int id);
void GetColor(int id, unsigned char rgba[4]);
void SetNumberOfColors(int number);
void SetColor(int id, unsigned char rgba[4]);
void InsertColor(int id, unsigned char rgba[4]);
int InsertNextColor(unsigned char rgba[4]);
unsigned char *GetAGrayValue(int id);
void GetAGrayValue(int id, unsigned char ga[2]);
void SetAGrayValue(int id, unsigned char ga[2]);
void InsertAGrayValue(int id, unsigned char ga[2]);
int InsertNextAGrayValue(unsigned char ga[2]);

vtkUnsignedCharArray *GetS();

DESCRIPTION

vtkAGraymap is a concrete implementation of vtkColorScalars. vtkAGraymap represents scalars using one value for intensity (grayscale) and one value for alpha (opacity). The intensity and alpha values range between (0,255) (i.e., an unsigned char value).

If you use the method SetColor() (inherited from superclass vtkColorScalars) the rgba components are converted to intensity-alpha using the standard luminance equation Luminance = 0.30*red + 0.59*green + 0.11*blue.

SEE ALSO

vtkGraymap vtkPixmap vtkAPixmap vtkBitmap

SUMMARY

void SetColor(int i, unsigned char rgba[4])
Set a rgba color value at a particular array location. Does not do range checking. Make sure you use SetNumberOfColors() to allocate memory prior to using
SetColor().

void InsertColor(int i, unsigned char rgba[4])
Insert a rgba color value at a particular array location. Does range checking and will allocate additional memory if necessary.

int InsertNextColor(unsigned char rgba[4])
Insert a rgba color value at the next available slot in the array. Will allocate memory if necessary.

unsigned char *GetPointer(const int id)
Get pointer to array of data starting at data position "id". Form of data is a list of repeated intensity/alpha pairs.

unsigned char *WritePointer(const int id, const int number) Get pointer to data array. Useful for direct writes of data. MaxId is bumped by number (and memory allocated if necessary). Id is the location you wish to write into; number is the number of scalars to write.

unsigned char *GetColor(int id)
Return an unsigned char rgba color value for a particular point id.

void GetColor(int id, unsigned char rgba[4])
Copy rgba color value components into user provided array for specified point id.

vtkAGraymap& operator=(const vtkAGraymap& fs)
Deep copy of scalars.

unsigned char *GetAGrayValue(int id)
Return a unsigned char gray-alpha value for a particular point id.

void GetAGrayValue(int id, unsigned char ga[2])
Copy gray-alpha components into user provided array for specified point id.

void SetAGrayValue(int i, unsigned char ga[2])
Set a gray-alpha value at a particular array location.

Does not do range checking. Make sure you use SetNumberOfColors() to allocate memory prior to using this
method.

void InsertAGrayValue(int i, unsigned char ga[2])
Insert a gray-alpha value at a particular array location. Does range checking and will allocate additional memory if necessary.

int InsertNextAGrayValue(unsigned char ga[2])
Insert a gray-alpha value at the next available slot in the array. Will allocate memory if necessary.


Table of Contents