block.cpp - #include\"block.h From im grabs the vertical strip of pixels whose upper left corner is at position(column,0 and whose width is width void

block.cpp - #include"block.h From im grabs the vertical...

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

#include "block.h"/*** From im, grabs the vertical strip of pixels whose* upper left corner is at position (column,0), and* whose width is width.*/void Block::build(PNG & im, int column, int width){int h = im.height();// first x,then y,copy verticallyfor (int i = column; i < column + width; i++) {vector<HSLAPixel> temp;for (int j = 0; j < h; j++) {HSLAPixel* p = im.getPixel(i, j);temp.push_back(*p);}data.push_back(temp);}return;};/*** Draws the current block at position (column,0) in im.*/void Block::render(PNG & im, int column) const {for (int i = column; i <column + width(); i++) {for (int j = 0; j < height(); j++) {
Background image
Background image

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture