Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MCP23017 TCS3472_I2C WattBob_TextLCD mbed
Block.cpp
- Committer:
- dreamselec
- Date:
- 2015-12-01
- Revision:
- 30:c0bc92d009fe
- Parent:
- 29:9c0339e3c593
- Child:
- 32:9a4046224b11
File content as of revision 30:c0bc92d009fe:
/*
* Block.cpp
*
* Created on: 16 Nov 2015
* Author: chandansiyag
*/
#include "Block.h"
Colour::Colour(){
setRed(0);
setBlue(0);
setGreen(0);
setAlpha(0);
}
Colour::~Colour(){
}
Colour::Colour(float components[4]){
for (int i = 0; i < sizeof(components)/sizeof(*components); i++){
this->components[i] = components[i];
}
}
Colour::Colour(const Colour& rhs){
setRed(rhs.getRed());
setBlue(rhs.getBlue());
setGreen(rhs.getGreen());
setAlpha(rhs.getAlpha());
}
void Colour::printDescription(){
// pc.printf("Red: %.3f, Green: %.3f, Blue: %.3f, Clear: %.3f\n", this->component[0], this->component[1], this->component[2], this->component[3]);
}
Block::Block(){
this->size = Small;
this->minColour = Colour();
this->averageColour = Colour();
this->maxColour = Colour();
this->colour = Block::Red;
// this->minError = {0, 0, 0, 0};
// this->maxError = {0, 0, 0, 0};
}
Block::Block(Size size, BlockColour blockColour){
this->minColour = Colour();
this->averageColour = Colour();
this->maxColour = Colour();
this->colour = blockColour;
this->size = size;
}
Block::Block(Size size) {
// TODO Auto-generated constructor stub
this->size = size;
this->minColour = Colour();
this->maxColour = Colour();
this->averageColour = Colour();
// this->minError = {0, 0, 0, 0};
// this->maxError = {0, 0, 0, 0};
}
Block::Block(Size size, Colour minColour, Colour maxColour, Colour averageColour){
this->size = size;
this->minColour = Colour(minColour);
this->maxColour = Colour(maxColour);
this->averageColour = Colour(averageColour);
// this->minError = {0, 0, 0, 0};
// this->maxError = {0, 0, 0, 0};
}
Block::Block(const Block& rhs){
minColour = Colour(rhs.minColour);
maxColour = Colour(rhs.maxColour);
averageColour = Colour(rhs.averageColour);
size = rhs.size;
// minError = rhs.minError;
// maxError = rhs.maxError;
}
Block::~Block() {
// TODO Auto-generated destructor stub
}
void Block::printDescription(){
}
