home *** CD-ROM | disk | FTP | other *** search
/ Education Sampler 1992 [NeXTSTEP] / Education_1992_Sampler.iso / Programming / Source / tess / tess-1.0 / p3m1.m < prev    next >
Encoding:
Text File  |  1992-06-30  |  1.1 KB  |  53 lines

  1. #import "p3m1.h"
  2.  
  3. @implementation p3m1
  4. - resizeGenerator
  5. {
  6.   latticesize.height = 2.0 * bounds.size.height;
  7.   latticesize.width = bounds.size.width * 2.0;
  8.   upx = bounds.size.width;
  9.   upy = 3.0/ 2.0 * bounds.size.height;
  10.   overx = latticesize.width;
  11.   return self;
  12. }
  13. - clip: (NXCoord) x: (NXCoord) y 
  14.   PSnewpath();
  15.   PSmoveto(x,y);
  16.   PSrlineto(0,bounds.size.height);
  17.   PSrlineto(bounds.size.width, -bounds.size.height / 2.0);
  18.   PSclosepath();
  19.   PSclip();
  20.   return self;
  21. }
  22.  
  23. - makeLatticeUnitAt: (NXPoint *) point fromImage: srcimg 
  24. {
  25.   id imgrep;
  26.   NXPoint pt;
  27.   
  28.   pt.x = - point->x;
  29.   pt.y = - point->y;
  30.  
  31.   imgrep = [srcimg bestRepresentation];
  32.   DOCLIP(0.0,0.0,[imgrep drawAt: &pt]);
  33.   reflect(30.0);
  34.   DOCLIP(0.0,0.0,[imgrep drawAt: &pt]);
  35.   PSrotate(120.0);
  36.   DOCLIP(0.0,0.0,[imgrep drawAt: &pt]);
  37.   reflect(30.0);
  38.   DOCLIP(0.0,0.0,[imgrep drawAt: &pt]);
  39.   PSrotate(-120.0);
  40.   DOCLIP(0.0,0.0,[imgrep drawAt: &pt]);
  41.   reflect(30.0);
  42.   DOCLIP(0.0,0.0,[imgrep drawAt: &pt]);
  43.   return self;
  44. }
  45.  
  46. - sizeKludge: (float *) x : (float *) y
  47. {
  48.   *x = [self equi: *y];
  49.   return self;
  50. }
  51. @end
  52.