Man Page for vtkGraymap
Table of Contents

NAME

vtkGraymap - scalar data in grayscale form

SYNOPSIS


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

class VTK_EXPORT vtkGraymap : public vtkColorScalars

vtkGraymap();
vtkGraymap(const vtkGraymap& fs);
vtkGraymap(const int sz, const int ext=1000);
~vtkGraymap();
static vtkGraymap *New() {return new vtkGraymap;};
const char *GetClassName() {return "vtkGraymap";};
int Allocate(const int sz, const int ext=1000) {return this->S->Allocate(sz,ext);};
void Initialize() {this->S->Initialize();};
vtkScalars *MakeObject(int sze, int ext=1000);
int GetNumberOfScalars() {return (this->S->GetMaxId()+1);};
void Squeeze() {this->S->Squeeze();};
vtkGraymap &operator=(const vtkGraymap& fs);
void operator+=(const vtkGraymap& fs) {*(this->S) += *(fs.S);};
void Reset() {this->S->Reset();};
unsigned char *GetPointer(const int id);
void *GetVoidPtr(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 GetGrayValue(int id);
void SetGrayValue(int id, unsigned char g);
void InsertGrayValue(int id, unsigned char g);
int InsertNextGrayValue(unsigned char g);

vtkUnsignedCharArray *GetS();

DESCRIPTION

vtkGraymap is a concrete implementation of vtkScalars. Scalars are represented using a single unsigned char for components of gray. Gray values range from (0,255) with 0 being black.

SUMMARY

unsigned char *GetPointer(const int id)
Get pointer to array of data starting at data position "id".

void *GetVoidPtr(const int id)
Get pointer to array of data starting at data position "id" and return as a void pointer.

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.

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

unsigned char *GetColor(int id)
Return a rgba color for a particular point id. (Note: gray value converted into full rgba.)

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

void SetNumberOfColors(int number)
Specify the number of colors for this object to hold. Does an allocation as well as setting the MaxId ivar. Used in conjunction with SetColor() method for fast insertion.

void SetColor(int id, unsigned char rgba[4])
Insert gray value into object. No range checking performed (fast!). (Note: rgba color value converted to
grayscale.)

void SetGrayValue(int id, unsigned char g)
Insert gray value into object. No range checking performed (fast!). Make sure you use SetNumberOfColors()
to allocate memory prior to using SetColor().

void InsertColor(int id, unsigned char rgba[4])
Insert rgba color value into object. Range checking performed and memory allocated as necessary. (Note: rgba converted to gray value using luminance equation see text.)

int InsertNextColor(unsigned char rgba[4])
Insert rgba color value into next available slot. Returns point id of slot. (Note: rgba converted to gray value.)

unsigned char GetGrayValue(int id)
Return a gray value for a particular point id.

void InsertGrayValue(int id, unsigned char g)
Insert gray value into object. Range checking performed and memory allocated as necessary.

int InsertNextGrayValue(unsigned char g)
Insert gray value into next available slot. Returns point id of slot.


Table of Contents