-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathJPEGCoder.h
More file actions
37 lines (29 loc) · 776 Bytes
/
JPEGCoder.h
File metadata and controls
37 lines (29 loc) · 776 Bytes
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
#ifndef _JPEGENCODER_
#define _JPEGENCODER_
#include <stdio.h>
#include <stdlib.h>
#ifdef __linux__
#include "jpeg-8d/jpeglib.h"
#else
#include <jpeglib.h>
#endif
class Image;
class JPEGCoder {
public:
Image *capture_img;
int capture_pixel_skip; // Adjust sampling density of captures
static const size_t MAX_COMPRESSED_SIZE = 2*1024*1024;
unsigned char *compressed;
size_t compressed_size;
int orig_w, orig_h;
int jpeg_quality;
// for libjpeg use
JSAMPARRAY sampary;
JPEGCoder( int w, int h, int pixel_skip);
~JPEGCoder();
Image *getImage() { return capture_img; }
size_t encode(Image *tgt_image=NULL);
void setCompressedData( const unsigned char *indata, size_t len );
void decode();
};
#endif