JPEGView/Headers/JPEGViewPlugIn.h

1 line
9.0 KiB
C
Raw Normal View History

/*********************************************************/ /* This source code copyright (c) 1991-2001, Aaron Giles */ /* See the Read Me file for licensing information. */ /* Contact email: mac@aarongiles.com */ /*********************************************************/ #ifndef __JPEGVIEWPLUGIN__ #define __JPEGVIEWPLUGIN__ /* Function descriptions: --------------------------------------------------------------------------------------- plugInAbout: Display the plug-in's about box --> plugInResFile file specification record of the plug-in --> plugInGlobals handle to the plug-in's globals (from plugInOpen) returns: noErr -- initialization was successful memFullErr -- not enough memory to identify the image other errors -- any other problems --------------------------------------------------------------------------------------- plugInInitialize: Initialize the plug in; called once when the plug-in is initialized --> plugInResFile file specification record of the plug-in <-- plugInInfo handle to a plug-in information record <-- plugInGlobals handle to the plug-in's globals returns: noErr -- initialization was successful memFullErr -- not enough memory to initialize the plug-in errInitializeFailed -- initialization failed --------------------------------------------------------------------------------------- plugInIdentify: Attempt to identify the image --> plugInResFile file specification record of the plug-in --> plugInGlobals handle to the plug-in's globals (from plugInOpen) <--> imageData handle to the currently-loaded data; guaranteed to be at least 1024 bytes long; more can be loaded if necessary --> dfRefNum reference number of the file's data fork --> imageFile file specification record of the file returns: noErr -- the image was identified correctly memFullErr -- not enough memory to identify the image errInvalidImage -- the image was not identified other errors -- error reading the file --------------------------------------------------------------------------------------- plugInLoad: Load the image data --> plugInResFile file specification record of the plug-in --> plugInGlobals handle to the plug-in's globals (from plugInOpen) <--> imageData handle to the image data; initially contains data from the data fork --> dfRefNum reference number of the file's data fork --> imageFile file specification record of the file returns: noErr -- the image was loaded successfully memFullErr -- not enough memory to load the image errInvalidImage -- the image was not identified other errors -- error reading the file --------------------------------------------------------------------------------------- plugInOpen: Open the image after loading, by pulling vital information from the data --> plugInResFile file specification record of the plug-in --> plugInGlobals handle to the plug-in's globals (from plugInOpen) <-- imageGlobals handle to the plug-in's globals for this image <-- horizontalDPI horizontal resolution of the image (in DPI) as a Fixed <-- verticalDPI vertical resolution of the image (in DPI) as a Fixed <-- globalRect rectangle, in pixels, of the full-sized image <-- croppedRect rectangle, in pixels, of the initial cropped area <-- imageDepth depth of the image, or 32+depth for grayscale images <-- imageColors handle to a color table containing the image colors, or nil if none <-- compressionType index in the plugInInfo record of the compression info <-- compressionDesc description of the compression (as seen in the stats), or nil to take the description from the plugInInfo <-- imageComments handle to the image's comments returns: noErr -- the image was recognized successfully memFullErr -- not enough memory to open the image errInvalidImage -- an error was found in the image data other errors -- any other problems -----------------------------------------------------------------------