Example #1
0
	ImageData::ImageData(const string & filename, Array2D<Color4f> & rgbaBuffer) :
			filename(filename) {
		totalXRes = xRes = rgbaBuffer.getSizeX();
		totalYRes = yRes = rgbaBuffer.getSizeY();

		xOffset = yOffset = 0;
		gTable = GammaTable(1,1);

		color = new float[xRes*yRes*3];
		alpha = NULL;

		for (int x = 0; x < xRes; x++) {
			for (int y = 0; y < yRes; y++) {
				for (int i = 0; i < 3; i++) 
					color[3*(y*xRes+x)+i] = rgbaBuffer(x,yRes-y-1)[i];
			}
		}
	}
Example #2
0
	/**
	 * Get x size.
	 */
	SizeType getSizeX() const {
		return tileMap.getSizeX();
	}