home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / Rhapsody / Graphics / Morph-2.0a / Morpher.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-02  |  1.6 KB  |  59 lines

  1. // Morpher.h
  2. //
  3. // Calculates morphed images. Indata is a bitmap and a number
  4. // of control lines.
  5. // All methods are thread safe.
  6. //
  7. // created by Martin Wennerberg on Sun 08-Sep-1996
  8. //
  9. // when        who    modification
  10.  
  11. #import <AppKit/AppKit.h>
  12.  
  13. @class NSBitmapImageRep;
  14.  
  15. struct LineCoords
  16. {
  17.     NSPoint start;
  18.     NSPoint end;
  19. };
  20.  
  21. @interface Morpher : NSObject
  22. {
  23.     NSBitmapImageRep    *firstBitmap;
  24.     NSBitmapImageRep    *lastBitmap;
  25.     NSArray                *morphLines;
  26.     float         progress;
  27. }
  28.  
  29. // ----------------------------------------------------------
  30. // public methods
  31. // ----------------------------------------------------------
  32.  
  33. - initWithFirstBitmap:(NSBitmapImageRep *)im0
  34.            lastBitmap:(NSBitmapImageRep *)im1
  35.            morphLines:(NSArray *) lines;
  36.  
  37. - (void)calcMorphBitmap:(NSBitmapImageRep *) bitmap
  38.                 atDelta:(float) delta;
  39.     // Sets the pixels of bitmap to a morphed image. Delta controls what part
  40.     // of the morph to calculate.
  41.     // Posts the notification morphBitmapFinished: whith self as notification
  42.     // object.
  43.  
  44. - (float) progress;
  45.     // Returns the current progress of the morph calculation above as
  46.     // a number between 0.0 and 1.0.
  47.  
  48. // ----------------------------------------------------------
  49. // protected methods
  50. // ----------------------------------------------------------
  51.  
  52. - (void) fillDestLineCoordinates:(struct LineCoords *)lines
  53.                            delta:(float)delta;
  54.  
  55. - (void) fillTransMatrixes:(NSAffineTransformStruct *) matrixes
  56.              withDeltaFrom:(float) beforeDelta
  57.                         to:(float) afterDelta;
  58. @end
  59.