//	PixelMap.cxx#include "PixelMap.h"PixelMap::PixelMap( const int pWidth, const int pHeight, const int pColors ): itsPalette(pColors < 256 ? pColors : 256){	// for now, allow no more than 256 colors!		itsWidth = pWidth;	itsHeight = pHeight;		itsQtyColors = pColors;	itsColorBits = 16;		// standard 16-bit color			itsBuffer = new unsigned char[pWidth*pHeight];		if (!itsBuffer) itsHeight = itsWidth = 0;		FillBox( 0,itsWidth, 0,itsHeight, 0);		// initialize it!}int PixelMap::SetPixel( const int pX, const int pY, const int pColor ){	if (IsGood(pX,pY)) {		itsBuffer[pX+pY*itsWidth] =				(pColor < itsPalette.itsSize ? pColor : itsPalette.itsSize-1 );		return 1;	}	return 0;}void PixelMap::FillBox( const int pX1, const int pX2, const int pY1, const int pY2,					const int pColor ){	int x1 = (pX1 > 0 ? pX1 : 0);	int x2 = (pX2 < itsWidth ? pX2 : itsWidth);	int y1 = (pY1 > 0 ? pY1 : 0);	int y2 = (pY2 < itsHeight ? pY2 : itsHeight);		for (int i=x1; i<x2; i++)		for (int j=y1; j<y2; j++)			SetPixel( i,j, pColor );}	
