diff options
author | Casimir666 <casimir666@users.sourceforge.net> | 2006-06-25 01:37:43 +0400 |
---|---|---|
committer | Casimir666 <casimir666@users.sourceforge.net> | 2006-06-25 01:37:43 +0400 |
commit | 0868305e78da2b0742c2ce349efa041d5622ae21 (patch) | |
tree | 663fd93132c7927910ba7c13188d6332b2e3e5b2 /src/apps/mplayerc/jpeg.h | |
parent | 43c8656956a0460fc4551e3ea7a39b9f3094a3e3 (diff) |
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@14 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/apps/mplayerc/jpeg.h')
-rw-r--r-- | src/apps/mplayerc/jpeg.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/src/apps/mplayerc/jpeg.h b/src/apps/mplayerc/jpeg.h new file mode 100644 index 000000000..932da80fd --- /dev/null +++ b/src/apps/mplayerc/jpeg.h @@ -0,0 +1,59 @@ +#pragma once
+
+class CJpegEncoder
+{
+ static const int ColorComponents = 3;
+
+ int m_w, m_h;
+ BYTE* m_p;
+
+ unsigned int m_bbuff, m_bwidth;
+ bool PutBit(int b, int n);
+ void Flush();
+ int GetBitWidth(short q);
+
+ void WriteSOI();
+ void WriteDQT();
+ void WriteSOF0();
+ void WriteDHT();
+ void WriteSOS();
+ void WriteEOI();
+
+protected:
+ virtual bool PutByte(BYTE b) = 0;
+ virtual bool PutBytes(const void* pData, int len) = 0;
+ virtual bool Encode(const BYTE* dib);
+
+public:
+ CJpegEncoder();
+};
+
+class CJpegEncoderFile : public CJpegEncoder
+{
+ CString m_fn;
+ FILE* m_file;
+
+protected:
+ bool PutByte(BYTE b);
+ bool PutBytes(const void* pData, int len);
+
+public:
+ CJpegEncoderFile(LPCTSTR fn);
+
+ bool Encode(const BYTE* dib);
+};
+
+class CJpegEncoderMem : public CJpegEncoder
+{
+ CAtlArray<BYTE>* m_pdata;
+
+protected:
+ bool PutByte(BYTE b);
+ bool PutBytes(const void* pData, int len);
+
+public:
+ CJpegEncoderMem();
+
+ bool Encode(const BYTE* dib, CAtlArray<BYTE>& data);
+};
+
|