1 #ifndef f_VIRTUALDUB_VBITMAP_H
2 #define f_VIRTUALDUB_VBITMAP_H
6 typedef unsigned long Pixel
;
7 typedef unsigned long Pixel32
;
8 typedef unsigned char Pixel8
;
11 typedef long PixOffset
;
13 #ifdef VDEXT_VIDEO_FILTER
14 #define NOVTABLE __declspec(novtable)
19 class NOVTABLE VBitmap
{
30 Pixel
*Address(PixCoord x
, PixCoord y
) const {
31 return Addressi(x
, h
-y
-1);
34 Pixel
*Addressi(PixCoord x
, PixCoord y
) const {
35 return (Pixel
*)((char *)data
+ y
*pitch
+ x
*(depth
>>3));
38 Pixel
*Address32(PixCoord x
, PixCoord y
) const {
39 return Address32i(x
, h
-y
-1);
42 Pixel
*Address32i(PixCoord x
, PixCoord y
) const {
43 return (Pixel
*)((char *)data
+ y
*pitch
+ x
*sizeof(Pixel
));
46 PixOffset
PitchAlign4() {
47 return ((w
* depth
+ 31)/32)*4;
50 PixOffset
PitchAlign8() {
51 return ((w
* depth
+ 63)/64)*8;
55 return pitch
- (w
*depth
+7)/8;
65 #ifdef VDEXT_VIDEO_FILTER
69 VBitmap(void *data
, PixDim w
, PixDim h
, int depth
) throw();
70 VBitmap(void *data
, BITMAPINFOHEADER
*) throw();
72 #ifdef VDEXT_VIDEO_FILTER
73 void init() throw() { *(void **)this = g_vtbls
.pvtblVBitmap
; }
76 virtual VBitmap
& init(void *data
, PixDim w
, PixDim h
, int depth
) throw();
77 virtual VBitmap
& init(void *data
, BITMAPINFOHEADER
*) throw();
79 virtual void MakeBitmapHeader(BITMAPINFOHEADER
*bih
) const throw();
81 virtual void AlignTo4() throw();
82 virtual void AlignTo8() throw();
84 virtual void BitBlt(PixCoord x2
, PixCoord y2
, const VBitmap
*src
, PixCoord x1
, PixCoord y1
, PixDim dx
, PixDim dy
) const throw();
85 virtual void BitBltDither(PixCoord x2
, PixCoord y2
, const VBitmap
*src
, PixDim x1
, PixDim y1
, PixDim dx
, PixDim dy
, bool to565
) const throw();
86 virtual void BitBlt565(PixCoord x2
, PixCoord y2
, const VBitmap
*src
, PixDim x1
, PixDim y1
, PixDim dx
, PixDim dy
) const throw();
88 virtual bool BitBltXlat1(PixCoord x2
, PixCoord y2
, const VBitmap
*src
, PixCoord x1
, PixCoord y1
, PixDim dx
, PixDim dy
, const Pixel8
*tbl
) const throw();
89 virtual bool BitBltXlat3(PixCoord x2
, PixCoord y2
, const VBitmap
*src
, PixCoord x1
, PixCoord y1
, PixDim dx
, PixDim dy
, const Pixel32
*tbl
) const throw();
91 virtual bool StretchBltNearestFast(PixCoord x1
, PixCoord y1
, PixDim dx
, PixDim dy
, const VBitmap
*src
, double x2
, double y2
, double dx1
, double dy1
) const throw();
93 virtual bool StretchBltBilinearFast(PixCoord x1
, PixCoord y1
, PixDim dx
, PixDim dy
, const VBitmap
*src
, double x2
, double y2
, double dx1
, double dy1
) const throw();
95 virtual bool RectFill(PixCoord x1
, PixCoord y1
, PixDim dx
, PixDim dy
, Pixel32 c
) const throw();
105 virtual bool Histogram(PixCoord x
, PixCoord y
, PixCoord dx
, PixCoord dy
, long *pHisto
, int iHistoType
) const throw();
108 bool dualrectclip(PixCoord
& x2
, PixCoord
& y2
, const VBitmap
*src
, PixCoord
& x1
, PixCoord
& y1
, PixDim
& dx
, PixDim
& dy
) const throw();