#ifndef G32_H #define G32_H #include "basewindow.h" #include "macgeo.h" // Need to define some mac types typedef struct { unsigned long *baseaddr; unsigned long rowbytes; Rect portRect; } GWorld; typedef GWorld *GWorldPtr; // Get a new 32Bit GWorld QDErr G32New(GWorldPtr *gw, short xSize, short ySize); GWorldPtr NewG32(short xsize, short ysize); // Dispose of the GWorld void DisposeGWorld(GWorldPtr gw); // Get/Set the 4 byte value at x,y long G32GetVal(GWorldPtr gw, short x, short y); void G32SetVal(GWorldPtr gw, short x, short y, long val); // CopyBits using GWorlds. This does all the casting, locking, and device switching for you. // Also, leave the rects at NULL to default to the portRect. void G32CopyBits(WindowPtr src, GWorldPtr dest); void G32CopyBits(GWorldPtr src, WindowPtr dest); void G32CopyBits(GWorldPtr src, GWorldPtr dest); // Lock/Unlock GWorld pixels //void G32UnlockPixels(GWorldPtr gw); //void G32LockPixels(GWorldPtr gw); // Return the smaller of the two port sizes, used by the loop routine int G32GetMinXSize(GWorldPtr gw1, GWorldPtr gw2); int G32GetMinYSize(GWorldPtr gw1, GWorldPtr gw2); // Save and restore the graphics state void G32SaveGWorld(void); void G32RestoreGWorld(void); // Get the dimensions of a G32 short G32GetXSize(GWorldPtr gw); short G32GetYSize(GWorldPtr gw); // Make a copy of a G32 GWorldPtr MakeG32FromG32(GWorldPtr gw); // G32LoopThroughPixels(SrcGWorld, DestGWorld) // Loop through all pixels in the pixmap so you can process them // These variable get defined for your use // long *G32DestPix; // The dest pixel, argb bytes, normally you modify this value // long *G32SrcPix; // The src pixel, you may modify this // int G32x; // The current x in our scan // int G32y; // The current y in our scan // int G32xSize; // The x size of the scan, the min of the two ports // int G32ySize; // The y size of the scan, the min of the two ports // Example: // // G32LoopThroughPixels(GWorld1,GWorld2) // { // *G32DestPix = *G32SrcPix; // Copy the pixel // } // #define G32LoopThroughPixels(g32gw1,g32gw2) \ Ptr g32base1,g32base2;\ int g32rowBytes1,g32rowBytes2;\ long *G32SrcPix, *G32DestPix;\ g32base1= (Ptr)g32gw1->baseaddr;\ g32rowBytes1=(g32gw1->rowbytes) ;\ g32base2= (Ptr)g32gw2->baseaddr;\ g32rowBytes2=g32gw2->rowbytes ; \ int G32xSize=G32GetMinXSize(g32gw1,g32gw2);\ int G32ySize=G32GetMinYSize(g32gw1,g32gw2);\ int G32x;\ for (int G32y=0;G32ybaseaddr;\ g32rowBytes1=(g32gw1->rowbytes) ;\ g32base2= (Ptr)g32gw2->baseaddr;\ g32rowBytes2=g32gw2->rowbytes ; \ g32base3= (Ptr)g32gw3->baseaddr;\ g32rowBytes3=g32gw3->rowbytes ; \ int G32xSize=G32GetMinXSize(g32gw1,g32gw2);\ int G32ySize=G32GetMinYSize(g32gw1,g32gw2);\ int G32x;\ for (int G32y=0;G32y