IPConverters.mesa
Copyright Ó 1987, 1992 by Xerox Corporation. All rights reserved.
Pier, September 21, 1987 5:29:39 pm PDT
Jean-Marc Frailong January 20, 1988 12:09:37 pm PST
DIRECTORY
Commander, Imager, ImagerInterpress, IO, Rope;
IPConverters: CEDAR DEFINITIONS = BEGIN
Client interface to Interpress files
Beware: In order to avoid excessive GFI shortage, clients should avoid using the InterpressConverters install file and use instead the correct subsetting installation file (e.g. PressToInterpress.install) according to the procedure used.
Screen: TYPE ~ {dot, line};
ProgressProc: TYPE ~ PROC [pageNumber: INT, totalPages: INT] RETURNS [stop: BOOL ¬ FALSE];
Call after generating a page for feedback purposes. If totalPages<=0, unknown final master size. If returns TRUE, converter may stop. Converters to IP masters have to such callback procs, called respectively just before starting a page and just after finishing it.
PressToInterpress: PROC [inputName: Rope.ROPE, interpress: ImagerInterpress.Ref, beginPage, endPage: ProgressProc, msg: IO.STREAM, useXCFonts: BOOL, verbose: BOOL] RETURNS [failed: BOOL ¬ FALSE];
Convert press file to IP file. useXCFonts=TRUE means translate fonts to use XC encoding conventions and fonts (required if IP version <3.0). Verbose=TRUE means log font substitutions. Print various feedbacks onto msg (don't print anything if msg is NIL). Supports any IP master version. There is no provision to modify the page size definition. The IP master is not closed on completion.
InterpressToCompressedIP: PROC [inputName: Rope.ROPE, interpress: ImagerInterpress.Ref, beginPage, endPage: ProgressProc, msg: IO.STREAM, pageWidth, pageHeight: REAL, screen: Screen ¬ dot] RETURNS [failed: BOOL ¬ FALSE];
Generate a compressed master. IP master should be version 2.0 (otherwise why compress it ?). Errors are printed on msg if non-NIL, else raise errors. pageWidth and pageHeight should be given as there is no way of recovering them from the source IP master (????).
AISToInterpress: PROC [inputName: Rope.ROPE, interpress: ImagerInterpress.Ref, beginPage, endPage: ProgressProc, msg: IO.STREAM ¬ NIL, pageWidth, pageHeight: REAL, caption: Rope.ROPE] RETURNS [failed: BOOL ¬ FALSE];
Convert AIS file to IP master. Requires IP master to be at least version 3.1. pageWidth and pageHeight indicate page size in meters (IP conventions). The IP master is not closed on completion.
ColorAISToInterpress: PROC [inputRed, inputGreen, inputBlue: Rope.ROPE, interpress: ImagerInterpress.Ref, beginPage, endPage: ProgressProc, msg: IO.STREAM, pageWidth, pageHeight: REAL, caption: Rope.ROPE] RETURNS [failed: BOOL ¬ FALSE];
Convert color AIS file to IP master. Requires IP master to be at least version 3.1. pageWidth and pageHeight indicate page size in meters (IP conventions). The IP master is not closed on completion.
Client interface from Interpress files
IPReadError: ERROR [class: INT, code: ATOM, explanation: Rope.ROPE];
Raised in all procs that read IP masters and have no message stream when the error is not trivial (# classMasterWarning, classAppearanceWarning, classComment)
InterpressToPress: PROC [inputName: Rope.ROPE, context: Imager.Context, beginPage, endPage: ProgressProc, msg: IO.STREAM] RETURNS [failed: BOOL ¬ FALSE];
Convert IP file to press file described by an Imager context (obtained through ImagerPress.SimpleCreate). Errors are logged on msg if present, otherwise they are not caught. Return TRUE if anything went wrong. The press file is not terminated on exit, so that IP masters may be concatenated into a single press file.
InterpressToAIS: PROC [inputName: Rope.ROPE, outputBase: Rope.ROPE, msg: IO.STREAM, gray: BOOL, sPPI, fPPI: REAL, pageWidth, pageHeight: REAL] RETURNS [failed: BOOL ¬ FALSE];
Convert IP master to color/gray AIS file. sPPI and fPPI denote respectively the number of points per inch in the slow & fast scan directions. pageWidth and pageHeight are in meters. Only the 1st page of the master is converted. The suffix .ais is appended to outputBase to form the final file name if gray=TRUE, otherwise the suffixes -red.ais, -green.ais, -blue.ais are appended to outputBase to form the final file names.
InterpressToJAM: PROC [inputName: Rope.ROPE, ] RETURNS [failed: BOOLFALSE];
Convert IP master to JAM file. Not defined in detail yet...
Command interface
ActionProc: TYPE ~ PROC [inputName: Rope.ROPE, outputName: Rope.ROPE, cmd: Commander.Handle, cmds: IO.STREAM];
Command: Commander.CommandProc;
ColorAISToInterpressCommand: Commander.CommandProc;
PressToInterpressAction: ActionProc;
AISToInterpressAction: ActionProc;
InterpressToPressAction: ActionProc;
InterpressToCompressedIPAction: ActionProc;
InterpressToAISAction: ActionProc; -- not implemented. September 21, 1987
END.