File tag/Image


class tag.Image

The image handling class.

Inherits

State supers
tom.State, tag

variables

static tom.MutableDictionary image_by_name;
Images on their name.
static tom.MutableIndexed image_path;
The directories in which we find images.
static public mutable ImageLoader image_loader;
The image loader class.

methods

tom.OutputStream (s)
  help tom.OutputStream s
  done tom.MutableKeyed done;
Output information on the Image arguments.

void
  load tom.MutableArray arguments;
Set the image_directory, which defaults to IMAGE_DIR.

Image (image)
  createImage ImageRep rep
     withName tom.String n;
Create and return a new image with the name n from the representative rep.

tom.Indexed
  image_path;
Return the image_path.

instance (id) (image)
  named tom.String name;
Return the Image know by the name.

Managing ImageRep Subclasses

tom.Indexed
  imageUnfilteredFileTypes;
Returns an array of file types recognized by the Image without filtering. This list comes from all registered ImageReps.

tom.Indexed
  imageUnfilteredPasteboardTypes;
Returns an array of pasteboard types recognized by the Image.

Testing Image Data Sources

boolean
  canInitWithPasteboard Pasteboard pasteboard;
Returns YES if the receiver can create a representation from pasteboard; otherwise, returns NO.

tom.Indexed
  imageFileTypes;
Returns an array of supported image data file types.

tom.Indexed
  imagePasteboardTypes;
Returns an array of supported pasteboard types.

instance tag.Image

variables

public tom.String name;
The name.
public float width;
The size of this image.
public float height;
tom.MutableIndexed representations;
The representations of this image.
tom.MutableIndexed cached;
The cached representations for this image.

Initializing a New Image Instance

methods

id
  initByReferencingFile tom.String filename;
Initializes the new Image from the data in filename. The file is assumed to persist and may be reread later if the Image is resized or otherwise modified.

id
  initWithContentsOfFile tom.String filename;
Initializes the new Image from the data in filename.

id
  initWithData tom.Data data;
Initializes the new Image from data.

id
  initWithPasteboard Pasteboard pasteboard;
Initializes the new Image with the data in pasteboard.

id
  initWithSize (float, float) (x, y);
Initialize the new Image to the specified size.

Setting the Size of the Image

void
  setSize (float, float) (w, h);
Sets the size of the image to aSize in base coordinates.

(float, float)
  size;
Returns the size of the image.

Referring to Images by Name

boolean
  setName tom.String n;
Set the name of the receiving image. Return NO if name is already in use; otherwise, return YES.

Specifying the Image

void
  addRepresentation ImageRep rep;
Add the rep to the receiver's list of representations.

void
  addRepresentations tom.Indexed reps;
Add the imageReps from reps to the receiver's list of representations.

void
  lockFocus;
Prepares for drawing in the best representation.

void
  lockFocusOnRepresentation ImageRep imageRep;
Prepares for drawing in imageRep.

void
  unlockFocus;
Balances a previous lockFocus or lockFocusOnRepresentation:.

Using the Image

void
  compositeToPoint (float, float) (x, y)
         operation int op;
Composites the image to aPoint using the operation op.

void
  compositeToPoint (float, float) (p_x, p_y)
          fromRect (float, float, float, float) (x, y, w, h)
         operation int op;
Composites the aRect portion of the image to aPoint using the operation op.

void
  dissolveToPoint (float, float) (x, y)
         fraction float f;
Composites the image to aPoint using the dissolve operator. aFloat is a value from 0.0 to 1.0 that determines how much of the resulting composite comes from the receiver.

void
  dissolveToPoint (float, float) (p_x, p_y)
         fromRect (float, float, float, float) (x, y, w, h)
         fraction float f;
Composites the aRect portion of the image to aPoint using the dissolve operator. aFloat is a value from 0.0 to 1.0 that determines how much of the resulting composite comes from the receiver.

Choosing Which Image Representation to Use

void
  setPrefersColorMatch boolean flag;
Determines whether color matches are preferred.

boolean
  prefersColorMatch;
Returns whether color matches are preferred.

void
  setUsesEPSOnResolutionMismatch boolean flag;
Sets whether to use EPS representations on mismatch.

boolean
  usesEPSOnResolutionMismatch;
Returns whether to use EPS representations on mismatch.

void
  setMatchesOnMultipleResolution boolean flag;
Sets whether resolution multiples match.

boolean
  matchesOnMultipleResolution;
Returns whether resolution multiples match.

Getting the Representations

ImageRep
  bestRepresentationForDevice Device device_description;
Returns the best representation for the device described by device_description. If device_description is nil, the current device is assumed. See NSGraphics.h for appropriate dictionary keys and values.

tom.Indexed
  representations;
Returns an array of all the representations.

void
  removeRepresentation ImageRep rep;
Remove ImageRep rep from the receiver's list of representations.

Determining How the Image is Stored

void
  setCachedSeparately boolean flag;
Sets whether representations are cached separately.

boolean
  isCachedSeparately;
Returns whether representations are cached separately.

void
  setDataRetained boolean flag;
Sets whether image data is retained by the object after the image is cached.

boolean
  isDataRetained;
Returns whether image data is retained.

void
  setCacheDepthMatchesImageDepth boolean flag;
Sets whether the default depth limit applies to caches.

boolean
  cacheDepthMatchesImageDepth;
Returns whether the default depth limit applies to caches.

Determining How the Image is Drawn

boolean
  isValid;
Returns YES to indicate that the receiver's image is valid.

void
  setScalesWhenResized boolean flag;
If flag is YES, representations are scaled to fit.

boolean
  scalesWhenResized;
Returns whether representations are scaled to fit.

void
  setBackgroundColor Color aColor;
Sets the background color of the image to aColor.

Color
  backgroundColor;
Returns the background color of the image.

boolean
  drawRepresentation ImageRep imageRep
              inRect (float, float, float, float) (x, y, w, h);
Overridden to have imageRep draw the representation in aRect.

void
  recache;
Invalidates caches of all representations, so they will be redrawn.

Assigning a Delegate

void
  setDelegate ImageDelegate anObject;
Makes anObject the delegate of the Image.

ImageDelegate
  delegate;
Returns the delegate of the Image.

Producing TIFF Data for the Image

tom.Data
  TIFFRepresentation;
Returns a data object containing TIFF for all representations, using their default compressions.

tom.Data
  TIFFRepresentationUsingCompression int comp
                              factor float aFloat;
Returns a data object containing TIFF for all the representations.


class tag.ImageDelegate

instance tag.ImageDelegate

methods

deferred Image
  imageDidNotDraw Image sender
           inRect (float, float, float, float) (x, y, w, h);
Responds to message that image couldn't be composited into aRect.


class tag.ImageLoader

Image loading behaviour, with a temporary interface until tom.Bundles are fully functional. Also, should BitmapImageRep know everything about any kind of image, should there be a TIFFBitmapImageRep, or should there be a TIFFImageLoader which creates BitmapImageReps?

Inherits

Behaviour supers
tom.All

instance tag.ImageLoader

Inherits

Behaviour supers
tom.All

methods

deferred Image
  loadImageNamed tom.String name;
Undocumented.


Generated by tm 1.01.