14.48 RasterGrays Interface

14.49 RasterGrays

ORIGIN 'Bifrost';
LIB_DEF 'BifrostRasterGrays' '../lib';
BODY 'private/Impl/RasterGrayImpl';

(*
 * COPYRIGHT 
 *       Copyright Mjolner Informatics, 1990-94 
 *       All rights reserved.
 *)

-- BifrostAttributes: Attributes --

RasterGray: TiledSolidColor
  (* Abstract superpattern for the ten patterns below: Each of these
   * use one of the bitmaps in the fragment HalftonePatterns to make
   * an illusion of a shade of gray even on a black & white device.
   * See the pattern RasterGrays below for a convenient use.
   *)  
  (# do init; (0, 0, 0) -> RGBvalues; #);

RasterGray0: RasterGray
  (# init:: (# ... #)#);
RasterGray11: RasterGray                      
  (# init:: (# ... #)#);
RasterGray22: RasterGray                      
  (# init:: (# ... #)#);
RasterGray33: RasterGray                      
  (# init:: (# ... #)#);
RasterGray44: RasterGray                      
  (# init:: (# ... #)#);
RasterGray56: RasterGray                      
  (# init:: (# ... #)#);
RasterGray67: RasterGray                      
  (# init:: (# ... #)#);
RasterGray78: RasterGray                      
  (# init:: (# ... #)#);
RasterGray89: RasterGray                      
  (# init:: (# ... #)#);
RasterGray100: RasterGray                    
  (# init:: (# ... #)#);

RasterGrays: 
  (* A convenient alternative to using the above patterns directly is
   * using an instance of RasterGrays: RasterGrays enters a
   * percentage, and exits a reference to an initialized RasterGray
   * yielding a approximating shade of gray: percentage=0 yields
   * white, percentage=100 yields black, other percentages yields one
   * of eight intermediate shades of gray.
   *)
  (# private: @...;
     percentage: @integer;
     thegray: ^RasterGray;
     init: 
       (# ... #)
  enter percentage
  do ...;
  exit thegray[]
  #)


14.48 RasterGrays Interface
© 1991-2004 Mjølner Informatics
[Modified: Thursday January 13th 2000 at 11:43]