
PhotoJazz API Manual File LayerRetrieving Parameter Values
For each PhotoJazz parameter, there is a corresponding JzGet function
that returns the current value of that parameter for a specified PhotoJazz file.
All of these functions take only one argument: a pointer to a PhotoJazz file,
which the PhotoJazz engine gives you when you begin reading or writing the file
with JzReadBegin or JzWriteBegin.
Note that the JzGet functions can be called both in the JzRead sequence
and in the JzWrite sequence.
JzStreamResult JzGetMode(JzFile *aJazzFile, JzMode *aMode);
JzStreamResult JzGetWidth(JzFile *aJazzFile, unsigned long *aWidth);
JzStreamResult JzGetHeight(JzFile *aJazzFile, unsigned long *aHeight);
JzStreamResult JzGetPrimaryCount(JzFile *aJazzFile, unsigned char *aPrimaryCount);
JzStreamResult JzGetSpotColorCount(JzFile *aJazzFile, unsigned char *aSpotColorCount);
JzStreamResult JzGetOtherChannelCount(JzFile *aJazzFile, unsigned char *aOtherChannelCount);
JzStreamResult JzGetChannelCount(JzFile *aJazzFile, unsigned char *aChannelCount);
JzStreamResult JzGetDataType(JzFile *aJazzFile, JzDataType *aDataType);
JzStreamResult JzGetDataPrecision(JzFile *aJazzFile, unsigned char *aDataPrecision);
JzStreamResult JzGetUnitSample(JzFile *aJazzFile, unsigned long *aUnitSample);
JzStreamResult JzGetSourceName(JzFile *aJazzFile, char **aSourceName);
JzStreamResult JzGetSourceCreator(JzFile *aJazzFile, unsigned long *aSourceCreator);
JzStreamResult JzGetSourceType(JzFile *aJazzFile, unsigned long *aSourceType);
JzStreamResult JzGetTileWidth(JzFile *aJazzFile, unsigned short *aTileWidth);
JzStreamResult JzGetTileHeight(JzFile *aJazzFile, unsigned short *aTileHeight);
JzStreamResult JzGetTileCount (JzFile *aJazzFile, unsigned long *aTileCount);
JzStreamResult JzGetResolutionUnit(JzFile *aJazzFile, JzResolutionUnit *aResolutionUnit);
JzStreamResult JzGetHorizontalResolution(JzFile *aJazzFile, JzUnsignedRational *aHorizontalResolution);
JzStreamResult JzGetVerticalResolution(JzFile *aJazzFile, JzUnsignedRational *aVerticalResolution);
JzStreamResult JzGetICCProfile(JzFile *aJazzFile, void **aICCProfile);
Three summary functions have been added for convenience.
JzGetChannelCount returns the sum
of the mPrimaryCount,
mSpotColorCount,
and mOtherChannelCount;
It is useful for allocating a tile buffer and advancing through the tile buffer.
JzGetDataPrecision returns the number of bits per channel.
JzGetTileCount
determines how many tiles there are in the image,
assuming the tiles are all equal size except for the right and bottom edges of the image;
This is handy for initializing and updating a progress indicator.
In addition, there is a corresponding JzGet function for each external parameter
passed to JzReadBegin or JzWriteBegin:
JzStreamResult JzGetStream(struct JzFile *aJazzFile, JzStream **aStream);
JzStreamResult JzGetAllocator(struct JzFile *aJazzFile, JzAllocator **aAllocator);
JzStreamResult JzGetInterpreter(struct JzFile *aJazzFile, JzInterpreter **aInterpreter);
JzStreamResult JzGetYielder(struct JzFile *aJazzFile, JzYielder **aYielder);
JzStreamResult JzGetAccess(struct JzFile *aJazzFile, JzAccess *aAccess);
In JzGet functions that pass back a pointer to an internal parameter,
such as JzGetSourceName
and JzGetICCProfile, PhotoJazz returns the address of the original.
You must make a copy if you want it to persist.
All of these functions return a JzStreamResult
to indicate either success (kJzStreamResultOkay) or some kind of error.
If a JzGet function returns an error, you must still call either JzReadEnd
or JzWriteEnd, as appropriate, to allow PhotoJazz to clean up properly.
The only error result currently returned by the JzGet functions is kJzStreamResultMissingArgument,
indicating that you have passed in either a NULL JzFile pointer or a NULL address
to receive the parameter value.
kJzStreamResultMissingArgument, //NULL address
|