Bridges-C++  3.4.2
Bridges(C++ API)
Public Member Functions | List of all members
bridges::datastructure::ColorGrid Class Reference

#include <ColorGrid.h>

Inheritance diagram for bridges::datastructure::ColorGrid:
bridges::datastructure::Grid< Color > bridges::datastructure::DataStructure

Detailed Description

This is a class in BRIDGES for representing an image.

Author
David Burlinson, Kalpathi Subramanian

There is a tutorial about ColorGrid : https://bridgesuncc.github.io/tutorials/Grid.html

Public Member Functions

virtual const string getDStype () const override
 Return the data structure type. More...
 
 ColorGrid ()
 
 ColorGrid (int rows, int cols)
 
 ColorGrid (int rows, int cols, Color color)
 
 ColorGrid (const ColorGrid &cg)
 
ColorGridoperator= (const ColorGrid &cg)
 
int getHeight ()
 
int getWidth ()
 
- Public Member Functions inherited from bridges::datastructure::Grid< Color >
 Grid (int rows, int cols)
 Grid constructor. More...
 
 Grid ()
 
 Grid (int *size)
 Grid constructor given size. More...
 
 Grid (const Grid &g)
 Grid constructor given an input grid. More...
 
virtual ~Grid ()
 
Gridoperator= (const Grid &g)
 
void setDimensions (int rows, int cols)
 Construct the grid given the dimensions. More...
 
int const * getDimensions ()
 Get dimenions of the grid. More...
 
Color const & get (int row, int col) const
 Get the (row, col) element in the grid. More...
 
void set (int row, int col, Color val)
 Set the grid value for the (row, col) element. More...
 
BracketHelperConst operator[] (int row) const
 provides the necessary abstraction to do something = grid[x][y]; More...
 
BracketHelper operator[] (int row)
 provides the necessary abstraction to do grid[x][y] = something; More...
 
- Public Member Functions inherited from bridges::datastructure::DataStructure
virtual ~DataStructure ()=default
 

Additional Inherited Members

- Protected Attributes inherited from bridges::datastructure::Grid< Color >
Color ** grid
 
int gridSize [2]
 
int maxGridSize [2]
 

Constructor & Destructor Documentation

◆ ColorGrid() [1/4]

bridges::datastructure::ColorGrid::ColorGrid ( )
inline

ColorGrid constructors

◆ ColorGrid() [2/4]

bridges::datastructure::ColorGrid::ColorGrid ( int  rows,
int  cols 
)
inline

Grid constructor with size arguments

Parameters
rowsthe number of rows of the grid
colsthe number of columns of the grid

◆ ColorGrid() [3/4]

bridges::datastructure::ColorGrid::ColorGrid ( int  rows,
int  cols,
Color  color 
)
inline

Grid constructor with size and color string argument

Parameters
rows- int representing the number of rows of the grid
cols- int representing the number of columns of the grid
color- Color object to use as default color

◆ ColorGrid() [4/4]

bridges::datastructure::ColorGrid::ColorGrid ( const ColorGrid cg)
inline

Copy Constructor

Member Function Documentation

◆ getDStype()

virtual const string bridges::datastructure::ColorGrid::getDStype ( ) const
inlineoverridevirtual

Return the data structure type.

Returns
grid type (string)

Reimplemented from bridges::datastructure::Grid< Color >.

◆ getHeight()

int bridges::datastructure::ColorGrid::getHeight ( )
inline

Get the height of the color grid

Returns
the height (number of rows) of the grid

◆ getWidth()

int bridges::datastructure::ColorGrid::getWidth ( )
inline

Get the width of the color grid

Returns
the width (number of columns) of the grid

◆ operator=()

ColorGrid& bridges::datastructure::ColorGrid::operator= ( const ColorGrid cg)
inline

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