AISFileFormat.mesa
Copyright © 1984, 1985 by Xerox Corporation. All rights reserved.
Doug Wyatt, March 7, 1985 2:09:00 pm PST
AISFileFormat: CEDAR DEFINITIONS
~ BEGIN
bytesPerWord: NAT ~ 2; -- a "word" is 16 bits ("size" values below are in words!)
wordsPerPage: NAT ~ 1024; -- a "page" is 1024 "words"
nil: CARDINAL ~ 177777B; -- commonly used for a nil value
passwordValue: CARDINAL ~ LOOPHOLE[-31574];
AttributeHeader: TYPE ~ MACHINE DEPENDENT RECORD[
password(0:0..15): CARDINAL, -- password, must equal passwordValue
length(1:0..15): CARDINAL -- length in words of attribute part, including this header
-- length must be a multiple of wordsPerPage
];
sizeAttributeHeader: NAT ~ SIZE[AttributeHeader];
PartHeader: TYPE ~ MACHINE DEPENDENT RECORD[
type(0:0..5): PartType, -- type of attribute part
length(0:6..15): [0..1777B] -- length in words, including this one
];
sizePartHeader: NAT ~ SIZE[PartHeader];
PartType: TYPE ~ MACHINE DEPENDENT {
nil(0), -- no more parts
raster(1), -- RasterPart follows
placement(2), -- PlacementPart follows
photometry(3), -- PhotometryPart follows
comment(4), -- CommentPart follows
(77B)
};
RasterPart: TYPE ~ MACHINE DEPENDENT RECORD[
scanCount(0:0..15): CARDINAL, -- number of scan lines
scanLength(1:0..15): CARDINAL, -- pixels per scan line
scanDirection(2:0..15): ScanDirection, -- scanning directions
samplesPerPixel(3:0..15): CARDINAL, -- number of samples
codingType(4:0..15): CodingType -- method of coding
];
sizeRasterPart: NAT ~ SIZE[RasterPart];
ScanDirection: TYPE ~ CARDINAL;
There may not be universal agreement on the interpretation of this value. The AIS documentation disagrees with (at least some versions of) AISFile.d. Fortunately, the two most commonly used values are unambiguous:
3 => pixels go toward the right of the page, scan lines toward the bottom
0, 8 => pixels go toward the top of the page, scan lines toward the right
CodingType: TYPE ~ MACHINE DEPENDENT {
nil(0), -- undefined
uca(1), -- UCACoding folllows
(177777B)
};
UCACoding: TYPE ~ MACHINE DEPENDENT RECORD[ -- UnCompressedArray
bitsPerSample(0:0..15): CARDINAL, -- number of bits for each sample
wordsPerScanLine(1:0..15): CARDINAL, -- number of 16-bit words per scan line
scanLinesPerBlock(2:0..15): CARDINAL, -- scan lines in each block, nil if no blocks
paddingPerBlock(3:0..15): CARDINAL -- words of padding at end of block, nil if no blocks
-- if there are blocks, wordsPerBlock = wordsPerScanLine*scanLinesPerBlock+paddingPerBlock
];
sizeUCACoding: NAT ~ SIZE[UCACoding];
PlacementPart: TYPE ~ MACHINE DEPENDENT RECORD[
xLeft(0:0..15): INTEGER, -- position of lower left corner
yBottom(1:0..15): INTEGER,
xWidth(2:0..15): INTEGER, -- size of image area on page
yHeight(3:0..15): INTEGER
];
sizePlacementPart: NAT ~ SIZE[PlacementPart];
PhotometryPart: TYPE ~ MACHINE DEPENDENT RECORD[
signal(0:0..15): SignalType ← bw, -- what type of signal is sampled
sense(1:0..15): CARDINAL ← 0, -- larger sample values are lighter if sense=0, else darker
scale(2:0..15): ScaleType ← nil, -- specifies the conversion between physical and sample values
scaleA(3:0..31), scaleB(5:0..31), scaleC(7:0..31): Value ← [0, 0],
spotType(9:0..15): SpotType ← nil, -- spot type
spotWidth(10:0..15): CARDINAL ← nil, -- in units of 100*(width in pixels)
spotLength(11:0..15): CARDINAL ← nil, -- in units of 100*(length in scanlines)
sampleMin(12:0..15): INTEGER ← -1, -- sample range, if known
sampleMax(13:0..15): INTEGER ← -1,
histogramLength(14:0..15): CARDINAL ← 0 -- number of words in histogram, nil if no histogram
];
sizePhotometryPart: NAT ~ SIZE[PhotometryPart];
SignalType: TYPE ~ MACHINE DEPENDENT {
bw(0), -- black and white
red(1), -- red separation
blue(2), -- blue separation
green(3), -- green separation
cyan(4), -- cyan separation
magenta(5), -- magenta separation
yellow(6), -- yellow separation
x(7), -- x signal (CIE)
y(8), -- y signal
RGB(100), -- red, green, blue samples, 3 per pixel
CMY(101), -- cyan, magenta, yellow samples, 3 per pixel
CMYB(102), -- cyan, magenta, yellow, black samples, 4 per pixel
Yxy(103), -- Y, x, y (CIE) samples, 3 per pixel
comments(177776B), -- specified in comments
undefined(177777B) -- undefined
};
ScaleType: TYPE ~ MACHINE DEPENDENT {
nil(0), -- undefined
reflectance(1), -- reflectance or transmittance
density(2), -- optical density
comments(177776B), -- specified in comments
undefined(177777B) -- undefined
};
Value: TYPE ~ MACHINE DEPENDENT RECORD[
sample(0:0..15): INTEGER, -- 1000*(actual reflectance or density)
level(1:0..15): CARDINAL -- corresponding digital sample value
];
SpotType: TYPE ~ MACHINE DEPENDENT {
nil(0), -- undefined
rectangular(1), -- spotWidth by spotLength
circular(2), -- diameter=spotWidth, spotLength is undefined
comments(177776B), -- specified in comments
undefined(177777B) -- undefined
};
histogramScale: INTEGER ~ 32767;
CommentPart: TYPE ~ BCPLStringBody;
sizeCommentPart: NAT ~ SIZE[CommentPart]; -- maximum
BCPLStringBody: TYPE ~ PACKED ARRAY[0..256) OF CHAR;
If s is a POINTER TO BCPLStringBody, length is ORD[s[0]], text is s[1..length]
END.