Support unrar64.dll
[xy_vsfilter.git] / src / apps / mplayerc / jpeg.h
blob932da80fdb5b4b5b6620394c030ed36825ce2a12
1 #pragma once
3 class CJpegEncoder
5 static const int ColorComponents = 3;
7 int m_w, m_h;
8 BYTE* m_p;
10 unsigned int m_bbuff, m_bwidth;
11 bool PutBit(int b, int n);
12 void Flush();
13 int GetBitWidth(short q);
15 void WriteSOI();
16 void WriteDQT();
17 void WriteSOF0();
18 void WriteDHT();
19 void WriteSOS();
20 void WriteEOI();
22 protected:
23 virtual bool PutByte(BYTE b) = 0;
24 virtual bool PutBytes(const void* pData, int len) = 0;
25 virtual bool Encode(const BYTE* dib);
27 public:
28 CJpegEncoder();
31 class CJpegEncoderFile : public CJpegEncoder
33 CString m_fn;
34 FILE* m_file;
36 protected:
37 bool PutByte(BYTE b);
38 bool PutBytes(const void* pData, int len);
40 public:
41 CJpegEncoderFile(LPCTSTR fn);
43 bool Encode(const BYTE* dib);
46 class CJpegEncoderMem : public CJpegEncoder
48 CAtlArray<BYTE>* m_pdata;
50 protected:
51 bool PutByte(BYTE b);
52 bool PutBytes(const void* pData, int len);
54 public:
55 CJpegEncoderMem();
57 bool Encode(const BYTE* dib, CAtlArray<BYTE>& data);