About the Picture Utilities Package
About the Picture Utilities Package
This section describes the Picture Utilities Package, a set of routines
with which you can obtain qualitative and quantitative information about
pictures and pixel maps. You might want to find out about the text in a picture,
for example, to see if the fonts it uses are available in the system. You can
determine the number of colors a picture uses and obtain an optimal color
table or palette for displaying it.
The Picture Utilities Package is available with system 7.0. With system
7.0, the picture utilities work using the original QuickDraw, but with the
limitation that any palette handles returned are NIL.
The two most common forms of storing image information are pixel maps and
pictures. The Picture Utilities Package consists of a number of routines
for extracting information from a picture, or from a pixel map record and its
associated image.
Unless they contain specialized code for parsing pictures, many applications
deal with pictures as black boxes, perhaps imaging them into a pixel map and
then dealing with the picture as pixel map data. The Picture Utilities
Package provides a way to open that black box and deal with its contents
intelligently.
The OpenCPicture routine described in Color QuickDraw stores
resolution information in the picture header. The Picture Utilities
Package returns this information for pictures created with OpenCPicture,
and returns the standard screen resolution (72 dots per inch) for all other
pictures.
You can use Picture Utilities Package routines and data structures to
gather information about a single pixel map or picture, or you can survey a
number of them. To get information about a single picture or pixel map, use
either the GetPictInfo or GetPixMapInfo function, and all the information
will be returned in a picture information record.
To collect information about a number of pictures and pixel maps, you need to
make at least four calls: the NewPictInfo function creates an identifier for the
collection. RecordPictInfo and RecordPixMapInfo collect information
from pictures and pixel maps, respectively. RetrievePictInfo returns the
collected information, and DisposPictInfo disposes of the data structures
private to the collection. Information about the collection of pictures and pixel
maps is returned in a picture information record.
An entire picture need not be read into memory; pictures can be spooled to the
GetPictInfo or RecordPictInfo function, following the spooling procedure
described in Color QuickDraw.