/SWFGeometry.h

https://code.google.com/p/xee/ · C Header · 47 lines · 36 code · 9 blank · 2 comment · 0 complexity · 00b3ac9bbb6ecc0d14e2b7e035e0241c MD5 · raw file

  1. #import <XADMaster/CSHandle.h>
  2. typedef struct
  3. {
  4. int x,y;
  5. } SWFPoint;
  6. typedef struct
  7. {
  8. int x,y,width,height;
  9. } SWFRect;
  10. typedef struct
  11. {
  12. int a00,a01,a02;
  13. int a10,a11,a12;
  14. } SWFMatrix;
  15. static inline SWFPoint SWFMakePoint(int x,int y) { SWFPoint res={x,y}; return res; }
  16. SWFPoint SWFPointOnLine(SWFPoint a,SWFPoint b,float t);
  17. static inline SWFRect SWFMakeRect(int x,int y,int width,int height) { SWFRect res={x,y,width,height}; return res; }
  18. SWFRect SWFParseRect(CSHandle *fh);
  19. void SWFWriteRect(SWFRect rect,CSHandle *fh);
  20. static inline SWFMatrix SWFMakeMatrix(int a00,int a01,int a02,int a10,int a11,int a12) { SWFMatrix res={a00,a01,a02,a10,a11,a12}; return res; }
  21. static inline SWFMatrix SWFTranslationMatrix(int x,int y) { return SWFMakeMatrix(1<<16,0,x,0,1<<16,y); }
  22. SWFMatrix SWFParseMatrix(CSHandle *fh);
  23. void SWFWriteMatrix(SWFMatrix mtx,CSHandle *fh);
  24. SWFMatrix SWFMultiplyMatrices(SWFMatrix a,SWFMatrix b);
  25. SWFMatrix SWFScalingMatrix(float x_scale,float y_scale);
  26. SWFMatrix SWFRotationMatrix(float degrees);
  27. //SWFMatrix SWFMatrixFromAffineTransform(NSAffineTransform *t);
  28. //NSAffineTransform *SWFAffineTransformFromMatrix(SWFMatrix m);
  29. #define SWFZeroPoint SWFMakePoint(0,0)
  30. #define SWFEmptyRect SWFMakeRect(0,0,0,0)
  31. #define SWFIdentityMatrix SWFTranslationMatrix(0,0)
  32. int SWFCountBits(uint32_t val);
  33. int SWFCountBits2(uint32_t val1,uint32_t val2);
  34. int SWFCountBits4(uint32_t val1,uint32_t val2,uint32_t val3,uint32_t val4);
  35. int SWFCountSignedBits(int32_t val);
  36. int SWFCountSignedBits2(int32_t val1,int32_t val2);
  37. int SWFCountSignedBits4(int32_t val1,int32_t val2,int32_t val3,int32_t val4);
  38. int SWFCountSignedBitsPoint(SWFPoint point);