Homepage
search
ProductsShopNewsSupportCompany
English
Support

Contact
SheerVideo
PhotoJazz
English-Speaking Digital Film & Video User Groups

PhotoJazz

User Manual
Release Notes
Known Problems
Developer Support

Developer Support

SDK
Development FAQ
API Manual

API Manual

Overview
Foundation Layer
File Layer

File Layer

Parameters
Retrieving Parameter Values
Setting Parameter Values
Interpreting Private Chunks
Reading PhotoJazz Files
Writing PhotoJazz Files


PhotoJazz API Manual

File Layer
Parameters


PhotoJazz files have a number of parameters, such as the image type, the image dimensions, source-file specifications, ICC profiles, and tile dimensions. A PhotoJazz file is always processed sequentially as a stream, so PhotoJazz's file layer acts as a state machine. That is, all parameters have a well-defined initial state (their default value) and always have a well-defined current state (the most recent value assigned by reading or setting).

Inside the PhotoJazz file, each parameter is specified in an individual tagged block. The number of possible tags is unlimited. Since these blocks have no fixed position, but can occur anywhere within the stream, the file format is completely extensible.

The fact that PhotoJazz is a tile-based state machine means that technically, the parameters describe the next tile. In the JzRead sequence, when you begin reading, PhotoJazz reads all the parameters for the first tile, i.e. all the parameters up to but excluding the first tile. And each time you read a tile, PhotoJazz reads not only that tile, but all the parameters following it up to but excluding the next tile. Therefore, on reading, you have to set everything up correctly before reading a tile, because immediately upon reading the tile, the parameters have been updated for the upcoming tile.

Conversely, in the JzWrite sequence, when you begin writing, PhotoJazz only writes the PhotoJazz identifier and safety bits in the header, but no parameters yet. Then, each time you write a tile, PhotoJazz first writes out any parameters that have changed, and then writes out the tile. You don't have to worry about redundantly specifying parameters, because PhotoJazz only writes out the most recently specified value, and that only if it's changed.

PhotoJazz distinguishes between image-critical parameters, without which no meaningful image can be reconstructed, and ancillary parameters, which may help render the image more accurately or provide other potentially useful but nonessential information.

The following image parameters are currently defined, where critical parameters are highlighted, and the default value is signalled by an at (@) sign:

JzMode mMode image type, or color model @kJzModeLight
unsigned long mWidth image width, in pixels @768
unsigned long mHeight image height, in pixels @512
unsigned char mPrimaryCount number of primary color components @3 for kJzModeLight,
@4 for kJzModeInk
unsigned char mSpotColorCount number of spot color components @0
unsigned char mOtherChannelCount number of non-color components @0
JzDataType mDataType pixel component type @kJzDataTypeUnsignedByte
unsigned long mUnitSample unit sample value @255 for kJzDataTypeUnsignedByte,
@65535 for kJzDataTypeUnsignedShort
char* mSourceName uncompressed image file name @0 (no name)
unsigned long mSourceCreator image-creation application identifier @'8BIM' (Adobe Photoshop)
unsigned long mSourceType uncompressed image type @'TIFF'
unsigned short mTileWidth tile width, in pixels @256
unsigned short mTileHeight tile height, in pixels @256
JzResolutionUnit mResolutionUnit unit in which resolution is expressed @kJzResolutionUnitInch
JzUnsignedRational mHorizontalResolution number of pixels per horizontal unit @72:1
JzUnsignedRational mVerticalResolution number of pixels per vertical unit @72:1
void* mICCProfile description of color components @0 (none)

BitJazz Inc. may define other parameters in the future.

mMode

The image type, or color mode, is one of kJzModeLight, kJzModeInk, kJzModeMultitone ink, or kJzModeLab. See the discussion of JzMode in the Basic Data Types section. If the image is intended for an emissive display, typically RGB or monochrome, then it is probably kJzModeLight. If the image is intended for print, typically CMYK or monochrome, then it is probably kJzModeInk. If a single channel is split into two or more ranges with different color mixtures, then it is kJzModeMultitone.

The mMode is an image-critical parameter.

The default mMode is kJzModeLight.

mWidth
mHeight

PhotoJazz assumes that an image is a rectangular array of pixels, where mWidth is the number of pixels from left to right, and mHeight is the number of pixels from top to bottom.

The mWidth and mHeight parameters are both critical.

Their admittedly arbitrary default values are 768 for mWidth and 512 for mHeight.

mPrimaryCount
mSpotColorCount
mOtherChannelCount

PhotoJazz distinguishes between three types of channels: primaries, spot colors, and other channels.

In a light image, all color channels are primary colors, because all colors of light superpose perfectly. The number of primaries for light images is usually 3 (for RGB) or 1 (for monochrome). Since the human visual system utilizes three visual pigments, three primaries can capture most of the visual range. But since the spectral response of each visual pigment is not a single line, no set of three light primaries can encompass the entire visual range, so some high-fidelity photographs use more than 3 primaries. In astronomy, geology, medicine, and other fields where scientific images are not necessarily meant for direct human viewing, multispectral images may even have hundreds of primaries.

In an ink image, on the other hand, there is a common distinction between process (i.e. primary) colors, which mix to make a whole gamut of colors; versus spot colors, which ordinarily cover, and are intended to cover, any colors underneath. In fact, the underlying colors are typically knocked out to ensure better coverage. The visual effect of the application of spot colors is highly dependent on the order in which they are applied. As a rule, spot colors are applied after all process colors. PhotoJazz supports any number of primary channels, and any number of spot-color channels. It also supports any number of other, non-color channels, such as (alpha) selections and masks.

The mPrimaryCount, mSpotColorCount, and mOtherChannelCount parameters are all three critical.

The default mPrimaryCount is 3 for kJzModeLight, 4 for kJzModeInk, and 1 for kJzModeMultitone. The default mSpotColorCount and mOtherChannelCount are both 0.

mDataType
mUnitSample

The only data types currently supported by PhotoJazz are kJzDataTypeUnsignedByte, corresponding to JzSampleU8; and kJzDataTypeUnsignedShort, corresponding to JzSampleU16. See the discussion of JzDataType in the Basic Data Types section. BitJazz Inc. may add support for other data types.

By default, the unit sample value is assumed to be the maximum representable value for the data type. Thus, for kJzDataTypeUnsignedByte data, the default unit sample is 255, or 0xFF; for kJzDataTypeUnsignedShort, the default unit sample is 65535, or 0xFFFF. For 5-bit channels, as in typical 16-bit RGB formats, the unit sample would be 31, or 0x1F. Note that Adobe Photoshop's '16-bit' data actually uses 15 bits plus 1, with a unit sample value of 32768, or 0x8000.

The mDataType parameter is image-critical; the mUnitSample parameter is ancillary.

The default mDataType is kJzDataTypeUnsignedByte.

mSourceName
mSourceCreator
mSourceType

For applications in which images are compressed into PhotoJazz format only to be decompressed back into their original format at some later time, PhotoJazz can store the name, creator id, and type id of the uncompressed image. The name is simply a null-terminated string of ASCII characters; BitJazz Inc. may add support for Unicode strings in a future release. The creator id and type id are Macintosh-style 4-byte codes.

The mSourceName, mSourceCreator, and mSourceType parameters are all ancillary. The default mSourceName is no name. The default mSourceCreator is '8BIM', which signifies Adobe Photoshop. The default mSourceType is TIFF, the only public file format that supports all the image types supported by PhotoJazz.

mTileWidth
mTileHeight

PhotoJazz partitions an image up into tiles, rectangular arrays of pixels, where mTileWidth is the number of pixels from left to right, and mTileHeight is the number of pixels from top to bottom. It is very important to note that if the width and height of the image are not multiples of the width and height, respectively, of the first tile, then the tiles will not be of uniform width and height. Some file formats (such as TIFF, JPEG, and MPEG) force all tiles to be of uniform width and height, with the result that pixels have to be processed that are not part of the visible image. PhotoJazz permits the tiles to be of different sizes, although all tiles in a given row have to have the same height. Having to deal with images incommensurate with the basic tile size is one of the things that makes the tile loops in the JzRead and JzWrite sequences tricky, but we provide sample code in those sections to help you out.

In general, the larger the tiles, the better the compression ratio, although this is offset by that fact that more homogeneous tiles compress better. Technically, PhotoJazz places no restriction on the basic tile size. However, BitJazz Inc. recommends that images meant for interchange use tiles of 64K or fewer pixels to ensure that older computeres with small amounts of RAM can read them.

The mTileWidth and mTileHeight parameters are both critical.

The default mTileWidth and mTileHeight are both 256.

mResolutionUnit
mHorizontalResolution
mVerticalResolution

The mResolutionUnit, either kJzResolutionUnitCentimeter or kJzResolutionUnitInch, is the unit in which the mHorizontalResolution and mVerticalResolution are expressed. The mHorizontalResolution and mVerticalResolution are the number of pixels per resolution unit from left to right and from top to bottom, respectively.

Images meant for display on standard computer monitors typically have a resolution of 72 pixels per inch, both horizontally and vertically. Images intended for print typically have a much higher resolution, from hundreds to thousands of pixels per inch, and often their horizontal and vertical resolutions are different.

The mResolutionUnit, mHorizontalResolution, and mVerticalResolution are all ancillary parameters.

The default value for mResolutionUnit, in deference to Adobe Photoshop, is kJzResolutionUnitInch (1). The default mHorizontalResolution and mVerticalResolution are both 72 (pixels per inch).

Like TIFF, PhotoJazz specifies the resolution measures as rational numbers. Since PICT and PSD, among others, specify them as Fixed numbers, we provide utility functions to interconvert between the two representations:

JzUnsignedRational FixedToRational(Fixed aFixed){
JzUnsignedRational lRational;
lRational.mNumerator = aFixed;
lRational.mDenominator = 1L<<16;
while (!(lRational.mNumerator&1)&&!(lRational.mDenominator&1)){
lRational.mNumerator >>= 1;
lRational.mDenominator >>= 1;
}
return lRational;
}
Fixed RationalToFixed(JzUnsignedRational aRational){
unsigned long long lFixed = aRational.mNumerator;
lFixed *= 65536L;
lFixed /= aRational.mDenominator;
return (Fixed)lFixed;
}

mICCProfile

The mICCProfile specifies everything one needs to know to interpret the color channels in the image. Unfortunately, none of the host applications that support the PhotoJazz image file format so far fully support ICC profiles for third-party plug-ins, and few users have begun to incorporate ICC profiles into their workflow.

The mICCProfile is an ancillary parameter.

The default mICCProfile is 0 (no profile).


previous pagenext page

Copyright © 1998..2011 BitJazz Inc. All rights reserved.
Site design by BitJazz Inc.