diff options
author | jonasno <jonasno@users.sourceforge.net> | 2010-02-21 21:50:41 +0300 |
---|---|---|
committer | jonasno <jonasno@users.sourceforge.net> | 2010-02-21 21:50:41 +0300 |
commit | 3244957f4563575d22bf109de27a703558611b19 (patch) | |
tree | 749080f5503fe3fd31e28587000b60b90aacf995 /src/subtitles/Rasterizer.h | |
parent | c7a41c0086a8bfcd07530779645d98c80039bd84 (diff) |
Merged VSFilterMod rev20, only 64 bit code enabled for the time being
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1688 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/subtitles/Rasterizer.h')
-rw-r--r-- | src/subtitles/Rasterizer.h | 110 |
1 files changed, 102 insertions, 8 deletions
diff --git a/src/subtitles/Rasterizer.h b/src/subtitles/Rasterizer.h index a7211dc70..6a261fbb6 100644 --- a/src/subtitles/Rasterizer.h +++ b/src/subtitles/Rasterizer.h @@ -23,11 +23,65 @@ #include <vector>
#include "../SubPic/ISubPic.h"
+#ifdef _VSMOD // patch m004. gradient colors
+#include "STS.h"
+#endif
+
+#ifdef _VSMOD // patch m006. moveable vector clip
+class MOD_MOVEVC
+{
+public:
+ // movevc
+ bool enable;
+ CSize size;
+ CPoint pos;
+
+ //CSize canvas; // canvas size
+ CSize spd; // output canvas size
+ CPoint curpos; // output origin point
+ int hfull; // full height
+ byte* alphamask;
+
+ MOD_MOVEVC();
+
+ byte GetAlphaValue(int wx,int wy);
+ void clear();
+};
+#endif
#define PT_MOVETONC 0xfe
#define PT_BSPLINETO 0xfc
#define PT_BSPLINEPATCHTO 0xfa
+class RasterizerNfo
+{
+public:
+ int w;
+ int h;
+ int spdw;
+ int overlayp;
+ int pitch;
+ DWORD color;
+
+ int xo;
+ int yo;
+
+ const DWORD* sw;
+ byte* s;
+ byte* src;
+ DWORD* dst;
+
+#ifdef _VSMOD
+ int typ;
+ MOD_GRADIENT mod_grad;
+ MOD_MOVEVC mod_vc;
+#else
+ byte* am;
+#endif
+
+ RasterizerNfo();
+};
+
class Rasterizer
{
bool fFirstSet;
@@ -36,7 +90,7 @@ class Rasterizer protected:
BYTE* mpPathTypes;
POINT* mpPathPoints;
- int mPathPoints;
+ size_t mPathPoints;
private:
int mWidth, mHeight;
@@ -52,18 +106,18 @@ private: int next;
int posandflag;
} *mpEdgeBuffer;
- unsigned mEdgeHeapSize;
- unsigned mEdgeNext;
+ size_t mEdgeHeapSize;
+ size_t mEdgeNext;
- unsigned int* mpScanBuffer;
+ size_t* mpScanBuffer;
typedef unsigned char byte;
protected:
- byte *mpOverlayBuffer;
- int mOverlayWidth, mOverlayHeight;
int mPathOffsetX, mPathOffsetY;
int mOffsetX, mOffsetY;
+ int mOverlayWidth, mOverlayHeight;
+ byte *mpOverlayBuffer;
private:
void _TrashPath();
@@ -73,7 +127,42 @@ private: void _EvaluateLine(int pt1idx, int pt2idx);
void _EvaluateLine(int x0, int y0, int x1, int y1);
static void _OverlapRegion(tSpanBuffer& dst, tSpanBuffer& src, int dx, int dy);
-
+ // helpers
+ void Draw_noAlpha_spFF_Body_0(RasterizerNfo& rnfo);
+ void Draw_noAlpha_spFF_noBody_0(RasterizerNfo& rnfo);
+ void Draw_noAlpha_sp_Body_0(RasterizerNfo& rnfo);
+ void Draw_noAlpha_sp_noBody_0(RasterizerNfo& rnfo);
+ void Draw_noAlpha_spFF_Body_sse2(RasterizerNfo& rnfo);
+ void Draw_noAlpha_spFF_noBody_sse2(RasterizerNfo& rnfo);
+ void Draw_noAlpha_sp_Body_sse2(RasterizerNfo& rnfo);
+ void Draw_noAlpha_sp_noBody_sse2(RasterizerNfo& rnfo);
+ void Draw_Alpha_spFF_Body_0(RasterizerNfo& rnfo);
+ void Draw_Alpha_spFF_noBody_0(RasterizerNfo& rnfo);
+ void Draw_Alpha_sp_Body_0(RasterizerNfo& rnfo);
+ void Draw_Alpha_sp_noBody_0(RasterizerNfo& rnfo);
+ void Draw_Alpha_spFF_Body_sse2(RasterizerNfo& rnfo);
+ void Draw_Alpha_spFF_noBody_sse2(RasterizerNfo& rnfo);
+ void Draw_Alpha_sp_Body_sse2(RasterizerNfo& rnfo);
+ void Draw_Alpha_sp_noBody_sse2(RasterizerNfo& rnfo);
+
+#ifdef _VSMOD // patch m004. gradient colors
+ void Draw_Grad_noAlpha_spFF_Body_0(RasterizerNfo& rnfo);
+ void Draw_Grad_noAlpha_spFF_noBody_0(RasterizerNfo& rnfo);
+ void Draw_Grad_noAlpha_sp_Body_0(RasterizerNfo& rnfo);
+ void Draw_Grad_noAlpha_sp_noBody_0(RasterizerNfo& rnfo);
+ void Draw_Grad_Alpha_spFF_Body_0(RasterizerNfo& rnfo);
+ void Draw_Grad_Alpha_spFF_noBody_0(RasterizerNfo& rnfo);
+ void Draw_Grad_Alpha_sp_Body_0(RasterizerNfo& rnfo);
+ void Draw_Grad_Alpha_sp_noBody_0(RasterizerNfo& rnfo);
+ void Draw_Grad_noAlpha_spFF_Body_sse2(RasterizerNfo& rnfo);
+ void Draw_Grad_noAlpha_spFF_noBody_sse2(RasterizerNfo& rnfo);
+ void Draw_Grad_noAlpha_sp_Body_sse2(RasterizerNfo& rnfo);
+ void Draw_Grad_noAlpha_sp_noBody_sse2(RasterizerNfo& rnfo);
+ void Draw_Grad_Alpha_spFF_Body_sse2(RasterizerNfo& rnfo);
+ void Draw_Grad_Alpha_spFF_noBody_sse2(RasterizerNfo& rnfo);
+ void Draw_Grad_Alpha_sp_Body_sse2(RasterizerNfo& rnfo);
+ void Draw_Grad_Alpha_sp_noBody_sse2(RasterizerNfo& rnfo);
+#endif
public:
Rasterizer();
virtual ~Rasterizer();
@@ -86,7 +175,12 @@ public: bool CreateWidenedRegion(int borderX, int borderY);
void DeleteOutlines();
bool Rasterize(int xsub, int ysub, int fBlur, double fGaussianBlur);
- CRect Draw(SubPicDesc& spd, CRect& clipRect, byte* pAlphaMask, int xsub, int ysub, const long* switchpts, bool fBody, bool fBorder);
+ int getOverlayWidth();
+#ifdef _VSMOD // patch m004. gradient colors
+ CRect Draw(SubPicDesc& spd, CRect& clipRect, byte* pAlphaMask, int xsub, int ysub, const DWORD* switchpts, bool fBody, bool fBorder, int typ, MOD_GRADIENT& mod_grad, MOD_MOVEVC& mod_vc);
+#else
+ CRect Draw(SubPicDesc& spd, CRect& clipRect, byte* pAlphaMask, int xsub, int ysub, const DWORD* switchpts, bool fBody, bool fBorder);
+#endif
void FillSolidRect(SubPicDesc& spd, int x, int y, int nWidth, int nHeight, DWORD lColor);
};
|