[operations] [attributes] [fields] [template] [definition]
[implementation] [documentation]
To use the search tool you need to use a browser which supports JAVA (c)

[next] [prev] [superclass] [next peer] [prev peer] [subclass] [index] [hierarchy]

Image

inherits from Object
inherits from HasCount
inherits interface from Pixels

Object <- Image



Operations

Get list of all operations

BorderThickness
CachePixelMap
ChangeImage
Copying
CorrespondingOwnedObject
CreateImagePixelMap
CreateMaskPixelMap
CreateRotatedPixelMap
DrawBorder
DrawBorderCommon
DrawComplexBorderShadow
DrawImage
DrawImageCommon
DrawImageInBox
DrawImageRotatedColored
DrawImageRotatedShadow
DrawImageScaled
DrawImageTiled
FirstImage
ImageAt
ImageBoundsBox
ImageBoundsBoxRotated
ImageBoundsBoxes
ImageBoundsDot
ImageContentBox
LastImage
ModifyPixels
PixelsFromCache
ReadPixels
ReinitializeClass
RepeatThickness
ResizePixelBuffer
ScaleImage
ShrinkImage
SizePixels
Validate


Attributes

Get list of all attributes

ContainsName
Count
FinePointing
NextImage
PreviousImage
SharedSetOwner
Thickness


Fields

Field Type
Image: nextImage: Image
previousImage: Image
rectImage: Boolean
hasMask: Boolean
allBlack: Boolean
containsName: Boolean
packed: Boolean
aligned32: Boolean
finePointing: Boolean
imageSize: PixelDot
resolution: SignedShort
depth: UnsignedShort
centerPt: PixelDot


Instance template

instance Image tag;
      nextImage: nilObject;
  previousImage: nilObject;
      rectImage: false;
        hasMask: false;
       allBlack: false;
   containsName: false;
         packed: false;
      aligned32: false;
   finePointing: false;
      imageSize: <0,0>;
     resolution: 0;
          depth: 0;
       centerPt: <0,0>;
end instance;

Class definition

Define Class Image;
    inherits from Object;
    inherits from HasCount;
    inherits interface from Pixels;

    uses extra;
    shares members;

    // note: there is code in the DisplayServer that knows format of and how to draw certain unpacked images

    field nextImage:    Image, getter, setter;
    field previousImage: Image, getter, setter;
    field rectImage:    Boolean;
    field hasMask:      Boolean;
        // mask data appended to image
    field allBlack:     Boolean;
        // true if image is all black
    field containsName: Boolean, getter;
        // true if image has name in it
    field packed:       Boolean;
        // true if image is PackBytes'ed
    field aligned32:    Boolean;
        // rowBytes is a multiple of 4 bytes
    field finePointing: Boolean, getter, setter;
        // true if user interface should hit-test with maskr;
    field imageSize:    PixelDot;
    field resolution:   SignedShort;
    field depth:        UnsignedShort;
    field centerPt:     PixelDot;

    // getting at elements

    attribute NextImage: Image;
        // next image in chain, if any
    attribute PreviousImage: Image;
        // previous image in chain, if any
    
    operation FirstImage(): Image, intrinsic;
        // call to get first image in this linked list
        // returns an indexical when <previousImage> field of second item points to an indexical,
        // or when self is an indexical and self has no object in its <previousImage> field
    operation LastImage(): Image, intrinsic;
        // call to get last image in this linked list
        // returns an indexical when <nextImage> field of penultimate item points to an indexical,
        // or when self is an indexical and self has no object in its <nextImage> field
    operation ImageAt(index: Unsigned): Image, intrinsic;
        // call to get image at position <index> in image chain, or nilObject if none 

    overrides Count;
        // returns number of images in chain; 1 if the image is standalone

    // basic object stuff
    overrides Copying;
        // overridden to catch the case where an image with indexical links to the
        // rest of its image chain is copied; this is not a legal condition.
        // Debug builds will complain, and the copied image will have its nextImage and
        // previousImage fields cleared

    // pixels

    overrides ReadPixels;
    overrides ModifyPixels;
    overrides SizePixels;
    overrides ResizePixelBuffer;

    // geometry

    attribute Thickness: Box, readOnly;             
        // return size of image relative to origin
    operation BorderThickness(var thickness: Box);          
        // thickness of border around content; always returns 0; overriden by BorderImage
    operation RepeatThickness(var thickness: Box);          
        // thickness of repeat area within border; always returns 0; overriden by BorderImage

    operation ImageBoundsBox(origin: Dot; var result: Box);
    operation ImageBoundsBoxRotated(origin: Dot; orientation: Signed; var result: Box);
    operation ImageContentBox(origin: Dot; var result: Box);                                
        // always empty; overriden by BorderImage

    operation ImageBoundsDot(probe: Dot; slop: Micron; orientation: UnsignedShort): Boolean, noFail;

    // drawing

    operation DrawImage(origin: Dot), noFail;
    operation DrawImageScaled(position: Box), noFail;
    operation DrawImageInBox(inside: Box; alignment: Signed);
    operation DrawImageTiled(inside: Box);

    operation DrawImageRotatedColored(origin: Dot; orientation: Signed; highlighted: Boolean; foreRGB: Unsigned; backRGB: Unsigned), noFail;
    operation DrawImageRotatedShadow(origin: Dot; orientation: Signed; shadowRGB: Unsigned), noFail;

    operation DrawBorder(position: Box; highlighted: Boolean), noFail;
    operation DrawComplexBorderShadow(position: Box; offset: Dot; shadowRGB: Unsigned): Boolean;

    // sharing support
    
    overrides SharedSetOwner;
        // returns first image in chain
    overrides CorrespondingOwnedObject;
        // returns nth link in chain beginning with self, where <oldOwnedObject> is nth link in its chain

    // framework

    overrides ReinitializeClass;
#ifdef VALIDATE
    overrides Validate;
#endif

    // miscellaneous
    operation ChangeImage(imageSize: PixelDot; centerPt: PixelDot; pixels: Pixels; rowBytes: UnsignedShort; depth: UnsignedShort; pack: Boolean);
    attribute FinePointing: Boolean;                                                                            
    operation ShrinkImage(clipBox: Box), noFail;
        // reads bits for the image from the current canvas, which must be a pixel map
    attribute ContainsName: Boolean, readOnly;  

    operation CachePixelMap(action: CacheAction; cacheType: Signed; cacheMap: PixelMap), intrinsic;
    operation PixelsFromCache(cacheType: Signed; pixelSize: PixelDot): Pixels, intrinsic;

    operation ImageBoundsBoxes(position: Dot; orientation: Signed; var srcBox: Box; var dstBox: Box), intrinsic;

    operation CreateImagePixelMap(canvas: Canvas; var action: CacheAction; var cacheType: Signed; var cacheMap: PixelMap), intrinsic;
    operation CreateMaskPixelMap(canvas: Canvas; var action: CacheAction; var cacheType: Signed; var cacheMap: PixelMap), intrinsic;
    operation CreateRotatedPixelMap(canvas: Canvas; orientation: Signed; mask: Boolean; var action: CacheAction; var cacheType: Signed; var cacheMap: PixelMap), intrinsic;

    operation DrawBorderCommon(position: Box; highlighted: Boolean; var shadowRGB: Unsigned), intrinsic;
    operation DrawImageCommon(highlighted: Boolean; foreRGB: Unsigned; backRGB: Unsigned; srcBox: Box; dstBox: Box; orientation: Signed; tiled: Boolean), intrinsic;
#ifdef SCALED_SCREEN
    intrinsic ScaleImage(destinationPixelMap: PixelMap; canvas: Canvas; sourcePixels: Pixels; sourceRowBytes: UnsignedShort; sourceDepth:UnsignedShort; textMode: Boolean);
#endif
end class;