block.cpp - #include\"block.h#include\"cs221util\/HSLAPixel.h#include <vector> int width const Returns the width of the current block int Block:width const

block.cpp -...

This preview shows page 1 - 2 out of 2 pages.

#include "block.h" #include "cs221util/HSLAPixel.h" #include <vector> /** * int width() const; Returns the width of the current block. */ int Block::width() const { return data.size(); } /** * int height() const; Returns the height of the current block. */ int Block::height() const { // if (data.size() != 0) // { // return data[0].size(); // } // return 0; // } return data.at(0).size(); } void Block::greyscale() { for (unsigned x = 0; x < width(); x++) { for (unsigned y = 0; y < height(); y++) { data[x][y].s = 0; } } } void Block::build(PNG &im, int column, int width) { for (unsigned int x = column; x < width + column; x++) { vector<HSLAPixel> temp; for (unsigned int y = 0; y < im.height(); y++) { HSLAPixel *p = im.getPixel(x, y); temp.push_back(*p); } data.push_back(temp);
Image of page 1
Image of page 2

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture