Subversion Repositories Kolibri OS

Rev

Rev 876 | Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1.  
  2. #define PX_CREATE              1
  3. #define PX_DESTROY             2
  4. #define PX_DRAW_RECT           3
  5. #define PX_FILL_RECT           4
  6. #define PX_LINE                5
  7. #define PX_BLIT                6
  8. #define PX_BLIT_TRANSPARENT    7
  9. #define PX_BLIT_ALPHA          8
  10.  
  11. //#define BLIT         4
  12. //#define COMPIZ       5
  13.  
  14.  
  15. typedef unsigned int color_t;
  16.  
  17. typedef struct
  18. {
  19.   int x;
  20.   int y;
  21. }pt_t;
  22.  
  23. /***********               Clipping             **********/
  24.  
  25. typedef struct
  26. {
  27.   int xmin;
  28.   int ymin;
  29.   int xmax;
  30.   int ymax;
  31. }clip_t, *PTRclip;
  32.  
  33. #define CLIP_TOP          1
  34. #define CLIP_BOTTOM       2
  35. #define CLIP_RIGHT        4
  36. #define CLIP_LEFT         8
  37.  
  38. int LineClip ( clip_t *clip, int *x1, int *y1, int *x2, int *y2 );
  39.  
  40. int BlockClip( clip_t *clip, int *x1, int *y1, int *x2, int* y2 );
  41.  
  42. typedef struct
  43. {
  44.   unsigned  width;
  45.   unsigned  height;
  46.   u32_t     format;
  47.   u32_t     flags;
  48.   unsigned  pitch;
  49.   void      *mapped;
  50.   u32_t     handle;
  51. }pixmap_t;
  52.  
  53.  
  54. typedef struct
  55. {
  56.   unsigned  width;
  57.   unsigned  height;
  58.   u32_t     format;
  59.   u32_t     flags;
  60.  
  61.   unsigned  pitch;
  62.   void      *mapped;
  63.  
  64.   unsigned  pitch_offset;
  65.   void      *local;
  66. }local_pixmap_t;
  67.  
  68. //int CreatePixmap(userpixmap_t *io);
  69. //int DestroyPixmap(userpixmap_t *io);
  70. //int LockPixmap(userpixmap_t *io);
  71. //int UnlockPixmap(userpixmap_t *io);
  72.  
  73. #define   PX_LOCK            1
  74.  
  75. typedef struct
  76. {
  77.   local_pixmap_t  *dstpix;
  78.  
  79.   struct
  80.   {
  81.     int x0;
  82.     int y0;
  83.   };
  84.   union
  85.   {
  86.     struct
  87.     {
  88.       int x1;
  89.       int y1;
  90.     };
  91.     struct
  92.     {
  93.       int w;
  94.       int h;
  95.     };
  96.   };
  97.   color_t color;
  98. }draw_t;
  99.  
  100. typedef struct
  101. {
  102.   local_pixmap_t  *dstpix;
  103.  
  104.   int x;
  105.   int y;
  106.   int w;
  107.   int h;
  108.  
  109.   color_t bkcolor;
  110.   color_t fcolor;
  111.  
  112.   u32_t   bmp0;
  113.   u32_t   bmp1;
  114. }fill_t;
  115.  
  116. typedef struct
  117. {
  118.   int src_x;
  119.   int src_y;
  120.   int dst_x;
  121.   int dst_y;
  122.   int w;
  123.   int h;
  124. }blit_t;
  125.  
  126. typedef struct
  127. {
  128.   local_pixmap_t  *dstpix;
  129.   int        dst_x;
  130.   int        dst_y;
  131.  
  132.   local_pixmap_t  *srcpix;
  133.   int        src_x;
  134.   int        src_y;
  135.   int        w;
  136.   int        h;
  137. }pixblit_t;
  138.  
  139.  
  140. int Line2P(draw_t *draw);
  141.  
  142. int DrawRect(draw_t * draw);
  143. int FillRect(fill_t * fill);
  144.  
  145. int Blit(blit_t *blit);
  146.  
  147. int RadeonComposite( blit_t *blit);
  148.  
  149.  
  150. int PixBlit(pixblit_t* blit);
  151.  
  152.  
  153.  
  154.  
  155.