ImagerDoc.tioga
Doug Wyatt, May 26, 1985 12:23:50 pm PDT
Michael Plass, February 23, 1994 11:02 am PST
Rick Beach, March 13, 1987 11:31:30 am PST
Willie-Sue, November 25, 1987 4:07:10 pm PST
Russ Atkinson (RRA) January 27, 1994 8:59 pm PST
THE CEDAR IMAGER
CEDAR 10.1 — FOR INTERNAL XEROX USE ONLY
The Cedar Imager
Device-independent image generation in Cedar
Michael Plass and Doug Wyatt
© Copyright 1985, 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994 Xerox Corporation. All rights reserved.
Abstract: Package for device-independent image generation in Cedar.
Created by: Michael Plass and Doug Wyatt
Maintained by: Michael Plass:PARC:Xerox
Keywords: artwork, color, device independence, display, fonts, graphics, illustration, Imager, images, Interpress, printing, sampled images, scanned images
XEROX  Xerox Corporation
   Palo Alto Research Center
   3333 Coyote Hill Road
   Palo Alto, California 94304

For Internal Xerox Use Only
News
Bug fix: wrong limit used for pixel decoding February 23, 1994
FallbackTranslatePixels.SlowTranslate.pixelIn was using the wrong value for limit. Thanks to Jim Kenealy for tracking this down. (I think this bug was introduced in the January 19 version; it has not propagated into DocuPrint 1.2.) [MFP]
changed: ImagerColorTranslateImpl
Performance fix: 3/2 image scaling February 4, 1994
When the larger collection of fast cases for certain scales/rotations of MaskBitmap was put in (March 1, 1993), the fast case for unrotated 3/2 scale slowed down by about 20 to 30%, due to extra overhead in the more generalized mechanism. The old code for this particular fast case has been reinstated to get the performance back. [MFP]
changed: ImagerDeviceWorksImpl
Performance tweaks: ImagerColorTrilinearTranslateImpl January 27, 1994
Tighted up the code and added caching suitable for multi-process use. Some Commander routines are present for experimentation and measurement. No functional changes (intended). [RRA]
changed: ImagerColorTrilinearTranslateImpl
Performance tweaks: ImagerSample January 26, 1994
Tighted up the code and added some more special-case handling to several of the sample-buffer handling routines (especially for GetSamples). No functional changes (intended). [MFP, RRA]
changed: ImagerSampleImpl
new: ImagerSamplePrivate
Bug fix: ImagerScanConverterImpl.AdvanceEdge   January 24, 1994
Fixed a typo in a branch of this procedure that evidently is not executed very much. Thanks to Yasuo Nakajima for noticing the problem. [MFP]
changed: ImagerScanConverterImpl
Performance fix: ImagerSample.PutSamples January 21, 1994
Added a fast case for 8 bits per sample, which works for any delta. [MFP]
changed: ImagerSampleImpl
New interface: ImagerColorTranslateWorks January 19, 1994
This new interface provides a way to register accelerators for the color-space conversion step for sampled images. [MFP]
changed: ImagerColorTranslateImpl
new: ImagerColorTranslateWorks
Changes to scanFatSwitch (-s) January 13, 1994
The switch that controls the scan converter's mode has been moved to ImagerDeviceWorksImpl; now it will no longer effect stroke rendering, and hence may be of more utility. [MFP]
changed: ImagerScanConverterImpl, ImagerDeviceWorksImpl
new: ImagerScanConverterExtras
Compatibility wart: snapping scale factors for sampled blacks January 3, 1994
Added a switch (-a) to allow sampled blacks to be rescaled (by a factor close to unity) to improve the speed and/or quality of the rendering. (This is done mainly to compensate for Interpress creators that seem to have a hard time getting a unity scale factor.) [MFP]
(This was put into DocuPrint on November 1, 1993)
changed: ImagerRasterImpl
Bug fix: NextChar for Type1 fonts November 10, 1993
The NextChar method for Type1 fonts now works. This fix is mainly for the benefit of font utilities, and does not come into play for normal rendering.
changed: ImagerType1TypefaceImpl
Performance fix: image scaling of 2 to 1 October 28, 1993
Added a 2 to 1 scaling case for images. As with the other special cases (4/5 and 3/2), the resulting image may be darker than the general case of scaling would provide, since we use bitwise OR to compute the bits, but this is probably acceptable given the enhanced performance (over 3X faster). [RRA]
changed: ImagerDeviceWorksImpl
Bug fix: accented Type 1 characters October 28, 1993
Accented characters (using seac in the char string) were interpreted relative to the font's encoding vector, but we have modified this to use the standard encoding vector, consistent with the Adobe implementation (although slightly inconsistent with the Type 1 Font spec). [RRA]
changed: Type1FontImpl
New interface: ImagerDeviceColor October 28, 1993
The new interface ImagerDeviceColoris meant to provide support for Postscript's undercolorremoval, blackgeneration, and transferfunction features.
As background, CII has a requirement to provide support for the 'device-dependent' color adjustments afforded by Postscript's undercolorremoval, blackgeneration, and transferfunction features. It is well understood that this, by itself, is an inadequate mechanism for controlling high-quality color rendition, but since the PDL allows it, we need to provide for it.
The substance of ImagerDeviceColor is a small collection of one-dimensional lookup tables, accessible via an ImagerDevice.Device, with (more-or-less) well-defined semantics. There are also procedures provided to apply these table in the defined way. These are provided as features that a Device implementation may invoke as part of its color transformation procedures, but there is no requirement that these be the sole color transformation mechanism.
In the interest of being able to extend and experiment, DeviceColorControlRep includes a propList and a (currently unused) opaque REF.
N.B SampledBlack is not subject to the transfer functions.
new: ImagerDeviceColor, ImagerDeviceColorImpl
changed: ImagerBitmapContextImpl
changed clients: ImagerPrintContextImpl, ImagerHighlightContextImpl,
ImagerPrintColorImpl, ImagerDitherContextImpl, ImagerDitherContextPrivate,
ImagerFourColorContextImpl
Bug fix: dashed strokes with negative offset July 16, 1993
Negative offsets on dash patterns now work properly. (This is a very old bug that nobody noticed until recently.) There have also been some checks added for negative dash lengths, and for zero total length.
changed: ImagerStrokeImpl, ImagerDeviceWorksImpl, ImagerSysImpl
Bug fix: opening a directory July 16, 1993
An attempt to open an (NFS-mounted) directory with ImagerSys.StreamOpen will now return NIL, indicating file not present.
changed: ImagerSysImpl
Bug fix: ImagerDeviceWorksImpl.MapDashSegments. July 5, 1993
ImagerDeviceWorksImpl.MapDashSegments incremented k twice in the second loop. This could cause spurious rangecheck exceptions for some kinds of dashed strokes.
changed: ImagerDeviceWorksImpl
Bug fix: ImagerImageWorksImpl.BufferedGetSamples. July 1, 1993
ImagerImageWorksImpl.BufferedGetSamples was using the wrong index for the high fill sample, causing a bounds fault (this is a relatively new procedure finding its first client in CII, so there should be no impact on existing Imager clients).
Also added empty-box checks to DrawBufferedImage and DrawInterleavedImage.
changed: ImagerImageWorksImpl
Bug fix: degenerate cases in strokes scan conversion. June 25, 1993
The depth limit that was added to DivideUntilSmooth (May 28) only covered the recursion; the possibility for infinite loops still existed. This has been fixed.
changed: ImagerStrokeImpl
Bug fix to ImagerSys.RopeFromStream: June 16, 1993
ImagerSys.RopeFromStream now catches the IO.Error that PFS.OpenFileFromStream might raise. It also now optimizes the case in which the stream is a rope input stream.
changed: ImagerSysImpl
Dashed line performance improved: June 16, 1993
Improved the performance of dashed lines, in the case that the path consists of a single straight line segment.
changed: ImagerDeviceWorksImpl
Halftoning improved: May 28, 1993
The range of thresholds in a generated halftone pattern have been adjusted slightly. It seems that the April 29, 1991 change, while fixing the problem at the dark end, gave short shrift to the light end. In conjunction with PS changes, this addresses RRARs 647 and 650 (and probably some others).
changed: ImagerBrickImpl
Bug fix: degenerate cases in strokes scan conversion. May 28, 1993
Fixed several problem areas in stroke and dashed stroke handling: ImagerPath.ConicToCurves now checks for NaN values of r; depth limit added to Curve and Conic procs in ImagerStrokeImpl.PenStroke, and to DivideUntilSmooth; DivideUntilSmooth no longer emits zero-length pieces; Dashes.Advance fixed to avoid looping in case no progress is made; Dashes.curve made robust aginst zero speed (this is redundant with the fix to DivideUntilSmooth but not a bad idea anyway). These changes address DP SPAR 797203486, as well as a problem encountered by XSoft.
changed: ImagerPathImpl, ImagerStrokeImpl
Bug fix: ImagerFont.MapRope and ImagerFont.MapText ERRORs May 28, 1993
The unnamed ERRORs in ImagerFont.MapRope and ImagerFont.MapText have been replaced by ImagerError.Error[[$invalidEncoding, ...]].
changed: ImagerFontImpl
Bug fix: funny results from CharCodeConvert.NameFromXChar May 14, 1993
A few character codes have ended up having multiple names, and CharCodeConvert.NameFromXChar is supposed to report the most "reasonable" name, but it wasn't due to the initialization order of the tables. This has been fixed.
changed: CharCodeConvertImpl
Bug fix: substitute characters in Type 1 fonts April 12, 1993
The behavior of a missing character is now the same as .notdef, as per the specification. Also fixed the Correction procedure to return better values, which should speed up some cases of show a little.
changed: ImagerType1TypefaceImpl
New interface: ImagerImageWorks March 29, 1993
This interface enables the rendering of large images by allowing the image data to come from a stream, or from band buffers in memory; it takes care of the bookkeeping to minimize or eliminate artifacts at the band boundaries.
changed: ImagerPackage
new: ImagerImageWorks, ImagerImageWorksImpl
Added fallback case for ImagerPixelArray.Copy March 11, 1993
ImagerPixelArray.Copy will now work, even in the case that the original is mutable and has no copy proc.
changed: ImagerPixelArrayImpl
Fix to Xerox/Process color model operator March 8, 1993
The Xerox/Process color model operator was emitting and accepting its arguments in an order different than that specified in the Color Encoding Standard. This has been fixed. The buggy order will still be accepted (with a warning), but a newly-created master may not work on a printer that accepts only the buggy order.
Also reordered the CONTROL list in ImagerPackage.config
changed: ImagerColorImpl, ImagerPackage.config
More fast cases for MaskBitmap March 1, 1993
There are now fast special cases for MaskBitmap when the transformation consists of a combination of a rotation by a multiple of 90 degrees a scale factor of 1.0, 1.25 or 1.5.
changed: ImagerDeviceWorksImpl
Fix to MaskBitmap, 90 degree fast case January 25, 1993
The 90 degree fast case of MaskBitmap (ImagerDeviceWorksImpl.RoxyMaskBitmap) uses a small scratch buffer to do the block-rotates around the edges of the image. This buffer was not getting cleared before use, which can, under certain fairly rare circumstances, cause some garbage bits to appear in the output. The fix was to add the Clear call.
changed: ImagerDeviceWorksImpl
Fix to MaskBitmap November 6, 1992
For the hard case of MaskBitmap (that uses the general-purpose sampler), it was possible to run afoul of the fact that the sampler wraps around at the edges, thus introducing artifacts at band boundaries. This has been fixed by ensuring that the bitmap as seen by the sampler has a clear border around the edge.
Changed a constant in ImagerColorTranslateImpl (fixes a typo; the limit was meant to be a power of two).
changed: ImagerDeviceWorksImpl, ImagerColorTranslateImpl
Fix to ImagerTypeface.GeneralCaptureCharMask October 20, 1992
GeneralCaptureCharMask was failing to pass the parameters down to ImagerMaskCapture.CaptureManhattan; this caused stroked fonts to not be thickened.
changed: ImagerFontImpl
Fixes to ImagerColorPrivate.DefineProcessSpace October 20, 1992
ImagerColorPrivate.DefineProcessSpace had a bug that would not allow process-color spaces beyond $firstProcess to be defined. Also, there were no color operators getting registered for some of the built-in color spaces; this has been fixed.
changed: ImagerColorImpl, ImagerColorPrivateImpl
Oops... October 15, 1992
Fixed a (potentially disasterous) bug in yesterday's change to ImagerSample.Clear
changed: ImagerSampleImpl
More fast clearing October 14, 1992
Systematically replaced calls on ImagerSampleImpl.UnsafeFill with the faster Basics.FillWords; also made ImagerSample.Clear detect the case that it can do just one call to Basics.FillWords.
changed: ImagerSampleImpl
Metrics2 parsing added to Type1 font parser September 30, 1992
Incorporated code from Fuji to parse Metrics2 dictionaries in Type1 fonts.
changed: Type1FontImpl
Error checking for ImagerTransformation.Destroy September 29, 1992
Added a bit more consistency checking to help detect re-use of Transformation reps that have nominally been destroyed. This just helped to diagnose a PS problem. Also, transformations now come from the untraced zone.
changed: ImagerTransformationImpl
Fast filling cases September 25, 1992
Added some fast-case tests to take advantage of the high-speed Basics.FillWords; in particular this speeds up full-page-buffer fills.
changed: ImagerSampleImpl
Brick computation September 21, 1992
When ImagerBrick.BrickSpecFromTransformedRectangle is enlarging the brick pattern in order to satisfy the minLevels parameter, it now does so in a manner that treats the s and f scan directions more fairly; this reduces diagonal artifacts in the resulting brick.
Also, the implementation is now robust against degenerate and near-degenerate clientToDevice transformations.
changed: ImagerBrickImpl
ObtainScratchMap change September 1, 1992
ImagerSample.ObtainScratchMap no longer ever gets its memory via CountedVM. It turns out that CountedVM ultimately ends up allocating the memory out of the heap, anyway, and with a significant about of extra bookkeeping.
Also, ObtainScratchMap takes the best fit from its (very small) pool, rather than the first fit, and ReleaseScratchMap behaves differently than it used to when the pool fills up.
changed: ImagerSampleImpl
CD typeface bug fixed August 19, 1992
For a cd-format font containing multiple sizes/resolutions, the Imager was erroneously selecting the lowest resolution raster, rather than the highest, in the case that none of the available resolutions matched the target resolution within tolerance.
changed: ImagerCDTypefaceImpl
minThickness support August 18, 1992
The minThickness parameters are now used when calculating up a pen shape.
new: ImagerPenExtras
changed: ImagerPenImpl, ImagerRasterImpl
Some odds and ends July 16, 1992
ImagerSampleImpl.RegionFill did not work right for bitsPerSample > 1.
ImagerPenImpl.MakeTransformedCircle now has a fast return for a zero-width request.
The special MaskBitmap case that does a 3/2 scale was not checking as much of the transformation as it should have - this could lead to a uniform 3/2 scale being done when the client had requested an anamorphic scale.
changed: ImagerSampleImpl, ImagerPenImpl, ImagerDeviceWorksImpl
Bug fix: another unusual case July 15, 1992
Random testing provoked another uncaught error ImagerPixelImpl.boxActionPointSamples - this time not involving a font. This time the fix was to make ImagerPixelImpl.Resample more forgiving in the order of boxes it is willing to accept.
changed: ImagerPixelImpl
Bug fix: a really unusual case July 14, 1992
Random testing revealed a bug that could be provoked by a pretty esoteric combination of circumstances, to wit: a show using a cached bitmap character, with a complicated clipping region, and a sampled color. (This is a combination of circumstances not accessible from postscriptTM.) The symptom was an uncaught error in ImagerPixelImpl.boxActionPointSamples.
changed: ImagerDeviceWorksImpl
Performance: scan conversion July 14, 1992
I did some performance tuning on the scan converter. The net improvement for synthetic graphic masters was measured to be about 25% (your milage may vary). Also, I removed the code to interface to UnsafeTile - this had been present as a runtime selectable option, but was not being used since it offered no performance benefit.
changed: ImagerScanConverterImpl, ImagerSampleImpl
Fixed: overflow in computation of table size for color lookup tables June 21, 1992
The computation of tableSize in ImagerColorTranslateImpl.TranslatePixels could overflow to 0, causing the code to try and do a full table-lookup when there was really no chance of doing so.
changed: ImagerColorTranslateImpl
Improved support for CMYK colors June 19, 1992
The Xerox/Process color model operator now has some provisions for getting the output in a CMYK color space. (This change needs further testing.)
changed: ImagerColorImpl
new: ImagerTestProbe (an interface for Imager implementors only)
Sampling quality improved for bitmap masks at certain transformations June 19, 1992
Bitmaps masks that were rendered with small non-integer scale factors greater than 1 were coming out with very different appearances depending on the rotation (even for rotations that are multiples of 90 degrees). This has been improved. Also, the threshold that selects between simple point-sampling and the fancier algorithm has been increased from 1.0 to 1.5, and has been made a parameter settable with the ImagerSwitches command.
changed: ImagerDeviceWorksImpl
Several small fixes June 15, 1992
An error (other than fileNotFound) while opening a font file is now turned into an ImagerError.Error with code=$ioError.
Fixed ImagerRaster.DoWithDevice to push the clipping information down to the underDevice; this was affecting Draw2d when used with a software cursor.
Disabled some checking code in the scan converter; this code was recently left enabled (unintentionally).
changed: ImagerTypefaceImpl, ImagerRasterImpl, ImagerScanConverterImpl
New ImagerFontEnvironment interface June 10, 1992
Added an interface to allow enumeration of fonts by name. The implementation for this needs to be run separately.
new: ImagerFontEnvironment, ImagerFontEnvironmentImpl
Bug fix for ImagerFont.NextChar on a Type1 font May 13, 1992
Fixed a bounds fault in the NextChar proc for the Type1 typeface - this bug was introduced in the conversion to allow 32-bit character codes.
changed: ImagerType1TypefaceImpl
Not quite a bug May 13, 1992
Changed StandardShow to call MaskCharMask through the class rather than calling StandardMaskCharMask directly; this is to facilitate layering at the device works level.
changed: ImagerDeviceWorksImpl
Stroke rendering bugs fixed May 1, 1992
Fixed two bugs in the stroke-rendering code.
One problem was that a cubic curve could be approximated by one parabolic piece, which did not leave enough degrees of freedom to preserve the tangent information at the ends. In some instances, the curve wrapped back onto itself, obscuring the end treatment.
The second bug caused strokes to occasionally not be imaged, due to confusion about which direction a straight curve turns.
changed: ImagerStrokeImpl
ColorFromYES April 16, 1992
Fixed a bug in ImagerColor.ColorFromYES - the E and S components were computed incorrectly. (This is a path through the code that is not needed for Interpress, so the only affected clients are new ones.)
Also:
improved the precision on ImagerColor.ColorFromCIELAB
implemented ImagerColor.HSVFromColor.
added CMYKCompatibilityImpl to provide an implementation for the old, nonstandard Xerox/Research/CMYK color model operator
changed: ImagerColorImpl
new: CMYKCompatibilityImpl
Xerox/HightlightLinear March 27, 1992
Implemented the Xerox/HighlightLinear color model operator.
Added the Xerox/Highlight named color.
The interface presented in ImagerColor.mesa is less than ideal; the desired changes are detailed in ImagerColorExtras.mesa (which is not exported at this time, but stored as source only).
Also fixed ImagerSampleImpl.Halftone to use BITRSHIFT instead of BITSHIFT ( since BITSHIFT is no longer an inline in Cedar 10).
changed modules: ImagerColorImpl, ImagerSampleImpl
fast case for 90 degree rotation March 9, 1992
Added a fast case for MASKPIXEL with a rotation of -90.
changed modules: ImagerDeviceWorksImpl
Better control of typeface registration order. February 4, 1992
Changed the implementation of ImagerTypeface.RegisterCreator to always use the same lookup order for the "well-known" Typeface creators.
changed modules: ImagerTypefaceImpl
pixelArrayTransformationUses January 24, 1992
Enhanced CD font support to provide a pixelArrayTransformationUses property (as described in the Font Interchange Standard) in the typeface propList.
Changed the transformation sorting in ImagerFDBuildImpl to be less sensitive to floating-point fuzz.
changed modules: ImagerCDTypefaceImpl, ImagerFDBuildImpl
Type1Font additions January 15, 1992
Added Metrics and Metrics2 provisions to Type1FontData. Implementation will follow.
changed modules: Type1Font
FD typeface made robust against bad create dates January 13, 1992
The error checking that was being done to ensure that the create dates of constituent fonts matched the dates in the FD font description file was relaxed; apparently it is asking too much of certain operating systems to require that these create dates be preserved.
changed modules: ImagerFDTypefaceImpl
Type1FontImpl.StandardEncodingAccentedCharacter December 9, 1991
Type1FontImpl.StandardEncodingAccentedCharacter now looks up its character code arguments in theStandardEncoding rather than self.Encoding, to fix a problem the folks down south encountered with a re-encoded font. This seems consistent with the behavior of Adobe's software, despite a claim in the description of the seac operator (Adobe Type 1 Font Format, p. 50) that "... the characters ... must be in the same positions in the font's encoding vector as the positions they occupy in the Adobe StandardEncoding vector."
changed procedures: StandardEncodingAccentedCharacter
ImagerDeviceWorksImpl.MaskBitmap performance improvement September 13, 1991
The FastHardMaskSampledBits case uses the Imager's SHOW machinery to render bitmap masks that need to be scaled up and/or rotated by unnatural values. The observation that this was spending a lot of its time on zeros suggested adding an accelerator for that case. A test case that simulated FAX resolution (200 spi) page images (of text) rendered at 300 spi showed a factor of two improvement by this change.
Also removed the obsolete "oldFastCharAction" procedure.
changed procedures: FastHardMaskSampledBits, BitCorrection; deleted oldFastCharAction
ImagerSampleImpl VM threshold adjusted June 21, 1991
ImagerSampleImpl uses a NEW of WordSeqRep to create new memory for sample maps if the size is below some threshold, and uses CountedVM above that threshold. Experiments indicate that this threshold (which was 900000) should be much lower. The default has been changed to 2000, and a routine (SetMaxSeq←P1560) has been added to enable using the interp command to change it for further experiments.
Likely sources of false pointers fixed: June 4, 1991
Several runs of a stroke-intensive master turned up an apparent storage leak; by tracing backwards throgh the heap structures, it was discovered that certain of the Imager's free lists were prone to contain words that looked like REFs, even though they were not (for the curious, these were of type Scaled.Value, a 32-bit scaled number with the binary point in the middle). This conspired with the presence of long lists to help cause the storage leak. Changes to: ImagerScanConverterImpl.Destroy, ImagerScanConverterImpl.FreeEdges, ImagerMaskCaptureImpl.Launder, Type1FontImpl.DecryptCharString.
Note: in retrospect this was not really a significant problem - in fact a long scratch list was being accumuated and never used in the PS interpreter. These changes are still for the good, but not as important as originally thought.
New interface: May 31, 1991
Added the ImagerType1Typeface interface to enable both better PS downloaded-type1 support and FontSolution type1 support.
ImagerMaskCacheImpl: May 31, 1991
Added an UNWIND to the UpdateParameters proc to release the monitor in case the callback dies.
Empty MaskPixel bug fix: May 20, 1991
MaskPixel would die with a zero-divide in ImagerRasterImpl if the fSize were zero.
Sampling improved: April 29, 1991
The sampling code in ImagerPixelImpl works by stepping through device space, keeping track of where the cooresponding source coordinates are. To support Interpress sampled colors, it wraps around at the edge of the source; this would sometimes cause the wrapped-around edge to be visible even when it wasn't intended, due to roundoff in the source-space deltas. The change was to always choose the rounding so that this case should no longer happen.
Halftoning improved: April 29, 1991
The calculation of the threshold levels in ImagerBrickImpl was changed slightly to allow full-white and full-black to get their fair share of the gray ramp. It turned out that halftoned images were not getting quite all the way to black.
icffile typeface removed from config: April 22, 1991
The icffile typeface implemetation is no longer included in ImagerPackage. The functionality of this implementation is effectively subsumed by CFontSolution, and there should be no .icffile format fonts in active use at this time.
ImagerSys FileError use improved: April 19, 1991
The ImagerSys procedures for stream creation now raise FileError as the interface says they should; ImagerSys.OpenInputFile still returns NIL if the named file does not exist. This was done to allow the Interpress package to use ImagerSys for its filesystem dependencies, thus enhancing its portability.
Typeface creation tidied up: April 19, 1991
The info and fontExtents fields of the Typeface representation are now filled in by lazy evaluation in ImagerFontImpl. This means that they can (should) be left NIL at typeface creation time.
Font substitution improved: April 17, 1991
The Imager's font substitution strategy (which was to substitute Modern for everything) has been improved, at least for fonts that have names like Xerox/XC1...
Type1 font support: March 12, 1991
Integrated Doug Wyatt's implementation of Adobe Type1 font support. The typeface implementation that is part of the Imager package does not use the hints to generate good-looking output; further implementation will be done in PS package to enable downloaded type1 support and in CFontSolution to enable use of the hints. New interfaces: Type1Font, CharCodeConvert.
See ImagerNews.tioga for old news.
Introduction
The Imager is patterned strongly after the imaging facilities available in Interpress, so refer to these publications for a description of the semantics of the various Imager operations:
Interpress Electronic Printing Standard (Version 3.0, XNSS 048601, January 1986) (Chapter 4)
Introduction to Interpress (Sproull & Reid, XSIG 038306, June 1983)
Of historical interest:
Interpress Electronic Printing Standard (Version 2.1, XSIS 048404, April 1984) (Chapter 4)
Full Interpress (Interpress Extension Strategy) (DRAFT June 1983) (Chapter 4)
Of these, version 3.0 of the Interpress Standard corresponds most closely with the Imager.
For examples of how to use the Imager, refer to ImagerExamples.df on CedarChest. CedarChest also contains packages for creating Imager contexts for different kinds of output, including color displays and Interpress masters; refer to the CedarChest catalog for further information.
Refer to Viewers for information on obtaining Contexts that output to the displays.
History
Imager is a successor to the Cedar Graphics package that was developed by John Warnock and Doug Wyatt. The design of Imager benefited from advice offered by Frank Crow, Butler Lampson, Scott McGregor, Ken Pier, Lyle Ramshaw, Bob Sproull, and Maureen Stone. The main designers and implementors of Imager were Michael Plass and Doug Wyatt.
Public Interfaces
Imager
The main one. Refer to the comments in the interface for a description of the various operations.
ImagerBox, ImagerColor, ImagerFont, ImagerPath, ImagerPixel, ImagerPixelArray, ImagerSample, ImagerTransformation, SF, Vector2
For dealing with particular data types that are used by Imager. The sections below deal with some aspects of these data types; see also the comments in the interfaces.
ImagerBitmapContext
For creating contexts for drawing into a bitmap.
ImagerBackdoor
Operations that are not applicable to every kind of context.
Contexts
An Imager Context is the client program's handle; it is the way the connection is established to a particular output medium (display, output file, etc.). The context indicates the collection of implemenation routines (context.class), as well as any implementation-dependent state information. For one main subclass of context implementations (the raster implementations), much of the state is stored under context.state, and is accessible to the client via the ImagerBackdoor interface. Additional device-dependent state is stored in context.data. Operations that are specific to only one kind of context generally appear in the same interface used to create contexts of that kind.
The creation of contexts is not centralized; there are many interfaces (most of which are not part of the Imager per se) for creating contexts of variaous flavors. Clients that are running under Viewers will obtain their contexts via Viewer paint procs. The second most common way for clients to get a context is via ImagerInterpress, which is part of the Interpress component.
Transformations and Coordinate Systems
Device coordinates
The Device coordinate system is in whatever units are most convenient for the implementation.
Surface coordinates
The Surface coordinate system covers the entire output medium, one unit per pixel, with the origin at the lower-left corner and x to the right, y up.
View coordinates
The View coordinate system is normally just a translation from the Surface coordinates. This is normally maintained by the window package, not by random clients. When reading Interpress documentation, read "View coordinates" wherever you see "Device Coordinates". The View has a clipping area associated with it, which is often (but not always) just a rectangle. The View clipping area, as well as the View transformation, are not affected by DoSave, or DoSaveAll.
Client coordinates
The Client coordinate system is the one the client thinks in terms of. Initially in meters, it may be changed by the client at any time to whatever is most convenient. (If the client is using a context provided by viewers, the initial client-to-view is the identity, which is in some ways less device-independent, but often more convenient.)
The client-to-device transformation is accessible via ImagerBackdoor.GetT from those contexts that retain state information.
The basic procedure for changing the current (client-to-view) transformation is:
Imager.ConcatT: PROC [context: Context, m: Transformation];
ConcatT premultiplies the current transformation by an arbitrary transformation. Procedures for building general transformations are in the ImagerTransformation interface. For most applications, the convenience procedures ScaleT, Scale2T, RotateT, TranslateT are handy. ScaleT applies a uniform scaling factor; Scale2T scales independently in x and y; RotateT applies a rotation (measured in degrees, counterclockwise if positive); and TranslateT translates the origin.
Colors
There are four main variants of color that the Imager knows about:
op constant
This is a constant color that comes from applying a color operator. This kind of color is represented in an unevaluated form, as simply the color operator and its argument vector. One important aspect of this kind of color is that it always makes sense to interpolate continuously between color values, so that filtering for antialiasing will always make sense (see the sampled case, below). Examples of op constant colors are various flavors of gray (GrayLinear, GrayDensity, GrayVisual, etc), RGB (red-green-blue), CMY (cyan-magenta-yellow), etc.
special constant
This is a constant color that may not be interpolated, and that may have a greater degree of device dependence. These would most often be asked for by name via ImagerColor.Find, or created via the interfaces associated with particular kinds of Imager contexts. Examples of these are device-resolution stipples and special pixel colors for color-mapped frame buffers. Special constant colors have a link (substitute) field in them, so that context implementations can search for the first appropriate case; for example a special pattern for the color display may link to a black-and-white stipple for the black-and-white display, which in turn may point to an ordinary gray that will work on any context.
sampled
This is a color that consists of an array of pixel values, together with a color operator that indicates how the pixel values are to be interpreted. There is also a transformation for controlling the size, orientation, and positioning. The array of pixels tiles the whole plane.
sampledBlack
This is similar to a sampled color, but is restricted to one bit per pixel, and instead of a color operator there is only a Boolean to say whether zeros are white or transparent (ones are always black).
Fonts
Font names
Fonts are named using a hierarchical naming scheme, with the components of the name separated by slashes. Examples:
Xerox/XC1-2-2/Modern-bold
The first component in all our fonts says that this is a font in the Xerox portion of the hierarchical name space. See the address in the back of the Interpress standard for information about how the name space is administered.
The second component here, XC1-2-2, identifies the character codes in the font as conforming to a particular version of the Xerox Character Code Standard. This is a 16-bit code that provides for many more characters than the normal ASCII encoding. The face information is encoded as a postfix:
-bold
-italic
-bold-italic
Xerox/PressFonts/Modern-brr
This is an older font; the characters associated with the codes varies from font-to-font. The face information is encoded as
-mrr Medium Roman Regular
-brr Bold Roman Regular
-mir Medium Italic Regular
-bir Bold Italic Regular
Xerox/TiogaFonts/Modern10B
This is a font designed for use on the display at a particular size; it may still be scaled and rotated, but it is likely to look good only at one size. This size is therefore part of the name. The face information is encoded as B, I, or BI at the end of the name, without dashes. Note that these fonts are already pre-scaled to the declared size, a convention that, in retrospect, is probably not a good one (it makes font subtitution less likely to work, for instance).
Xerox/XC1-2-2/Tioga-Modern-bold-10
This is similar, but it conforms to the Xerox Character Code Standard, and uses a more verbose encoding of the face information. (This is not in use yet; the details may change.)
Font lookup
Font files live on subdirectories of /imagerfonts/ in the local name space. The PCedar Imager uses PFS to look up these files, so the PFS prefix map facilities may be used to tailor the font namespace to various applications. For instance,
/imagerfonts/xerox/xc1-2-2/modern-bold.fis
is the file that describes Xerox/XC1-2-2/Modern-bold; the extension identifies the format ot the font files. Note the filename is all lower-case, in case it matters. The list of known extensions is currently
ac - aligned raster characters (normally used for printer resolution)
cd - combined dictionary that may combine both ac and spline formats
strike - raster characters at screen resolution; very old-fashioned format
ks - kerned strike; allows the escapement to differ from the bounding box
gf - general format; compressed raster font produced by METAFONT
fd - font description that describes a font in terms of other fonts.
fis - Font Interchange Standard fonts (to get these, InterpressPackage must be running).
psf - Adode Type 1 font.
icf - FontSolution intermediate contour format (to get these, CFontSolutionPackage must be running).
For details on all but the last four, see [Cyan]<PrintingDocs>FontFormats.Press. There are some changes in the way the fields of the ac fonts are interpreted; in particular the resolutionY fields in some ac fonts contain the character set information.
In no case (so far) does the Imager get multiple fonts from a single file.