VideoSample.h
1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef _VIDEO_SAMPLE_H
#define _VIDEO_SAMPLE_H
#include "AVLib.h"
namespace AVLib
{
struct BitmapInformation
{
BITMAPINFOHEADER bmiHeader;
RGBQUAD bmiColors[3];
};
class AVLIB_API VideoSample
{
public:
VideoSample(char *bitmapBuffer, const BitmapInformation &bitmapInfo);
~VideoSample();
char* GetBitmapBuffer();
BitmapInformation GetBitmapInformation();
long GetBitmapWidth();
long GetBitmapHeight();
long GetBitmapSize();
bool Scale(long newWidth, long newHeight);
bool ConvertToRGB32();
bool ConvertToRGB24();
bool ConvertToRGB565();
bool ConvertToRGB555();
bool Save(TCHAR tszPath);
bool SaveToClipboard();
private:
void AllocateBitmapBuffer(int size);
void SetBitmapInformation(const BitmapInformation &bitmapInfo);
bool IsRGB32();
bool IsRGB24();
bool IsRGB565();
bool IsRGB555();
char *m_BitmapBuffer;
BitmapInformation m_BitmapInfo;
};
}
#endif // _VIDEO_SAMPLE_H