PageRenderTime 13ms CodeModel.GetById 9ms app.highlight 3ms RepoModel.GetById 0ms app.codeStats 0ms

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