CS488 PA6
Public Member Functions | Protected Attributes | List of all members
FrameBuffer Class Referenceabstract

#include <FrameBuffer.h>

Inherited by PPMFrameBuffer, and SDLFrameBuffer.

Public Member Functions

virtual void clear (const Color &color)=0
 
virtual int getHeight () const =0
 
virtual int getWidth () const =0
 
virtual void setPixel (int x, int y, const Color &color)=0
 
virtual void show ()=0
 

Protected Attributes

int height
 
int width
 
int xMax
 
int xMin
 
int yMax
 
int yMin
 

Detailed Description

An encapsulation of a FrameBuffer that can be used to implement and test various 2D and 3D graphics algorithms.

A FrameBuffer uses traditional Euclidean coordinates, with the origin (0,0) at the center.

Member Function Documentation

◆ clear()

void FrameBuffer::clear ( const Color color)
pure virtual

Clear the FrameBuffer (i.e., set each pixel to the given Color).

Parameters
colorThe color to clear to

Implemented in SDLFrameBuffer, and PPMFrameBuffer.

◆ getHeight()

int FrameBuffer::getHeight ( ) const
pure virtual

Get the height of this FrameBuffer in pixels.

Returns
The height

Implemented in SDLFrameBuffer, and PPMFrameBuffer.

◆ getWidth()

int FrameBuffer::getWidth ( ) const
pure virtual

Get the width of this FrameBuffer in pixels.

Returns
The width

Implemented in SDLFrameBuffer, and PPMFrameBuffer.

◆ setPixel()

void FrameBuffer::setPixel ( int  x,
int  y,
const Color color 
)
pure virtual

Set a particular pixel to a particular color.

Parameters
xThe horizontal coordinate of the pixel
yThe vertical coordinate of the pixel
colorThe Color

Implemented in SDLFrameBuffer, and PPMFrameBuffer.

◆ show()

void FrameBuffer::show ( )
pure virtual

Show this FrameBuffer in the window.

Implemented in SDLFrameBuffer, and PPMFrameBuffer.

Member Data Documentation

◆ height

int FrameBuffer::height
protected

The height (in pixels).

◆ width

int FrameBuffer::width
protected

The width (in pixels).

◆ xMax

int FrameBuffer::xMax
protected

The largest horizontal index.

◆ xMin

int FrameBuffer::xMin
protected

The smallest horizontal index.

◆ yMax

int FrameBuffer::yMax
protected

The largest vertical index.

◆ yMin

int FrameBuffer::yMin
protected

The smallest vertical index.


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