← develop-09 9201 Winter 1992

develop-09 9201 Winter 1992

From the originals

13 scans

Machine-transcribed text and image descriptions. Check the linked original for uncertain words or fine print.

These are transcribed pages from the documents, not the full publications. Open the original for the remaining pages.

PDF page 12

continue picture parsing. When such a machine encounters the $000000FF baseAddr, the number of bytes skipped is $0000 and the next opcode is $00FF, which ends the picture playback. A graceful exit from a tough situation. An interesting fact buried in the PutOutPixMapSrcRectDstRectAndMode routine is the value of packType. All in-memory pixMaps (that aren’t in a picture) are assumed to be unpacked. Thus, you can set the packType field to specify the type of packing the pixMap should get when put in a picture. “The Low-Down on Image Compression” ( develop Issue 6, page 43) gives details of the different pixMap compression schemes used by QuickDraw. Note that all of QuickDraw’s existing packing schemes lose no image quality. QuickTime (the new INIT described in detail in the lead article in develop Issue 7) adds many new packing methods, most of which sacrifice some image quality to achieve much higher compression. Anyway, these routines support only the default packing formats: 1 (or unpacked) for any pixMap with rowBytes less than 8, 0 for all other indexed pixMaps, and 4 for 32- bit direct pixMaps with rowBytes greater than 8. Note that these routines do not support 16-bit pixMaps. Finally, the end-of-picture opcode is put out and the handle is resized to the amount actually used. PicHandle CreatePICT2(PixMap *srcBits, Rect *srcRect, Rect *dstRect, short mode) { PicHandle myPic; short myRowBytes; short *picPtr; short iii; long handleSize; #define CLIPSIZE 12 #define PIXMAPRECSIZE 50 #define HEADERSIZE 40 #define MAXCOLORTABLESIZE 256*8+8 #define OPCODEMISCSIZE 2+8+8+2 /* opcode+srcRect+dstRect+mode */ #define ENDOFPICTSIZE 2 #define PICSIZE PIXMAPRECSIZE + HEADERSIZE + MAXCOLORTABLESIZE + \ ENDOFPICTSIZE + OPCODEMISCSIZE + CLIPSIZE myRowBytes = srcBits->rowBytes & 0x3fff; /* Allocate worst-case memory scenario using PackBits packing. */ myPic = (PicHandle) NewHandle(PICSIZE + (long) ((myRowBytes/127)+2+myRowBytes)*(long)(srcBits->bounds.bottom - srcBits->bounds.top)); d e v e l o p Winter 1992 10

Reading notes: Page number reference 'page 43' and 'Winter 1992' footer appear as fine print; no explicit product prices are present.

Printed dates
Issue 6 · Issue 7 · 1992
Languages
English