ColorTrixFile.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Bloomenthal, December 4, 1986 12:15:03 pm PST
Procedures for reading/writing files to/from the color display.
DIRECTORY ColorTrixBasics, Imager, ImagerColorMap, ImagerColorOperator, ImagerPixelArray, ImagerPixelMap, InterminalBackdoor, Interpress, IO, Rope, Terminal;
ColorTrixFile: CEDAR DEFINITIONS
~ BEGIN
ROPE:     TYPE ~ Rope.ROPE;
PixelMap:    TYPE ~ ColorTrixBasics.PixelMap;
PixelMapMisc:  TYPE ~ ColorTrixBasics.PixelMapMisc;
DeviceRectangle: TYPE ~ ImagerPixelMap.DeviceRectangle;
FileType:    TYPE = {bad, ip, bw, color};
File Write Operations
WritePmMiscToAIS: PROC [pmMisc: ColorTrixBasics.PixelMapMisc, name: ROPE];
Write AIS file(s) from the given pixel map(s). Proper suffixes added to name.
File Read Operations:
ReadFile: PUBLIC PROC [
baseName: ROPE,
aisX, aisY: CARDINAL ← 0,
aisW, aisH: CARDINALLAST[CARDINAL]]
RETURNS [pmMisc: PixelMapMisc];
Return a PixelMapMisc consisting of the named ais data.
Read8BitFile: PUBLIC PROC [
name: ROPE,
aisX, aisY: CARDINAL ← 0,
aisW, aisH: CARDINALLAST[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: CARDINALLAST[CARDINAL]]
RETURNS [pmMisc: PixelMapMisc];
Return a PixelMapMisc consisting of the rgb-named ais data.
Viewing Procedures:
ViewFile: PUBLIC PROC [
cd: PixelMapMisc,
baseName: ROPE,
center: BOOLFALSE,
aisX, aisY: CARDINAL ← 0,
aisW, aisH: CARDINALLAST[CARDINAL]]
RETURNS [error: ROPENIL];
View the named file according to suffix conventions.
View8BitFile: PUBLIC PROC [
cd: PixelMap,
name: ROPE,
center: BOOLFALSE,
aisX, aisY: CARDINAL ← 0,
aisW, aisH: CARDINALLAST[CARDINAL]]
RETURNS [error: ROPENIL];
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: BOOLFALSE,
aisX, aisY: CARDINAL ← 0,
aisW, aisH: CARDINALLAST[CARDINAL]]
RETURNS [error: ROPENIL];
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: ROPENIL];
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: ROPENIL];
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: BOOLTRUE] RETURNS [error: ROPENIL];
Display a set of three AIS files on the colordisplay using a color-dither context.
Interpress Operations
LogError: Interpress.LogProc;
Error proc for Interpress.DoPage.
OpenInterpress: PUBLIC PROC [name: ROPE] RETURNS [master: Interpress.Master];
ViewIpFile: PROC [name: ROPE, cmapInit: BOOLTRUE] RETURNS [error: ROPENIL];
Display an Interpress file on the colordisplay using a color context; initialize cmap if cmapInit.
Miscellany
Parse: PROC [name: Rope.ROPE] RETURNS [type: FileType ← bad, name1, name2, name3: Rope.ROPENIL];
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.
END.