gKit2 light
Loading...
Searching...
No Matches
ZBuffer Struct Reference

Public Member Functions

 ZBuffer (const int w, const int h, const float z=1)
void clear (const float value=1)
float & operator() (const int x, const int y)
 ZBuffer (const int w, const int h)
void clear (const float value=1)
float & operator() (const int x, const int y)

Public Attributes

std::vector< float > data
int width
int height

Detailed Description

Definition at line 18 of file pipeline.cpp.

Constructor & Destructor Documentation

◆ ZBuffer() [1/2]

ZBuffer::ZBuffer ( const int w,
const int h,
const float z = 1 )
inline

Definition at line 24 of file pipeline.cpp.

24: data(w*h, z), width(w), height(h) {}

◆ ZBuffer() [2/2]

ZBuffer::ZBuffer ( const int w,
const int h )
inline

Definition at line 21 of file pipeline3d.cpp.

22 {
23 width= w;
24 height= h;
25 data.assign(w * h, 1);
26 }

Member Function Documentation

◆ clear() [1/2]

void ZBuffer::clear ( const float value = 1)
inline

Definition at line 26 of file pipeline.cpp.

26{ data.assign(width * height, value); }

◆ operator()() [1/2]

float & ZBuffer::operator() ( const int x,
const int y )
inline

Definition at line 28 of file pipeline.cpp.

29 {
30 std::size_t offset= y * width + x;
31 return data[offset];
32 }

◆ clear() [2/2]

void ZBuffer::clear ( const float value = 1)
inline

Definition at line 28 of file pipeline3d.cpp.

29 {
30 data.assign(width * height, value);
31 }

◆ operator()() [2/2]

float & ZBuffer::operator() ( const int x,
const int y )
inline

Definition at line 33 of file pipeline3d.cpp.

34 {
35 const unsigned long int offset= y * width + x;
36 return data[offset];
37 }

Member Data Documentation

◆ data

std::vector< float > ZBuffer::data

Definition at line 20 of file pipeline.cpp.

◆ width

int ZBuffer::width

Definition at line 21 of file pipeline.cpp.

◆ height

int ZBuffer::height

Definition at line 22 of file pipeline.cpp.


The documentation for this struct was generated from the following files: