 
#ifndef pixelimage_DEFINED
#define pixelimage_DEFINED 1
 
#ifndef class_DEFINED
#include <class.h>
#endif /* class_DEFINED */
/* 
 * This file was generated by the Andrew class system preprocessor.
 * Don't make changes to this file as it is created from pixelimg.ch and will be
 * overwritten.  Make changes to pixelimg.ch instead.
 */ 
 
#ifndef class_StaticInfoOnly
/* 
 * The following information was copied, as-is, from pixelimg.ch.
 */ 
 
/* ********************************************************************** *\
 *         Copyright IBM Corporation 1988,1991 - All Rights Reserved      *
 *        For full copyright information see:'andrew/config/COPYRITE'     *
\* ********************************************************************** */

/*
	$Disclaimer: 
*Permission to use, copy, modify, and distribute this software and its 
*documentation for any purpose is hereby granted without fee, 
*provided that the above copyright notice appear in all copies and that 
*both that copyright notice, this permission notice, and the following 
*disclaimer appear in supporting documentation, and that the names of 
*IBM, Carnegie Mellon University, and other copyright holders, not be 
*used in advertising or publicity pertaining to distribution of the software 
*without specific, written prior permission.
*
*IBM, CARNEGIE MELLON UNIVERSITY, AND THE OTHER COPYRIGHT HOLDERS 
*DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 
*ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO EVENT 
*SHALL IBM, CARNEGIE MELLON UNIVERSITY, OR ANY OTHER COPYRIGHT HOLDER 
*BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY 
*DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 
*WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS 
*ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
*OF THIS SOFTWARE.
* $
*/


 /* 
  *	pixelimg.H
  */

 

/*
/* Pixel Image -- a simple data structure for blasting bits 

*/

/*	The bits of a pixel image are stored rowwise.  Each row is rounded up to
	a multiple of 16 bits (halfword alignment).  The bits in each word are 
	left to right in their screen order;  the high order bit in the even numbered 
	byte in the word is the leftmost of the bits on the screen.  	The rightmost
	displayed bit is the low order bit of the odd numbered byte of the word.
	A bit value of 1 means foreground color; a 0 means background color.
	(The foreground is black: red=0, green=0, blue=0.)
*/


#include <point.h>
#include <rect.h>


#define WHITEBYTE	0
#define BLACKBYTE	0xFF
#define WHITEHALFWORD  ((WHITEBYTE <<8) | WHITEBYTE)
#define BLACKHALFWORD  ((BLACKBYTE <<8) | BLACKBYTE)
#define pixelimage_DATACHANGED 1





/* Predefined constants for use in BlitSubraster(). These are defined exactly the same way as the transfer constants in class graphic. See graphic.{ch,doc} for details. */
#define	pixelimage_SOURCE	0xCC
#define	pixelimage_DEST		0xAA

/* Some synonyms for ease of use */
#define	pixelimage_COPY		pixelimage_SOURCE
#define	pixelimage_OR		(pixelimage_SOURCE | pixelimage_DEST)
#define	pixelimage_XOR		(pixelimage_SOURCE ^ pixelimage_DEST)
#define	pixelimage_AND		(pixelimage_SOURCE & pixelimage_DEST)
#define	pixelimage_WHITE	0x00
#define	pixelimage_BLACK	0xFF
#define	pixelimage_INVERT	((~pixelimage_DEST)&0xFF)



/* 
 * End of information copied from pixelimg.ch.
 */ 
 
#endif /* class_StaticInfoOnly *//* 
 * Include the superclass information
 */ 
#define dontDefineRoutinesFor_observable
#include "observe.ih"
#undef dontDefineRoutinesFor_observable

 
 
#ifndef class_StaticInfoOnly
/* 
 * Data structure for pixelimage 
 */ 
struct pixelimage { 
    union {
	struct basicobject_methods *pixelimage_methods;
	struct traced traced;
	struct observable observable;
    } header;
	long numRows;		/* Number of rows of image's pixels */
	long pixelsPerRow;	/* Number of pixels per row */
	long RowWidth;		/* Number of bytes per row.
					(Will be even.)  */
	unsigned char *bits;		/* Array of the bits */

	struct rectangle ChangedRect;  /* bound the most recently changed subraster */
	boolean Resized;		/* another value for NotifyObservers */
	boolean ReadOnly;		/* when True, the raster bits are locked */

};

 
/* 
 * End of data structure for pixelimage.
 */ 
 

#endif /* class_StaticInfoOnly */

#ifndef class_StaticInfoOnly

#ifndef pixelimage_PROGRAMMERVERSION
#define pixelimage_PROGRAMMERVERSION 1
#endif /* pixelimage_PROGRAMMERVERSION */

#ifdef pixelimage_VERSION
#undef pixelimage_VERSION
#endif /* pixelimage_VERSION */
#define pixelimage_VERSION ((((pixelimage_PROGRAMMERVERSION << 16) ^ (28 << 8) ^ sizeof(struct pixelimage)) & 0x7ffff) + 0x80000 + (65 << 20))


#endif /* class_StaticInfoOnly */
#define pixelimage_StaticLoadOnlyThisClass()  \
{ extern struct classinfo *pixelimage__GetClassInfo(); \
 extern struct classheader *pixelimg_classheader_StaticExport; \
  (void) class_EnterInfo(NULL, pixelimg_classheader_StaticExport->name, pixelimage__GetClassInfo, NULL, pixelimg_classheader_StaticExport->namekey); } 
 
#define pixelimage_StaticLoad()  \
    { \
    observable_StaticLoad(); \
    pixelimage_StaticLoadOnlyThisClass();  \
    } 
 
#define pixelimage_StaticEntry  {pixelimage_StaticLoad()} 
 
#define pixelimg_StaticEntry  {pixelimage_StaticLoad()} 
 
#ifndef class_StaticInfoOnly
static struct classheader pixelimage_classheader = {
    pixelimage_VERSION,
    "pixelimage",
    "pixelimg",
    (struct basicobject_methods *) &class_RoutineStruct,
};

#define pixelimage_CLASSPROCEDURES (pixelimage_classheader.classprocedures)
int pixelimg_classref_;
#endif /* class_StaticInfoOnly */

#endif /* pixelimage_DEFINED */

#if !defined(pixelimage_ROUTINESDEFINED) && !defined(dontDefineRoutinesFor_pixelimage) && !defined(class_StaticEntriesOnly)
#define pixelimage_ROUTINESDEFINED

#define pixelimage_Reference(self) \
 (((&(self)->header.traced))->refcount++)
#define pixelimage_UnReference(self) \
 ((((&(self)->header.traced))->refcount>0)?((&(self)->header.traced))->refcount--:0)
#define pixelimage_ReferenceCount(self) \
 (((&(self)->header.traced))->refcount)
#define pixelimage_AddObserver(self,observer) \
    ((* ((void (*)())((self)->header.pixelimage_methods->routines[0]))) (self,observer))
#define pixelimage_IsObserver(self,observer) \
    ((* ((boolean (*)())((self)->header.pixelimage_methods->routines[1]))) (self,observer))
#define pixelimage_RemoveObserver(self,observer) \
    ((* ((void (*)())((self)->header.pixelimage_methods->routines[2]))) (self,observer))
#define pixelimage_NotifyObservers(self,value) \
    ((* ((void (*)())((self)->header.pixelimage_methods->routines[3]))) (self,value))
#define pixelimage_ObservedChanged(self,changed,value) \
    ((* ((void (*)())((self)->header.pixelimage_methods->routines[4]))) (self,changed,value))
#define pixelimage_AddRecipient(self,trigger,rcvr,func,rock) \
    ((* ((boolean (*)())((self)->header.pixelimage_methods->routines[5]))) (self,trigger,rcvr,func,rock))
#define pixelimage_DeleteRecipient(self,trigger,rcvr) \
    ((* ((void (*)())((self)->header.pixelimage_methods->routines[6]))) (self,trigger,rcvr))
#define pixelimage_PullTrigger(self,trigger) \
    ((* ((void (*)())((self)->header.pixelimage_methods->routines[7]))) (self,trigger))
#define pixelimage_DisableTrigger(self,trigger) \
    ((* ((void (*)())((self)->header.pixelimage_methods->routines[8]))) (self,trigger))
#define pixelimage_EnableTrigger(self,trigger) \
    ((* ((void (*)())((self)->header.pixelimage_methods->routines[9]))) (self,trigger))
#define pixelimage_DisableCount(self,trigger) \
    ((* ((long (*)())((self)->header.pixelimage_methods->routines[10]))) (self,trigger))
#define pixelimage_Resize(self,width,height) \
    ((* ((void (*)())((self)->header.pixelimage_methods->routines[11]))) (self,width,height))
#define pixelimage_Clone(self) \
    ((* ((struct pixelimage * (*)())((self)->header.pixelimage_methods->routines[12]))) (self))
#define pixelimage_Clear(self) \
    ((* ((void (*)())((self)->header.pixelimage_methods->routines[13]))) (self))
#define pixelimage_GetPixel(self,x,y) \
    ((* ((long (*)())((self)->header.pixelimage_methods->routines[14]))) (self,x,y))
#define pixelimage_SetPixel(self,x,y,pixelValue) \
    ((* ((void (*)())((self)->header.pixelimage_methods->routines[15]))) (self,x,y,pixelValue))
#define pixelimage_GetRow(self,x,y,length,dest) \
    ((* ((long (*)())((self)->header.pixelimage_methods->routines[16]))) (self,x,y,length,dest))
#define pixelimage_SetRow(self,x,y,length,src) \
    ((* ((long (*)())((self)->header.pixelimage_methods->routines[17]))) (self,x,y,length,src))
#define pixelimage_GetColumn(self,x,y,length,dest) \
    ((* ((long (*)())((self)->header.pixelimage_methods->routines[18]))) (self,x,y,length,dest))
#define pixelimage_SetColumn(self,x,y,length,src) \
    ((* ((long (*)())((self)->header.pixelimage_methods->routines[19]))) (self,x,y,length,src))
#define pixelimage_PaintSubraster(self,sub,byte) \
    ((* ((void (*)())((self)->header.pixelimage_methods->routines[20]))) (self,sub,byte))
#define pixelimage_GraySubraster(self,sub,level) \
    ((* ((void (*)())((self)->header.pixelimage_methods->routines[21]))) (self,sub,level))
#define pixelimage_InvertSubraster(self,sub) \
    ((* ((void (*)())((self)->header.pixelimage_methods->routines[22]))) (self,sub))
#define pixelimage_MirrorLRSubraster(self,sub) \
    ((* ((void (*)())((self)->header.pixelimage_methods->routines[23]))) (self,sub))
#define pixelimage_MirrorUDSubraster(self,sub) \
    ((* ((void (*)())((self)->header.pixelimage_methods->routines[24]))) (self,sub))
#define pixelimage_GetRotatedSubraster(self,sub,target) \
    ((* ((void (*)())((self)->header.pixelimage_methods->routines[25]))) (self,sub,target))
#define pixelimage_GetScaledSubraster(self,sub,NewW,NewH,target) \
    ((* ((void (*)())((self)->header.pixelimage_methods->routines[26]))) (self,sub,NewW,NewH,target))
#define pixelimage_BlitSubraster(self,x,y,source,sub,function) \
    ((* ((void (*)())((self)->header.pixelimage_methods->routines[27]))) (self,x,y,source,sub,function))
#define pixelimage_GetHeight(self) \
	(((self))->numRows)
#define pixelimage_GetWidth(self) \
	(((self))->pixelsPerRow)
#define pixelimage_GetRowWidth(self) \
	(((self))->RowWidth)
#define pixelimage_GetBitsPtr(self) \
	(((self))->bits)
#define pixelimage_SetBitsPtr(self,ptr) \
	(((self))->bits = (ptr))
#define pixelimage_SetRO(self,v) \
		(((self))->ReadOnly = (v))
#define pixelimage_GetRO(self) \
		(((self))->ReadOnly)
#define pixelimage_GetResized(self) \
	(((self))->Resized)
#define pixelimage_GetChanged(self) \
	(&((self)->ChangedRect))

#define pixelimage_NewFromObject(self) \
    ((* ((struct pixelimage * (*)())((self)->header.pixelimage_methods->info->procs->routines[0]))) (&pixelimage_classheader, (self)->header.pixelimage_methods->info->versionnumber))
#define pixelimage_New() \
    (*((struct pixelimage * (*)()) (pixelimage_CLASSPROCEDURES->routines[0])))(&pixelimage_classheader,pixelimage_VERSION)
#define pixelimage_Initialize(self) \
    (*((void (*)()) (pixelimage_CLASSPROCEDURES->routines[2])))(&pixelimage_classheader,self, pixelimage_VERSION)

#define pixelimage_Destroy(self) \
    ((* ((void (*)()) ((self)->header.pixelimage_methods->info->procs->routines[1]))) (&pixelimage_classheader, self))
#define pixelimage_Finalize(self) \
    (*((void (*)()) (pixelimage_CLASSPROCEDURES->routines[3])))(&pixelimage_classheader,self)

#define pixelimage_InitializeObject(self) \
    (*((boolean (*)()) (pixelimage_CLASSPROCEDURES->routines[5])))(&pixelimage_classheader,self)
#define pixelimage_FinalizeObject(self) \
    (*((void (*)()) (pixelimage_CLASSPROCEDURES->routines[6])))(&pixelimage_classheader,self)
#define pixelimage_Create(width,height) \
    (*((struct pixelimage * (*)()) (pixelimage_CLASSPROCEDURES->routines[7])))(&pixelimage_classheader,width,height)
#define pixelimage_ClipRange(tstart,tlength,start,length) \
    (*((void (*)()) (pixelimage_CLASSPROCEDURES->routines[8])))(&pixelimage_classheader,tstart,tlength,start,length)


#endif /* !defined(pixelimage_ROUTINESDEFINED) && !defined(dontDefineRoutinesFor_pixelimage ) && !defined(class_StaticEntriesOnly)*/

