CS488 PA6
Public Member Functions | Private Attributes | List of all members
PPMFrameBuffer Class Reference

#include <PPMFrameBuffer.h>

Inherits FrameBuffer.

Public Member Functions

 PPMFrameBuffer (int width, int height)
 
 ~PPMFrameBuffer ()
 
virtual void clear (const Color &color)
 
virtual int getHeight () const
 
virtual int getWidth () const
 
virtual void setPixel (int x, int y, const Color &color)
 
virtual void show ()
 

Private Attributes

Color ** pixel
 

Additional Inherited Members

- Protected Attributes inherited from FrameBuffer
int height
 
int width
 
int xMax
 
int xMin
 
int yMax
 
int yMin
 

Detailed Description

This encapsulation of a FrameBuffer writes a PPM file.

Constructor & Destructor Documentation

◆ PPMFrameBuffer()

PPMFrameBuffer::PPMFrameBuffer ( int  width,
int  height 
)

Explicit Value Constructor.

Parameters
widthThe width (in pixels) of the FrameBuffer
heightThe height (in pixels) of the FrameBuffer

◆ ~PPMFrameBuffer()

PPMFrameBuffer::~PPMFrameBuffer ( )

Destructor.

Member Function Documentation

◆ clear()

void PPMFrameBuffer::clear ( const Color color)
virtual

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

Parameters
colorThe color to clear to

Implements FrameBuffer.

◆ getHeight()

int PPMFrameBuffer::getHeight ( ) const
virtual

Get the height of this FrameBuffer in pixels.

Returns
The height

Implements FrameBuffer.

◆ getWidth()

int PPMFrameBuffer::getWidth ( ) const
virtual

Get the width of this FrameBuffer in pixels.

Returns
The width

Implements FrameBuffer.

◆ setPixel()

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

Set a particular pixel to a particular color.

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

Implements FrameBuffer.

◆ show()

void PPMFrameBuffer::show ( )
virtual

Show this FrameBuffer in the window.

Implements FrameBuffer.

Member Data Documentation

◆ pixel

Color** PPMFrameBuffer::pixel
private

The array of arrays of Color objects.


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