home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 275 / DPCS0111DVD.ISO / Toolkit / Audio-Visual / VirtualDub / Source / VirtualDub-1.9.10-src.7z / src / Kasumi / h / uberblit_gen.h < prev    next >
Encoding:
C/C++ Source or Header  |  2009-09-14  |  4.9 KB  |  168 lines

  1. #ifndef f_VD2_KASUMI_UBERBLIT_GEN_H
  2. #define f_VD2_KASUMI_UBERBLIT_GEN_H
  3.  
  4. #include <vd2/system/vectors.h>
  5. #include "uberblit.h"
  6.  
  7. class IVDPixmapGenSrc;
  8.  
  9. class VDPixmapUberBlitterDirectCopy : public IVDPixmapBlitter {
  10. public:
  11.     VDPixmapUberBlitterDirectCopy();
  12.     ~VDPixmapUberBlitterDirectCopy();
  13.  
  14.     void Blit(const VDPixmap& dst, const VDPixmap& src);
  15.     void Blit(const VDPixmap& dst, const vdrect32 *rDst, const VDPixmap& src);
  16. };
  17.  
  18. class VDPixmapUberBlitter : public IVDPixmapBlitter {
  19. public:
  20.     VDPixmapUberBlitter();
  21.     ~VDPixmapUberBlitter();
  22.  
  23.     void Blit(const VDPixmap& dst, const VDPixmap& src);
  24.     void Blit(const VDPixmap& dst, const vdrect32 *rDst, const VDPixmap& src);
  25.  
  26. protected:
  27.     void Blit(const VDPixmap& dst, const vdrect32 *rDst);
  28.     void Blit3(const VDPixmap& dst, const vdrect32 *rDst);
  29.     void Blit3Split(const VDPixmap& dst, const vdrect32 *rDst);
  30.     void Blit3Separated(const VDPixmap& px, const vdrect32 *rDst);
  31.     void Blit2(const VDPixmap& dst, const vdrect32 *rDst);
  32.     void Blit2Separated(const VDPixmap& px, const vdrect32 *rDst);
  33.  
  34.     friend class VDPixmapUberBlitterGenerator;
  35.  
  36.     struct OutputEntry {
  37.         IVDPixmapGen *mpSrc;
  38.         int mSrcIndex;
  39.     } mOutputs[3];
  40.  
  41.     struct SourceEntry {
  42.         IVDPixmapGenSrc *mpSrc;
  43.         int mSrcIndex;
  44.         int mSrcPlane;
  45.         int mSrcX;
  46.         int mSrcY;
  47.     };
  48.  
  49.     typedef vdfastvector<IVDPixmapGen *> Generators;
  50.     Generators mGenerators;
  51.  
  52.     typedef vdfastvector<SourceEntry> Sources;
  53.     Sources mSources;
  54.  
  55.     bool mbIndependentChromaPlanes;
  56.     bool mbIndependentPlanes;
  57. };
  58.  
  59. class VDPixmapUberBlitterGenerator {
  60. public:
  61.     VDPixmapUberBlitterGenerator();
  62.     ~VDPixmapUberBlitterGenerator();
  63.  
  64.     void swap(int index);
  65.     void dup();
  66.     void pop();
  67.  
  68.     void ldsrc(int srcIndex, int srcPlane, int x, int y, uint32 w, uint32 h, uint32 type, uint32 bpr);
  69.  
  70.     void ldconst(uint8 fill, uint32 bpr, uint32 w, uint32 h, uint32 type);
  71.  
  72.     void extract_8in16(int offset, uint32 w, uint32 h);
  73.     void extract_8in32(int offset, uint32 w, uint32 h);
  74.     void swap_8in16(uint32 w, uint32 h, uint32 bpr);
  75.  
  76.     void conv_Pal1_to_8888(int srcIndex);
  77.     void conv_Pal2_to_8888(int srcIndex);
  78.     void conv_Pal4_to_8888(int srcIndex);
  79.     void conv_Pal8_to_8888(int srcIndex);
  80.  
  81.     void conv_555_to_8888();
  82.     void conv_565_to_8888();
  83.     void conv_888_to_8888();
  84.     void conv_555_to_565();
  85.     void conv_565_to_555();
  86.     void conv_8888_to_X32F();
  87.     void conv_8_to_32F();
  88.     void conv_16F_to_32F();
  89.     void conv_V210_to_32F();
  90.  
  91.     void conv_8888_to_555();
  92.     void conv_8888_to_565();
  93.     void conv_8888_to_888();
  94.     void conv_32F_to_8();
  95.     void conv_X32F_to_8888();
  96.     void conv_32F_to_16F();
  97.     void conv_32F_to_V210();
  98.  
  99.     void convd_8888_to_555();
  100.     void convd_8888_to_565();
  101.     void convd_32F_to_8();
  102.     void convd_X32F_to_8888();
  103.  
  104.     void interleave_B8G8_R8G8();
  105.     void interleave_G8B8_G8R8();
  106.     void interleave_X8R8G8B8();
  107.     void interleave_B8R8();
  108.  
  109.     void ycbcr601_to_rgb32();
  110.     void ycbcr709_to_rgb32();
  111.     void rgb32_to_ycbcr601();
  112.     void rgb32_to_ycbcr709();
  113.  
  114.     void ycbcr601_to_rgb32_32f();
  115.     void ycbcr709_to_rgb32_32f();
  116.     void rgb32_to_ycbcr601_32f();
  117.     void rgb32_to_ycbcr709_32f();
  118.  
  119.     void ycbcr601_to_ycbcr709();
  120.     void ycbcr709_to_ycbcr601();
  121.  
  122.     void pointh(float xoffset, float xfactor, uint32 w);
  123.     void pointv(float yoffset, float yfactor, uint32 h);
  124.     void linearh(float xoffset, float xfactor, uint32 w, bool interpOnly);
  125.     void linearv(float yoffset, float yfactor, uint32 h, bool interpOnly);
  126.     void linear(float xoffset, float xfactor, uint32 w, float yoffset, float yfactor, uint32 h);
  127.     void cubich(float xoffset, float xfactor, uint32 w, float splineFactor, bool interpOnly);
  128.     void cubicv(float yoffset, float yfactor, uint32 h, float splineFactor, bool interpOnly);
  129.     void cubic(float xoffset, float xfactor, uint32 w, float yoffset, float yfactor, uint32 h, float splineFactor);
  130.     void lanczos3h(float xoffset, float xfactor, uint32 w);
  131.     void lanczos3v(float yoffset, float yfactor, uint32 h);
  132.     void lanczos3(float xoffset, float xfactor, uint32 w, float yoffset, float yfactor, uint32 h);
  133.  
  134.     IVDPixmapBlitter *create();
  135.  
  136. protected:
  137.     void MarkDependency(IVDPixmapGen *dst, IVDPixmapGen *src);
  138.  
  139.     struct StackEntry {
  140.         IVDPixmapGen *mpSrc;
  141.         uint32 mSrcIndex;
  142.  
  143.         StackEntry() {}
  144.         StackEntry(IVDPixmapGen *src, uint32 index) : mpSrc(src), mSrcIndex(index) {}
  145.     };
  146.  
  147.     vdfastvector<StackEntry> mStack;
  148.  
  149.     typedef vdfastvector<IVDPixmapGen *> Generators;
  150.     Generators mGenerators;
  151.  
  152.     struct Dependency {
  153.         int mDstIdx;
  154.         int mSrcIdx;
  155.     };
  156.  
  157.     vdfastvector<Dependency> mDependencies;
  158.  
  159.     typedef VDPixmapUberBlitter::SourceEntry SourceEntry;
  160.     vdfastvector<SourceEntry> mSources;
  161. };
  162.  
  163. void VDPixmapGenerate(void *dst, ptrdiff_t pitch, sint32 bpr, sint32 height, IVDPixmapGen *gen, int genIndex);
  164. IVDPixmapBlitter *VDCreatePixmapUberBlitterDirectCopy(const VDPixmap& dst, const VDPixmap& src);
  165. IVDPixmapBlitter *VDCreatePixmapUberBlitterDirectCopy(const VDPixmapLayout& dst, const VDPixmapLayout& src);
  166.  
  167. #endif
  168.