updated resizer

This commit is contained in:
albert
2011-08-22 17:46:20 -04:00
parent 6b01c88679
commit 97134c3268
21 changed files with 792 additions and 356 deletions

View File

@@ -6,31 +6,33 @@
#include <setjmp.h>
#include "jpeglib-extern.h"
#include "Reader.h"
#include "Filter.h"
struct jpeg_error
{
struct jpeg_error_mgr pub;
jmp_buf setjmp_buffer;
char *buffer;
char buffer[JMSG_LENGTH_MAX];
};
class JPEG: public Reader
{
public:
bool Read(FILE *f, Resizer *resizer, char error[1024]);
bool Read(FILE *f, Filter *pOutput, char error[1024]);
private:
Resizer *m_Resizer;
Filter *m_pOutputFilter;
struct jpeg_error m_JErr;
};
class JPEGCompressor
class JPEGCompressor: public Filter
{
public:
JPEGCompressor(FILE *f);
~JPEGCompressor();
bool Init(int width, int height, int quality);
bool Init(int iSourceWidth, int iSourceHeight, int iBPP);
void SetQuality(int quality);
bool WriteRow(uint8_t *row);
bool Finish();
@@ -40,6 +42,7 @@ public:
private:
FILE *m_File;
int m_iQuality;
struct jpeg_compress_struct m_CInfo;
struct jpeg_error m_JErr;
};