ColorTrixFile.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Bloomenthal, December 4, 1986 12:15:03 pm PST
~
BEGIN
ROPE: TYPE ~ Rope.ROPE;
PixelMap: TYPE ~ ColorTrixBasics.PixelMap;
PixelMapMisc: TYPE ~ ColorTrixBasics.PixelMapMisc;
DeviceRectangle: TYPE ~ ImagerPixelMap.DeviceRectangle;
FileType: TYPE = {bad, ip, bw, color};
File Read Operations:
ReadFile:
PUBLIC
PROC [
baseName: ROPE,
aisX, aisY: CARDINAL ← 0,
aisW, aisH: CARDINAL ← LAST[CARDINAL]]
RETURNS [pmMisc: PixelMapMisc];
Return a PixelMapMisc consisting of the named ais data.
Read8BitFile:
PUBLIC
PROC [
name: ROPE,
aisX, aisY: CARDINAL ← 0,
aisW, aisH: CARDINAL ← LAST[CARDINAL]]
RETURNS [pmMisc: PixelMapMisc];
Return a PixelMapMisc consisting of the named ais data.
Read24BitFile:
PUBLIC
PROC [
rName, gName, bName: ROPE,
aisX, aisY: CARDINAL ← 0,
aisW, aisH: CARDINAL ← LAST[CARDINAL]]
RETURNS [pmMisc: PixelMapMisc];
Return a PixelMapMisc consisting of the rgb-named ais data.
Viewing Procedures:
ViewFile:
PUBLIC
PROC [
cd: PixelMapMisc,
baseName: ROPE,
center: BOOL ← FALSE,
aisX, aisY: CARDINAL ← 0,
aisW, aisH: CARDINAL ← LAST[CARDINAL]]
RETURNS [error: ROPE ← NIL];
View the named file according to suffix conventions.
View8BitFile:
PUBLIC
PROC [
cd: PixelMap,
name: ROPE,
center: BOOL ← FALSE,
aisX, aisY: CARDINAL ← 0,
aisW, aisH: CARDINAL ← LAST[CARDINAL]]
RETURNS [error: ROPE ← NIL];
Display an 8-bit AIS file on the colordisplay; the image will be read according to
aisX, aisY, aisW and aisH, and will be displayed according to cd's window.
If center, the image is centered on the colordisplay.
View24BitFile:
PUBLIC
PROC [
cd: PixelMapMisc,
rName, gName, bName: ROPE,
center: BOOL ← FALSE,
aisX, aisY: CARDINAL ← 0,
aisW, aisH: CARDINAL ← LAST[CARDINAL]]
RETURNS [error: ROPE ← NIL];
Display 3 8-bit AIS files as a 24 bit image; the image will be read according
aisX, aisY, aisW and aisH, and will be displayed according to cd's window.
If center, the image is centered on the colordisplay.
Display:
PROC [
cd: Imager.Context, pa: ImagerPixelArray.PixelArray, op: ImagerColorOperator.ColorOperator];
Display the given pixel array centered in the given context.
ViewDitherFile:
PROC [fileName:
ROPE, cd: Imager.Context ←
NIL, center, cmapInit:
BOOL]
RETURNS [error: ROPE ← NIL];
Display an 8-bit AIS file on the colordisplay using a dithered context.
If center, the image is centered on the colordisplay.
If cmapInit, the color map is initialized.
ViewGrayFile:
PROC [fileName:
ROPE, cd: Imager.Context ←
NIL, center, cmapInit:
BOOL]
RETURNS [error: ROPE ← NIL];
Display an 8-bit AIS file on the colordisplay using a grayscale context.
If center, the image is centered on the colordisplay.
If cmapInit, the color map is initialized.
ViewColorFiles:
PROC [r, g, b:
ROPE, cmapInit:
BOOL ←
TRUE]
RETURNS [error:
ROPE ←
NIL];
Display a set of three AIS files on the colordisplay using a color-dither context.
Miscellany
Parse:
PROC [name: Rope.
ROPE]
RETURNS [type: FileType ← bad, name1, name2, name3: Rope.
ROPE ←
NIL];
Parse input filename to determine type of file (bad, ip, bw, or color) even if filename has no extension; name1 is returned with proper extension; if file type is color, then name1, name2, and name3 are names of red, green, and blue ais files.