Re: File Formats

New Message Reply Date view Thread view Subject view Author view

Phil Keslin (philk++at++cthulhu.engr.sgi.com)
Tue, 11 Aug 1998 10:55:48 -0700


Jeffry J Brickley wrote:
>
> I have used the RGB format of files and accessed without problems, but I
> need to access FIT and RAW files. RAW I had assumed was unformated with
> just the bytes that make up the image, thus a 32768x32768 image would be
> 1073741824 bytes in size for luminance imagery. FIT is, but it seems to
> be a mapped through recursive iteration? and RAW is actually larger than
> the FIT.... I would have assumed vice-versa, so how are these two
> actually stored?

How big is the FIT file? Also, are you referring to the SGI FIT file
format or the FITS format used by astronomers?

There are no assumptions about raw image files. The app must specify
everything (e.g., color model, size, orientation, data offset, etc.).

The FIT file (which is not the astonomers FITS) is a tiled (paged)
format with a header block at offset 0. Here's the format of the header
and a description of its fields.

const short FITmagic='IT';
const short FITversion='02';

struct FIThead02 { // file header for version 02
    unsigned short magic; // file ident (see FITmagic)
    unsigned short version; // file version (see FITversion)
    unsigned int xSize; // image size
    unsigned int ySize;
    unsigned int zSize;
    unsigned int cSize; // channels (components) in image
    int dtype; // data type
    int order; // RGBRGB.. or RR..GG..BB..
    int space; // coordinate space
    int cm; // color model
    unsigned int xPageSize; // page size
    unsigned int yPageSize;
    unsigned int zPageSize;
    unsigned int cPageSize;
                                // NOTE: a word of padding is inserted
here
                                // due to struct alignment rules
    double minValue; // min/max pixel values
    double maxValue;
    unsigned int dataOffset; // offset to first page of data
    // user extensible area...
};

struct FIThead01 { // file header for version 01
    unsigned short magic; // file ident (see iflFITmagic)
    unsigned short version; // file version (see iflFITversion)
    unsigned int xSize; // image size
    unsigned int ySize;
    unsigned int zSize;
    unsigned int cSize; // channels (components) in image
    int dtype; // component data type
    int order; // RGBRGB.. or RR..GG..BB..
    int space; // coordinate space
    int cm; // color model
    unsigned int xPageSize; // page size
    unsigned int yPageSize;
    unsigned int zPageSize;
    unsigned int cPageSize;
    unsigned int dataOffset; // offset to first page of data
    // user extensible area...
};

Where...

dtype:
     1 - bit
     2 - unsigned char (8 bits)
     4 - signed char (8 bits)
     8 - unsigned short (16 bits)
    16 - signed short (16 bits)
    32 - unsigned int (32 bits)
    64 - signed int (32 bits)
    32 - unsigned long (32 bits)
    64 - signed long (32 bits)
   128 - float
   256 - double

order:
     1 - interleaved components (RGBRGBRGB...)
     2 - sequential components (RRR...GGG...BBB per line)
     4 - separate components (channels stored in separate tiles)

space:
     1 - upper left origin scanning right then down
     2 - upper right origin scanning left then down
     3 - lower right origin scanning left then up
     4 - lower left origin scanning right then up
     5 - upper left origin scanning down then right
     6 - upper right origin scanning down then left
     7 - lower right origin scanning up then left
     8 - lower left origin scanning up then right

cm:
     1 - negative (inverted luminance, i.e., min is white)
     2 - luminance
     3 - rgb
     4 - rgbpalette (color index)
     5 - rgba
     6 - hsv
     7 - cmy
     8 - cmyk
     9 - bgr
    10 - abgr
    11 - multispectral
    12 - ycc
    13 - luminance alpha

-- 
Phil Keslin			Silicon Graphics, Inc.
E-Mail: philk++at++sgi.com		2011 N. Shoreline Blvd. M/S 8U-590
				Mountain View, CA 94043
=======================================================================
List Archives, FAQ, FTP:  http://www.sgi.com/Technology/Performer/
            Submissions:  info-performer++at++sgi.com
        Admin. requests:  info-performer-request++at++sgi.com

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Tue Aug 11 1998 - 13:42:35 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.