TrcDoc.tioga
Copyright Ó 1987 by Xerox Corporation. All rights reserved.
Eric Nickell, February 4, 1987 1:27:44 pm PST
TRC MANIPULATION
CEDAR 6.0 — FOR INTERNAL XEROX USE ONLY
Trc Manipulation for Cedar
(or any type of function manipulation, actually...)
Eric Nickell
© Copyright 1986 Xerox Corporation. All rights reserved.
Abstract: Trc provides capabilities for manipulating and viewing single-valued functions of one variable. It derives its name from "Tone Reproduction Curve", a particular type of function the authors wished to work with.
Created by: Eric Nickell
Maintained by: Eric Nickell <Nickell.pasa>
Keywords: TRC, Tone Reproduction Curve, Function
XEROX  Xerox Corporation
   Palo Alto Research Center
   3333 Coyote Hill Road
   Palo Alto, California 94304

For Internal Xerox Use Only
1. Philosophy
Trc provides an object-oriented approach to the use of tone reproduction curve which are mutable in controlled ways. A TRC is a single-value function of one variable. It can be given a list of numbers and apply the function to all of the those numbers. TRCClass'es control the actions of the individual trcs. A trc class must know how to save the information peculiar to a trc into a ROPE, and how to restore it later. It must also alert the trc package whenever a change is made to the function corresponding to a particular trc. A TRCClass may know how to paint extra information into a TRCViewer, and to accept TIP information from such a viewer, and it may know how to build a control viewer to allow a user ot manipulate the significant parameters for some type of trc.
The trc mechanism itself contains capabilities to allow clients to know when the values which would be produced by some trc have changed (because the trc function itself has changed).
A facility to embed a TrcTool within some other viewer is provided to interested clients. Through this mechanism, a user can select which class of trc he would like to use for a particular application, and then is provided a control viewer to manipulate this instance of a trc. Note that the tool can only allow user to manipulate trcs of classes which supply a control viewer building procedure.
There is also a client-callable mechanism for creating trc buttons, which are simply trc viewers (and therefore display the contents of a trc) which intercept the TIP information and pass it to ButtonProcs.
2. Standard Class'es
$Chain
Its instance data is a list of trcs, and when asked to apply itself to a set of values, it applied its descendent trcs in order.
There is currently no control viewer for a chain trc.
$Edit
Its instance data is a single underlying trc, and a collection of hard and soft points. (For this discussion, let g(x) represent the value of the underlying trc.) A hard point specifies both an x and a y value (x being the domain and y being the range). A soft point specifies only an x value — when a cartesian point is needed for a soft point, (x, g(x)) is used.. For its output function, the edit trc looks at the x value its is asked and performs the following CASE statement:
 no hard or soft points => Use g(x)
x is between two soft points => Use g(x)
x is between two points (2 hard or 1 of each) => Interpolate between the two points.
x is closest to a hard point => Use the y-value of that hard point.
x is closest to a soft point => Use g(x).
The user interface for edit trcs takes place mostly in a trc viewer. Left-clicking grabs the nearest edit point (soft or hard) and drags it. Middle-clicking sets down a hard point. Right-clicking sets down a soft point. Shift-middle-clicking deletes a point.
The control viewer for the edit class is comprised solely of a selectable trc.
$Manual
The instance data for a manual trc is a collection of points (all hard points in the lingo of edit trcs). The control viewer is a tioga text viewer into which the user can type a list of points, and a button to install the points found in that viewer.
$Identity
A simple trc which always returns the values passed to it.
$Equalize
Looks at a histogram for an AIS file and builds a trc which will equalize it.
$Linear
The linear trc class is a subclass of parametric trcs. The parametric trcs provide a mapping from some number of sliders to a trc function. For the linear trc, Brightness and Contrast control a line.
$Bilinear
The Bilinear trc class is a subclass of parametric trcs. The parametric trcs provide a mapping from some number of sliders to a trc function. For the Bilinear trc, the user controls highlight and shadow brightness and contrast.
$Midtone
The Midtone trc class is similar to the Linear class, except that a capability has been added to vary the midtone value from the default, as well as the low midtone and the high midtone.
$Selectable
This trc is one of interest mostly for building the trc tool itself. Its instance data consists of one underlying trc, and its output function is always equal precisely to the ouput function of its underlying trc. Its application comes in that its control viewer provides a pop-up button to select from among the registered trc classes. Thus any tool which provides a control viewer on a Selectable trc provides his users a powerful thing.
3. User Profile Options
Trc.AutoSelectKnobs: BOOLTRUE
If TRUE, when a new parametric control panel is created, it automatically grabs the knob selections.
Trc.DefaultTrc: TOKEN ← "Midtone"
The default flavor of trc generated in Trc tools.
Trc.InitialParameter.<parameter>: INT
The initial value for a parameter (i.e. part of a parametric trc).