// ------------------------------------------------------------------------- //

@interface SqPixels:Object
{
	int width;
	int height;
	unsigned char* pixels;
}

	-(id)initWidth:(int)aWidth height:(int)aHeight;
	-(id)free;
	
	-(int)width;
	-(int)height;
	-(int)depth;
	-(unsigned char*)pixels;
	
	-(void)paintRectAt:(int)left :(int)top size:(int)rWidth :(int)rHeight 
			withColor:(unsigned char)color;
	-(void)frameRectAt:(int)left :(int)top size:(int)rWidth :(int)rHeight 
			withColor:(unsigned char)color;
	-(void)drawString:(char*)string at:(int)left :(int)baseLine 
			withColor:(unsigned char)color;
	
@end // SqPixels.

// ------------------------------------------------------------------------- //

@implementation SqPixels

	-(id)initWidth:(int)aWidth height:(int)aHeight
	{
		if((aWidth<=0)||(aHeight<=0)){
			return(0);
		}
		self=[super init];
		if(self!=0){
			width=aWidth;
			height=aHeight;
			pixels=(unsigned char*)malloc(sizeof(unsigned char)*width*height);
			if(pixels==0){
				[self free];
				self=0;
			}else{
				[self paintRectAt:0:0 size:width:height withColor:0];
			}
		}
		return(self);
	}//init;
	
	
	-(id)free
	{
		if(pixels!=0){
			free(pixels);
		}
		return([super free]);
	}//free;
	
	
	-(int)width
	{
		return(width);
	}//width;
	
	
	-(int)height
	{
		return(height);
	}//height;
	
	
	-(int)depth
	{
		return(8);
	}//depth;
	
	
	-(unsigned char*)pixels
	{
		return(pixels);
	}//pixels;
	
	
	-(void)paintRectAt:(int)left :(int)top size:(int)rWidth :(int)rHeight
			withColor:(unsigned char)color;
	{
		int bottom=top+rHeight;
		int right=left+rWidth;
		register int maxY=bottom*width;
		register int y;
		for(y=top*width;y<maxY;y+=width){
			register int maxX=y+right;
			register int i;
			for(i=y+left;i<maxX;i++){
				pixels[i]=color;
			}
		}
	}//paintRectAt::size::withColor:;
	
	
	-(void)frameRectAt:(int)left :(int)top size:(int)rWidth :(int)rHeight 
			withColor:(unsigned char)color
	{
		int bottom=top+rHeight;
		int right=left+rWidth;
		register int maxX=top*width+right;
		register int maxY=bottom*width+left;
		register int i;
		register unsigned char* offset;
		if(bottom<top){
			return;
		}
		// horizontal lines:
		offset=pixels+(bottom-top)*width;
		for(i=top*width+left;i<maxX;i++){
			pixels[i]=color;
			offset[i]=color;
		}
		// vertical lines:
		offset=pixels+rWidth;
		for(i=top*width+left;i<maxY;i+=width){
			pixels[i]=color;
			offset[i]=color;
		}
	}//frameRectAt::size::withColor:;
	
	
#define CellWidth			(8)
#define CellHeight			(10)
#define CellBaseLine		(8)

	typedef unsigned short  CharCodeT;
	typedef CharCodeT		EncodingT[256/*unsigned char*/];
	typedef unsigned char   CharacterImageT[CellHeight];

	enum { //CharCodeT
		CC_delimiter,
				
		CC_mosaic00,
		CC_mosaic01,
		CC_mosaic02,
		CC_mosaic03,
		CC_mosaic04,
		CC_mosaic05,
		CC_mosaic06,
		CC_mosaic07,
		CC_mosaic08,
		CC_mosaic09,
		CC_mosaic10,
		CC_mosaic11,
		CC_mosaic12,
		CC_mosaic13,
		CC_mosaic14,
		CC_mosaic15,
		CC_mosaic16,
		CC_mosaic17,
		CC_mosaic18,
		CC_mosaic19,
		CC_mosaic20,
		CC_mosaic21,
		CC_mosaic22,
		CC_mosaic23,
		CC_mosaic24,
		CC_mosaic25,
		CC_mosaic26,
		CC_mosaic27,
		CC_mosaic28,
		CC_mosaic29,
		CC_mosaic30,
		CC_mosaic31,
		CC_mosaic32,
		CC_mosaic33,
		CC_mosaic34,
		CC_mosaic35,
		CC_mosaic36,
		CC_mosaic37,
		CC_mosaic38,
		CC_mosaic39,
		CC_mosaic40,
		CC_mosaic41,
		CC_mosaic42,
		CC_mosaic43,
		CC_mosaic44,
		CC_mosaic45,
		CC_mosaic46,
		CC_mosaic47,
		CC_mosaic48,
		CC_mosaic49,
		CC_mosaic50,
		CC_mosaic51,
		CC_mosaic52,
		CC_mosaic53,
		CC_mosaic54,
		CC_mosaic55,
		CC_mosaic56,
		CC_mosaic57,
		CC_mosaic58,
		CC_mosaic59,
		CC_mosaic60,
		CC_mosaic61,
		CC_mosaic62,
		CC_mosaic63,
		
		CC_disjmosaic00,
		CC_disjmosaic01,
		CC_disjmosaic02,
		CC_disjmosaic03,
		CC_disjmosaic04,
		CC_disjmosaic05,
		CC_disjmosaic06,
		CC_disjmosaic07,
		CC_disjmosaic08,
		CC_disjmosaic09,
		CC_disjmosaic10,
		CC_disjmosaic11,
		CC_disjmosaic12,
		CC_disjmosaic13,
		CC_disjmosaic14,
		CC_disjmosaic15,
		CC_disjmosaic16,
		CC_disjmosaic17,
		CC_disjmosaic18,
		CC_disjmosaic19,
		CC_disjmosaic20,
		CC_disjmosaic21,
		CC_disjmosaic22,
		CC_disjmosaic23,
		CC_disjmosaic24,
		CC_disjmosaic25,
		CC_disjmosaic26,
		CC_disjmosaic27,
		CC_disjmosaic28,
		CC_disjmosaic29,
		CC_disjmosaic30,
		CC_disjmosaic31,
		CC_disjmosaic32,
		CC_disjmosaic33,
		CC_disjmosaic34,
		CC_disjmosaic35,
		CC_disjmosaic36,
		CC_disjmosaic37,
		CC_disjmosaic38,
		CC_disjmosaic39,
		CC_disjmosaic40,
		CC_disjmosaic41,
		CC_disjmosaic42,
		CC_disjmosaic43,
		CC_disjmosaic44,
		CC_disjmosaic45,
		CC_disjmosaic46,
		CC_disjmosaic47,
		CC_disjmosaic48,
		CC_disjmosaic49,
		CC_disjmosaic50,
		CC_disjmosaic51,
		CC_disjmosaic52,
		CC_disjmosaic53,
		CC_disjmosaic54,
		CC_disjmosaic55,
		CC_disjmosaic56,
		CC_disjmosaic57,
		CC_disjmosaic58,
		CC_disjmosaic59,
		CC_disjmosaic60,
		CC_disjmosaic61,
		CC_disjmosaic62,
		CC_disjmosaic63,
		
		CC_A,
		CC_B,
		CC_C,
		CC_D,
		CC_E,
		CC_F,
		CC_G,
		CC_H,
		CC_I,
		CC_J,
		CC_K,
		CC_L,
		CC_M,
		CC_N,
		CC_O,
		CC_P,
		CC_Q,
		CC_R,
		CC_S,
		CC_T,
		CC_U,
		CC_V,
		CC_W,
		CC_X,
		CC_Y,
		CC_Z,
		CC_a,
		CC_b,
		CC_c,
		CC_d,
		CC_e,
		CC_f,
		CC_g,
		CC_h,
		CC_i,
		CC_j,
		CC_k,
		CC_l,
		CC_m,
		CC_n,
		CC_o,
		CC_p,
		CC_q,
		CC_r,
		CC_s,
		CC_t,
		CC_u,
		CC_v,
		CC_w,
		CC_x,
		CC_y,
		CC_z,
		
		CC_Acircumflex,
		CC_Ccedilla,
		CC_Eacute,
		CC_Egrave,
		CC_OE,
		CC_acircumflex,
		CC_adieresis,
		CC_agrave,
		CC_ccedilla,
		CC_eacute,
		CC_ecircumflex,
		CC_edieresis,
		CC_egrave,
		CC_icircumflex,
		CC_idieresis,
		CC_ocircumflex,
		CC_odieresis,
		CC_oe,
		CC_ucircumflex,
		CC_udieresis,
		CC_ugrave,
		
		CC_zero,
		CC_one,
		CC_two,
		CC_three,
		CC_four,
		CC_five,
		CC_six,
		CC_seven,
		CC_eight,
		CC_nine,
		
		CC_onequarter,
		CC_onehalf,
		CC_threequarters,
		
		CC_ampersand,
		CC_arrowdown,
		CC_arrowleft,
		CC_arrowright,
		CC_arrowup,
		CC_asciitilde,
		CC_asterisk,
		CC_at,
		CC_backslash,
		CC_barbottom,		// CC_underscore
		CC_barhorizontal,
		CC_barleft,
		CC_barright,
		CC_bartop,
		CC_barvertical,
		CC_braceleft,
		CC_braceright,
		CC_bracketleft,
		CC_bracketright,
		CC_colon,
		CC_comma,
		CC_divide,
		CC_dollar,
		CC_equal,
		CC_exclam,
		CC_germandbls,
		CC_greater,
		CC_minus,			// CC_hyphen
		CC_less,
		CC_numbersign,
		CC_paragraph,
		CC_parenleft,
		CC_parenright,
		CC_percent,
		CC_period,
		CC_plus,
		CC_plusminus,
		CC_question,
		CC_quotedbl,
		CC_quoteright,
		CC_quotesingle,
		CC_ring,
		CC_semicolon,
		CC_slash,
		CC_sterling,
		
		CC_space,
		CC_obliteration
	};//enum CharCodeT;
	
	static CharacterImageT FontGen[]=
	{
		{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},//CC_delimiter

		{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},//CC_mosaic00
		{0x0F,0x0F,0x0F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},//CC_mosaic01
		{0xF0,0xF0,0xF0,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},//CC_mosaic02
		{0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},//CC_mosaic03
		{0xFF,0xFF,0xFF,0x0F,0x0F,0x0F,0x0F,0xFF,0xFF,0xFF},//CC_mosaic04
		{0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0xFF,0xFF,0xFF},//CC_mosaic05
		{0xF0,0xF0,0xF0,0x0F,0x0F,0x0F,0x0F,0xFF,0xFF,0xFF},//CC_mosaic06
		{0x00,0x00,0x00,0x0F,0x0F,0x0F,0x0F,0xFF,0xFF,0xFF},//CC_mosaic07
		{0xFF,0xFF,0xFF,0xF0,0xF0,0xF0,0xF0,0xFF,0xFF,0xFF},//CC_mosaic08
		{0x0F,0x0F,0x0F,0xF0,0xF0,0xF0,0xF0,0xFF,0xFF,0xFF},//CC_mosaic09
		{0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xFF,0xFF,0xFF},//CC_mosaic10
		{0x00,0x00,0x00,0xF0,0xF0,0xF0,0xF0,0xFF,0xFF,0xFF},//CC_mosaic11
		{0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF},//CC_mosaic12
		{0x0F,0x0F,0x0F,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF},//CC_mosaic13
		{0xF0,0xF0,0xF0,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF},//CC_mosaic14
		{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF},//CC_mosaic15
		{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x0F,0x0F,0x0F},//CC_mosaic16
		{0x0F,0x0F,0x0F,0xFF,0xFF,0xFF,0xFF,0x0F,0x0F,0x0F},//CC_mosaic17
		{0xF0,0xF0,0xF0,0xFF,0xFF,0xFF,0xFF,0x0F,0x0F,0x0F},//CC_mosaic18
		{0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x0F,0x0F,0x0F},//CC_mosaic19
		{0xFF,0xFF,0xFF,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F},//CC_mosaic20
		{0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F},//CC_mosaic21
		{0xF0,0xF0,0xF0,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F},//CC_mosaic22
		{0x00,0x00,0x00,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F},//CC_mosaic23
		{0xFF,0xFF,0xFF,0xF0,0xF0,0xF0,0xF0,0x0F,0x0F,0x0F},//CC_mosaic24
		{0x0F,0x0F,0x0F,0xF0,0xF0,0xF0,0xF0,0x0F,0x0F,0x0F},//CC_mosaic25
		{0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0x0F,0x0F,0x0F},//CC_mosaic26
		{0x00,0x00,0x00,0xF0,0xF0,0xF0,0xF0,0x0F,0x0F,0x0F},//CC_mosaic27
		{0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x0F,0x0F,0x0F},//CC_mosaic28
		{0x0F,0x0F,0x0F,0x00,0x00,0x00,0x00,0x0F,0x0F,0x0F},//CC_mosaic29
		{0xF0,0xF0,0xF0,0x00,0x00,0x00,0x00,0x0F,0x0F,0x0F},//CC_mosaic30
		{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x0F,0x0F},//CC_mosaic31
		{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF0,0xF0,0xF0},//CC_mosaic32
		{0x0F,0x0F,0x0F,0xFF,0xFF,0xFF,0xFF,0xF0,0xF0,0xF0},//CC_mosaic33
		{0xF0,0xF0,0xF0,0xFF,0xFF,0xFF,0xFF,0xF0,0xF0,0xF0},//CC_mosaic34
		{0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xF0,0xF0,0xF0},//CC_mosaic35
		{0xFF,0xFF,0xFF,0x0F,0x0F,0x0F,0x0F,0xF0,0xF0,0xF0},//CC_mosaic36
		{0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0xF0,0xF0,0xF0},//CC_mosaic37
		{0xF0,0xF0,0xF0,0x0F,0x0F,0x0F,0x0F,0xF0,0xF0,0xF0},//CC_mosaic38
		{0x00,0x00,0x00,0x0F,0x0F,0x0F,0x0F,0xF0,0xF0,0xF0},//CC_mosaic39
		{0xFF,0xFF,0xFF,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0},//CC_mosaic40
		{0x0F,0x0F,0x0F,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0},//CC_mosaic41
		{0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0},//CC_mosaic42
		{0x00,0x00,0x00,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0},//CC_mosaic43
		{0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0xF0,0xF0,0xF0},//CC_mosaic44
		{0x0F,0x0F,0x00,0x00,0x00,0x00,0x00,0xF0,0xF0,0xF0},//CC_mosaic45
		{0xF0,0xF0,0x00,0x00,0x00,0x00,0x00,0xF0,0xF0,0xF0},//CC_mosaic46
		{0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0xF0,0xF0,0xF0},//CC_mosaic47
		{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00},//CC_mosaic48
		{0x0F,0x0F,0x0F,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00},//CC_mosaic49
		{0xF0,0xF0,0xF0,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00},//CC_mosaic50
		{0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00},//CC_mosaic51
		{0xFF,0xFF,0xFF,0x0F,0x0F,0x0F,0x0F,0x00,0x00,0x00},//CC_mosaic52
		{0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x00,0x00,0x00},//CC_mosaic53
		{0xF0,0xF0,0xF0,0x0F,0x0F,0x0F,0x0F,0x00,0x00,0x00},//CC_mosaic54
		{0x00,0x00,0x00,0x0F,0x0F,0x0F,0x0F,0x00,0x00,0x00},//CC_mosaic55
		{0xFF,0xFF,0xFF,0xF0,0xF0,0xF0,0xF0,0x00,0x00,0x00},//CC_mosaic56
		{0x0F,0x0F,0x0F,0xF0,0xF0,0xF0,0xF0,0x00,0x00,0x00},//CC_mosaic57
		{0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0x00,0x00,0x00},//CC_mosaic58
		{0x00,0x00,0x00,0xF0,0xF0,0xF0,0xF0,0x00,0x00,0x00},//CC_mosaic59
		{0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00},//CC_mosaic60
		{0x0F,0x0F,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00},//CC_mosaic61
		{0xF0,0xF0,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00},//CC_mosaic62
		{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},//CC_mosaic63
		
		{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},//CC_disjmosaic00
		{0x8F,0x8F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},//CC_disjmosaic01
		{0xF8,0xF8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},//CC_disjmosaic02
		{0x88,0x88,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},//CC_disjmosaic03
		{0xFF,0xFF,0xFF,0x8F,0x8F,0x8F,0xFF,0xFF,0xFF,0xFF},//CC_disjmosaic04
		{0x8F,0x8F,0xFF,0x8F,0x8F,0x8F,0xFF,0xFF,0xFF,0xFF},//CC_disjmosaic05
		{0xF8,0xF8,0xFF,0x8F,0x8F,0x8F,0xFF,0xFF,0xFF,0xFF},//CC_disjmosaic06
		{0x88,0x88,0xFF,0x8F,0x8F,0x8F,0xFF,0xFF,0xFF,0xFF},//CC_disjmosaic07
		{0xFF,0xFF,0xFF,0xF8,0xF8,0xF8,0xFF,0xFF,0xFF,0xFF},//CC_disjmosaic08
		{0x8F,0x8F,0xFF,0xF8,0xF8,0xF8,0xFF,0xFF,0xFF,0xFF},//CC_disjmosaic09
		{0xF8,0xF8,0xFF,0xF8,0xF8,0xF8,0xFF,0xFF,0xFF,0xFF},//CC_disjmosaic10
		{0x88,0x88,0xFF,0xF8,0xF8,0xF8,0xFF,0xFF,0xFF,0xFF},//CC_disjmosaic11
		{0xFF,0xFF,0xFF,0x88,0x88,0x88,0xFF,0xFF,0xFF,0xFF},//CC_disjmosaic12
		{0x8F,0x8F,0xFF,0x88,0x88,0x88,0xFF,0xFF,0xFF,0xFF},//CC_disjmosaic13
		{0xF8,0xF8,0xFF,0x88,0x88,0x88,0xFF,0xFF,0xFF,0xFF},//CC_disjmosaic14
		{0x88,0x88,0xFF,0x88,0x88,0x88,0xFF,0xFF,0xFF,0xFF},//CC_disjmosaic15
		{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x8F,0x8F,0xFF},//CC_disjmosaic16
		{0x8F,0x8F,0xFF,0xFF,0xFF,0xFF,0xFF,0x8F,0x8F,0xFF},//CC_disjmosaic17
		{0xF8,0xF8,0xFF,0xFF,0xFF,0xFF,0xFF,0x8F,0x8F,0xFF},//CC_disjmosaic18
		{0x88,0x88,0xFF,0xFF,0xFF,0xFF,0xFF,0x8F,0x8F,0xFF},//CC_disjmosaic19
		{0xFF,0xFF,0xFF,0x8F,0x8F,0x8F,0xFF,0x8F,0x8F,0xFF},//CC_disjmosaic20
		{0x8F,0x8F,0xFF,0x8F,0x8F,0x8F,0xFF,0x8F,0x8F,0xFF},//CC_disjmosaic21
		{0xF8,0xF8,0xFF,0x8F,0x8F,0x8F,0xFF,0x8F,0x8F,0xFF},//CC_disjmosaic22
		{0x88,0x88,0xFF,0x8F,0x8F,0x8F,0xFF,0x8F,0x8F,0xFF},//CC_disjmosaic23
		{0xFF,0xFF,0xFF,0xF8,0xF8,0xF8,0xFF,0x8F,0x8F,0xFF},//CC_disjmosaic24
		{0x8F,0x8F,0xFF,0xF8,0xF8,0xF8,0xFF,0x8F,0x8F,0xFF},//CC_disjmosaic25
		{0xF8,0xF8,0xFF,0xF8,0xF8,0xF8,0xFF,0x8F,0x8F,0xFF},//CC_disjmosaic26
		{0x88,0x88,0xFF,0xF8,0xF8,0xF8,0xFF,0x8F,0x8F,0xFF},//CC_disjmosaic27
		{0xFF,0xFF,0xFF,0x88,0x88,0x88,0xFF,0x8F,0x8F,0xFF},//CC_disjmosaic28
		{0x8F,0x8F,0xFF,0x88,0x88,0x88,0xFF,0x8F,0x8F,0xFF},//CC_disjmosaic29
		{0xF8,0xF8,0xFF,0x88,0x88,0x88,0xFF,0x8F,0x8F,0xFF},//CC_disjmosaic30
		{0x88,0x88,0xFF,0x88,0x88,0x88,0xFF,0x8F,0x8F,0xFF},//CC_disjmosaic31
		{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF8,0xF8,0xFF},//CC_disjmosaic32
		{0x8F,0x8F,0xFF,0xFF,0xFF,0xFF,0xFF,0xF8,0xF8,0xFF},//CC_disjmosaic33
		{0xF8,0xF8,0xFF,0xFF,0xFF,0xFF,0xFF,0xF8,0xF8,0xFF},//CC_disjmosaic34
		{0x88,0x88,0xFF,0xFF,0xFF,0xFF,0xFF,0xF8,0xF8,0xFF},//CC_disjmosaic35
		{0xFF,0xFF,0xFF,0x8F,0x8F,0x8F,0xFF,0xF8,0xF8,0xFF},//CC_disjmosaic36
		{0x8F,0x8F,0xFF,0x8F,0x8F,0x8F,0xFF,0xF8,0xF8,0xFF},//CC_disjmosaic37
		{0xF8,0xF8,0xFF,0x8F,0x8F,0x8F,0xFF,0xF8,0xF8,0xFF},//CC_disjmosaic38
		{0x88,0x88,0xFF,0x8F,0x8F,0x8F,0xFF,0xF8,0xF8,0xFF},//CC_disjmosaic39
		{0xFF,0xFF,0xFF,0xF8,0xF8,0xF8,0xFF,0xF8,0xF8,0xFF},//CC_disjmosaic40
		{0x8F,0x8F,0xFF,0xF8,0xF8,0xF8,0xFF,0xF8,0xF8,0xFF},//CC_disjmosaic41
		{0xF8,0xF8,0xFF,0xF8,0xF8,0xF8,0xFF,0xF8,0xF8,0xFF},//CC_disjmosaic42
		{0x88,0x88,0xFF,0xF8,0xF8,0xF8,0xFF,0xF8,0xF8,0xFF},//CC_disjmosaic43
		{0xFF,0xFF,0xFF,0x88,0x88,0x88,0xFF,0xF8,0xF8,0xFF},//CC_disjmosaic44
		{0x8F,0x8F,0xFF,0x88,0x88,0x88,0xFF,0xF8,0xF8,0xFF},//CC_disjmosaic45
		{0xF8,0xF8,0xFF,0x88,0x88,0x88,0xFF,0xF8,0xF8,0xFF},//CC_disjmosaic46
		{0x88,0x88,0xFF,0x88,0x88,0x88,0xFF,0xF8,0xF8,0xFF},//CC_disjmosaic47
		{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x88,0x88,0xFF},//CC_disjmosaic48
		{0x8F,0x8F,0xFF,0xFF,0xFF,0xFF,0xFF,0x88,0x88,0xFF},//CC_disjmosaic49
		{0xF8,0xF8,0xFF,0xFF,0xFF,0xFF,0xFF,0x88,0x88,0xFF},//CC_disjmosaic50
		{0x88,0x88,0xFF,0xFF,0xFF,0xFF,0xFF,0x88,0x88,0xFF},//CC_disjmosaic51
		{0xFF,0xFF,0xFF,0x8F,0x8F,0x8F,0xFF,0x88,0x88,0xFF},//CC_disjmosaic52
		{0x8F,0x8F,0xFF,0x8F,0x8F,0x8F,0xFF,0x88,0x88,0xFF},//CC_disjmosaic53
		{0xF8,0xF8,0xFF,0x8F,0x8F,0x8F,0xFF,0x88,0x88,0xFF},//CC_disjmosaic54
		{0x88,0x88,0xFF,0x8F,0x8F,0x8F,0xFF,0x88,0x88,0xFF},//CC_disjmosaic55
		{0xFF,0xFF,0xFF,0xF8,0xF8,0xF8,0xFF,0x88,0x88,0xFF},//CC_disjmosaic56
		{0x8F,0x8F,0xFF,0xF8,0xF8,0xF8,0xFF,0x88,0x88,0xFF},//CC_disjmosaic57
		{0xF8,0xF8,0xFF,0xF8,0xF8,0xF8,0xFF,0x88,0x88,0xFF},//CC_disjmosaic58
		{0x88,0x88,0xFF,0xF8,0xF8,0xF8,0xFF,0x88,0x88,0xFF},//CC_disjmosaic59
		{0xFF,0xFF,0xFF,0x88,0x88,0x88,0xFF,0x88,0x88,0xFF},//CC_disjmosaic60
		{0x8F,0x8F,0xFF,0x88,0x88,0x88,0xFF,0x88,0x88,0xFF},//CC_disjmosaic61
		{0xF8,0xF8,0xFF,0x88,0x88,0x88,0xFF,0x88,0x88,0xFF},//CC_disjmosaic62
		{0x88,0x88,0xFF,0x88,0x88,0x88,0xFF,0x88,0x88,0xFF},//CC_disjmosaic63
		
		{0xFF,0xC7,0xBB,0xBB,0xBB,0x83,0xBB,0xBB,0xFF,0xFF},//CC_A
		{0xFF,0x87,0xBB,0xBB,0x87,0xBB,0xBB,0x87,0xFF,0xFF},//CC_B
		{0xFF,0xC7,0xBB,0xBF,0xBF,0xBF,0xBB,0xC7,0xFF,0xFF},//CC_C
		{0xFF,0x87,0xBB,0xBB,0xBB,0xBB,0xBB,0x87,0xFF,0xFF},//CC_D
		{0xFF,0x83,0xBF,0xBF,0x8F,0xBF,0xBF,0x83,0xFF,0xFF},//CC_E
		{0xFF,0x83,0xBF,0xBF,0x8F,0xBF,0xBF,0xBF,0xFF,0xFF},//CC_F
		{0xFF,0xC7,0xBB,0xBF,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xCB,0xB3,0xBB,0xB3,0xCB,0xFF,0xFF},//CC_agrave
		{0xFF,0xFF,0xFF,0xC7,0xBF,0xBF,0xBF,0xC7,0xEF,0xDF},//CC_ccedilla
		{0xFF,0xF7,0xEF,0xC7,0xBB,0x83,0xBF,0xC7,0xFF,0xFF},//CC_eacute
		{0xFF,0xEF,0xD7,0xC7,0xBB,0x83,0xBF,0xC7,0xFF,0xFF},//CC_ecircumflex
		{0xFF,0xD7,0xFF,0xC7,0xBB,0x83,0xBF,0xC7,0xFF,0xFF},//CC_edieresis
		{0xFF,0xDF,0xEF,0xC7,0xBB,0x83,0xBF,0xC7,0xFF,0xFF},//CC_egrave
		{0xFF,0xEF,0xD7,0xFF,0xCF,0xEF,0xEF,0xC7,0xFF,0xFF},//CC_icircumflex
		{0xFF,0xD7,0xFF,0xCF,0xEF,0xEF,0xEF,0xC7,0xFF,0xFF},//CC_idieresis
		{0xFF,0xEF,0xD7,0xFF,0xC7,0xBB,0xBB,0xC7,0xFF,0xFF},//CC_ocircumflex
		{0xFF,0xD7,0xFF,0xC7,0xBB,0xBB,0xBB,0xC7,0xFF,0xFF},//CC_odieresis
		{0xFF,0xFF,0xFF,0xC3,0xAD,0xA1,0xAF,0xC1,0xFF,0xFF},//CC_oe
		{0xFF,0xEF,0xD7,0xFF,0xBB,0xBB,0xB3,0xCB,0xFF,0xFF},//CC_ucircumflex
		{0xFF,0xFF,0xD7,0xFF,0xB7,0xB7,0xB7,0xCB,0xFF,0xFF},//CC_udieresis
		{0xFF,0xBF,0xCF,0xFF,0xB7,0xB7,0xB7,0xCB,0xFF,0xFF},//CC_ugrave
		
		{0xFF,0xEF,0xD7,0xBB,0xBB,0xBB,0xD7,0xEF,0xFF,0xFF},//CC_zero
		{0xFF,0xEF,0xCF,0xEF,0xEF,0xEF,0xEF,0xEF,0xFF,0xFF},//CC_one
		{0xFF,0xC7,0xBB,0xFB,0xE7,0xDF,0xBF,0x83,0xFF,0xFF},//CC_two
		{0xFF,0x83,0xFB,0xF7,0xE7,0xFB,0xBB,0xC7,0xFF,0xFF},//CC_three
		{0xFF,0xF7,0xE7,0xD7,0xB7,0x83,0xF7,0xF7,0xFF,0xFF},//CC_four
		{0xFF,0x83,0xBF,0x87,0xFB,0xFB,0xBB,0xC7,0xFF,0xFF},//CC_five
		{0xFF,0xE7,0xDF,0xBF,0x87,0xBB,0xBB,0xC7,0xFF,0xFF},//CC_six
		{0xFF,0x83,0xFB,0xF7,0xEF,0xDF,0xDF,0xDF,0xFF,0xFF},//CC_seven
		{0xFF,0xC7,0xBB,0xBB,0xC7,0xBB,0xBB,0xC7,0xFF,0xFF},//CC_eight
		{0xFF,0xC7,0xBB,0xBB,0xC3,0xFB,0xFB,0xC7,0xFF,0xFF},//CC_nine
		
		{0xFF,0xBF,0x3F,0xBF,0xBB,0xF3,0xEB,0xC1,0xFB,0xFF},//CC_onequarter
		{0xFF,0xBF,0x3F,0xBF,0xB3,0xED,0xFB,0xF7,0xE1,0xFF},//CC_onehalf
		{0xFF,0x1F,0xDF,0xBF,0xDB,0x33,0xEB,0xC1,0xFB,0xFF},//CC_threequarters

		{0xFF,0xDF,0xAF,0xAF,0xDF,0xAB,0xB7,0xCB,0xFF,0xFF},//CC_ampersand
		{0xEF,0xEF,0xEF,0xEF,0xEF,0xEF,0xAB,0xC7,0xEF,0xFF},//CC_arrowdown
		{0xFF,0xFF,0xEF,0xDF,0x80,0xDF,0xEF,0xFF,0xFF,0xFF},//CC_arrowleft
		{0xFF,0xFF,0xF7,0xFB,0x01,0xFB,0xF7,0xFF,0xFF,0xFF},//CC_arrowright
		{0xFF,0xEF,0xC7,0xAB,0xEF,0xEF,0xEF,0xEF,0xEF,0xEF},//CC_arrowup
		{0xFF,0xFF,0xFF,0xDF,0xAB,0xF7,0xFF,0xFF,0xFF,0xFF},//CC_asciitilde
		{0xFF,0xEF,0xAB,0xC7,0xEF,0xC7,0xAB,0xEF,0xFF,0xFF},//CC_asterisk
		{0xFF,0xC7,0xBB,0xA3,0xAB,0xA3,0xBF,0xC7,0xFF,0xFF},//CC_at
		{0x7F,0xBF,0xBF,0xDF,0xEF,0xF7,0xFB,0xFB,0xFD,0xFE},//CC_backslash
		{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00},//CC_barbottom
		{0xFF,0xFF,0xFF,0xFF,0x00,0xFF,0xFF,0xFF,0xFF,0xFF},//CC_barhorizontal
		{0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F},//CC_barleft
		{0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE},//CC_barright
		{0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},//CC_bartop
		{0xEF,0xEF,0xEF,0xEF,0xEF,0xEF,0xEF,0xEF,0xEF,0xEF},//CC_barvertical
		{0xFF,0xE7,0xEF,0xEF,0xDF,0xEF,0xEF,0xE7,0xFF,0xFF},//CC_braceleft
		{0xFF,0xF3,0xFB,0xFB,0xFD,0xFB,0xFB,0xF3,0xFF,0xFF},//CC_braceright
		{0xFF,0xE3,0xEF,0xEF,0xEF,0xEF,0xEF,0xE3,0xFF,0xFF},//CC_bracketleft
		{0xFF,0xC7,0xF7,0xF7,0xF7,0xF7,0xF7,0xC7,0xFF,0xFF},//CC_bracketright
		{0xFF,0xFF,0xFF,0xEF,0xFF,0xFF,0xFF,0xEF,0xFF,0xFF},//CC_colon
		{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xEF,0xEF,0xDF,0xFF},//CC_comma
		{0xFF,0xFF,0xEF,0xFF,0x83,0xFF,0xEF,0xFF,0xFF,0xFF},//CC_divide
		{0xFF,0xEF,0xC7,0xAF,0xC7,0xEB,0xAB,0xC7,0xEF,0xFF},//CC_dollar
		{0xFF,0xFF,0xFF,0x83,0xFF,0x83,0xFF,0xFF,0xFF,0xFF},//CC_equal
		{0xFF,0xEF,0xEF,0xEF,0xEF,0xEF,0xFF,0xEF,0xFF,0xFF},//CC_exclam
		{0xFF,0x87,0xBB,0xA7,0xBB,0xBB,0xA7,0xBF,0xBF,0xFF},//CC_germandbls
		{0xFF,0xBF,0xDF,0xEF,0xF7,0xEF,0xDF,0xBF,0xFF,0xFF},//CC_greater
		{0xFF,0xFF,0xFF,0xFF,0xFF,0x83,0xFF,0xFF,0xFF,0xFF},//CC_minus
		{0xFF,0xF7,0xEF,0xDF,0xBF,0xDF,0xEF,0xF7,0xFF,0xFF},//CC_less
		{0xFF,0xFF,0xD7,0x83,0xD7,0x83,0xD7,0xFF,0xFF,0xFF},//CC_numbersign
		{0xFF,0xC7,0xBF,0xC7,0xBB,0xC7,0xFB,0xC7,0xFF,0xFF},//CC_paragraph
		{0xFF,0xEF,0xDF,0xBF,0xBF,0xBF,0xDF,0xEF,0xFF,0xFF},//CC_parenleft
		{0xFF,0xEF,0xF7,0xFB,0xFB,0xFB,0xF7,0xEF,0xFF,0xFF},//CC_parenright
		{0xFF,0x9F,0x9B,0xF7,0xEF,0xDF,0xB3,0xF3,0xFF,0xFF},//CC_percent
		{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xEF,0xFF,0xFF},//CC_period
		{0xFF,0xFF,0xEF,0xEF,0x83,0xEF,0xEF,0xFF,0xFF,0xFF},//CC_plus
		{0xFF,0xEF,0xEF,0x83,0xEF,0xEF,0xFF,0x83,0xFF,0xFF},//CC_plusminus
		{0xFF,0xC7,0xBB,0xFB,0xF7,0xEF,0xFF,0xEF,0xFF,0xFF},//CC_question
		{0xFF,0xD7,0xD7,0xD7,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},//CC_quotedbl
		{0xFF,0xEF,0xEF,0xDF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},//CC_quoteright
		{0xFF,0xEF,0xEF,0xEF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},//CC_quotesingle
		{0xFF,0xCF,0xB7,0xCF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},//CC_ring
		{0xFF,0xFF,0xFF,0xEF,0xFF,0xFF,0xEF,0xEF,0xDF,0xFF},//CC_semicolon
		{0xFE,0xFD,0xFD,0xFB,0xF7,0xEF,0xDF,0xDF,0xBF,0x7F},//CC_slash
		{0xFF,0xEF,0xD7,0xDF,0x8F,0xDF,0xB7,0x87,0xFF,0xFF},//CC_sterling
		
		{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},//CC_space
		{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},//CC_obliteration

		{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}
	};//FontGen;

	static EncodingT		Encoding={
CC_obliteration,	CC_obliteration,	CC_obliteration,	CC_obliteration,	
CC_obliteration,	CC_obliteration,	CC_obliteration,	CC_obliteration,	
CC_obliteration,	CC_obliteration,	CC_obliteration,	CC_obliteration,	
CC_obliteration,	CC_obliteration,	CC_obliteration,	CC_obliteration,	

CC_obliteration,	CC_obliteration,	CC_obliteration,	CC_obliteration,	
CC_obliteration,	CC_obliteration,	CC_obliteration,	CC_obliteration,	
CC_obliteration,	CC_obliteration,	CC_obliteration,	CC_obliteration,	
CC_obliteration,	CC_obliteration,	CC_obliteration,	CC_obliteration,	

CC_space,			CC_exclam,			CC_quotedbl,		CC_numbersign,
CC_dollar,			CC_percent,			CC_ampersand,		CC_quoteright,
CC_parenleft,		CC_parenright,		CC_asterisk,		CC_plus,
CC_comma,			CC_minus,			CC_period,			CC_slash,		

CC_zero,			CC_one,				CC_two,				CC_three,
CC_four,			CC_five,			CC_six,				CC_seven,		
CC_eight,			CC_nine,			CC_colon,			CC_semicolon,		
CC_less,			CC_equal,			CC_greater,			CC_question,		

CC_at,				CC_A,				CC_B,				CC_C,		
CC_D,				CC_E,				CC_F,				CC_G,		
CC_H,				CC_I,				CC_J,				CC_K,		
CC_L,				CC_M,				CC_N,				CC_O,		

CC_P,				CC_Q,				CC_R,				CC_S,		
CC_T,				CC_U,				CC_V,				CC_W,		
CC_X,				CC_Y,				CC_Z,				CC_bracketleft,		
CC_backslash,		CC_bracketright,	CC_arrowup,			CC_barbottom,		

CC_barhorizontal,	CC_a,				CC_b,				CC_c,		
CC_d,				CC_e,				CC_f,				CC_g,		
CC_h,				CC_i,				CC_j,				CC_k,		
CC_l,				CC_m,				CC_n,				CC_o,		

CC_p,				CC_q,				CC_r,				CC_s,		
CC_t,				CC_u,				CC_v,				CC_w,		
CC_x,				CC_y,				CC_z,				CC_barleft,
CC_barvertical,		CC_barright,		CC_bartop,			CC_obliteration,


CC_mosaic00,		CC_mosaic01,		CC_mosaic02,		CC_mosaic03,		
CC_mosaic04,		CC_mosaic05,		CC_mosaic06,		CC_mosaic07,		
CC_mosaic08,		CC_mosaic09,		CC_mosaic10,		CC_mosaic11,		
CC_mosaic12,		CC_mosaic13,		CC_mosaic14,		CC_mosaic15,		

CC_mosaic16,		CC_mosaic17,		CC_mosaic18,		CC_mosaic19,		
CC_mosaic20,		CC_mosaic21,		CC_mosaic22,		CC_mosaic23,		
CC_mosaic24,		CC_mosaic25,		CC_mosaic26,		CC_mosaic27,		
CC_mosaic28,		CC_mosaic29,		CC_mosaic30,		CC_mosaic31,		

CC_mosaic32,		CC_mosaic33,		CC_mosaic34,		CC_mosaic35,		
CC_mosaic36,		CC_mosaic37,		CC_mosaic38,		CC_mosaic39,		
CC_mosaic40,		CC_mosaic41,		CC_mosaic42,		CC_mosaic43,		
CC_mosaic44,		CC_mosaic45,		CC_mosaic46,		CC_mosaic47,		

CC_mosaic48,		CC_mosaic49,		CC_mosaic50,		CC_mosaic51,		
CC_mosaic52,		CC_mosaic53,		CC_mosaic54,		CC_mosaic55,		
CC_mosaic56,		CC_mosaic57,		CC_mosaic58,		CC_mosaic59,		
CC_mosaic60,		CC_mosaic61,		CC_mosaic62,		CC_mosaic63,		

CC_disjmosaic00,	CC_disjmosaic01,	CC_disjmosaic02,	CC_disjmosaic03,	
CC_disjmosaic04,	CC_disjmosaic05,	CC_disjmosaic06,	CC_disjmosaic07,	
CC_disjmosaic08,	CC_disjmosaic09,	CC_disjmosaic10,	CC_disjmosaic11,	
CC_disjmosaic12,	CC_disjmosaic13,	CC_disjmosaic14,	CC_disjmosaic15,	

CC_disjmosaic16,	CC_disjmosaic17,	CC_disjmosaic18,	CC_disjmosaic19,	
CC_disjmosaic20,	CC_disjmosaic21,	CC_disjmosaic22,	CC_disjmosaic23,	
CC_disjmosaic24,	CC_disjmosaic25,	CC_disjmosaic26,	CC_disjmosaic27,	
CC_disjmosaic28,	CC_disjmosaic29,	CC_disjmosaic30,	CC_disjmosaic31,	

CC_disjmosaic32,	CC_disjmosaic33,	CC_disjmosaic34,	CC_disjmosaic35,	
CC_disjmosaic36,	CC_disjmosaic37,	CC_disjmosaic38,	CC_disjmosaic39,	
CC_disjmosaic40,	CC_disjmosaic41,	CC_disjmosaic42,	CC_disjmosaic43,	
CC_disjmosaic44,	CC_disjmosaic45,	CC_disjmosaic46,	CC_disjmosaic47,	

CC_disjmosaic48,	CC_disjmosaic49,	CC_disjmosaic50,	CC_disjmosaic51,	
CC_disjmosaic52,	CC_disjmosaic53,	CC_disjmosaic54,	CC_disjmosaic55,	
CC_disjmosaic56,	CC_disjmosaic57,	CC_disjmosaic58,	CC_disjmosaic59,	
CC_disjmosaic60,	CC_disjmosaic61,	CC_disjmosaic62,	CC_disjmosaic63,	
	};//Encoding


	-(void)drawChar:(char)character at:(int)left :(int)baseLine 
			withColor:(unsigned char)color
	{
		unsigned char* offset=pixels+(baseLine-CellBaseLine)*width;
		CharacterImageT* image=&(FontGen[Encoding[(unsigned char)character]]);
		int j;
		
		if((left<0)||(left+CellWidth>width)||(baseLine-CellBaseLine<0)
		||(baseLine+CellHeight-CellBaseLine>height)){
			return;
		}
		for(j=0;j<CellHeight;j++,offset+=width){
			unsigned char byte=(*image)[j];
			unsigned char bit=0x80;
			int i;
			for(i=0;i<CellWidth;i++,bit>>=1){
				if(!(bit&byte)){
					offset[i]=color;
				}
			}
		}
	}//drawChar:at::withColor:;
	

	-(void)drawString:(char*)string at:(int)left :(int)baseLine 
			withColor:(unsigned char)color
	{
		while((*string)!='\0'){
			[self drawChar:(*string) at:left :baseLine 
				withColor:color];
			string++;
			left+=CellWidth;
		}
	}//drawString:at::withColor:;
	
@end // SqPixels.

// ------------------------------------------------------------------------- //

@interface SqView(Test)

	-(void)testPattern;
	
@end // SqView(Test).

// ------------------------------------------------------------------------- //

@implementation SqView(Test)

	-(void)testPattern
	{
		int i;
		int j;
		SqPixels* pixels=[[SqPixels alloc]initWidth:640 height:480];
		if(pixels==0){
			return;
		}
		for(j=0;j<8;j++){
			char num[16];
			sprintf(num," line #%d",j);
			[pixels drawString:num at:70:j*8 withColor:1];
			for(i=0;i<8;i++){
				[pixels paintRectAt:i*8:j*8 size:8:8 withColor:i*8+j];
			}
		}
		[pixels frameRectAt:100:100 size:440:280 withColor:1];
		[pixels paintRectAt:102:102 size:436:276 withColor:1];
		[pixels paintRectAt:104:104 size:432:272 withColor:0];
		[pixels drawString:"Hello World!" at:120:140 withColor:1];
		
		[self ioShowDisplayBitsIndex:(int)[pixels pixels]
			width:[pixels width] height:[pixels height] depth:[pixels depth] 
			affectedLeft:0 affectedRight:320 
			affectedTop:0 affectedBottom:480];
		[self ioShowDisplayBitsIndex:(int)[pixels pixels]
			width:[pixels width] height:[pixels height] depth:[pixels depth] 
			affectedLeft:320 affectedRight:640 
			affectedTop:0 affectedBottom:480];
		[pixels free];
	}//testPattern;
	
		
@end // SqView(Test).

