1 #ifndef VTESTBED_JPEG_JPEG_HH 2 #define VTESTBED_JPEG_JPEG_HH 12 using byte_type = JSAMPLE;
14 enum class Color_space: int {
15 Unknown = JCS_UNKNOWN,
16 Grayscale = JCS_GRAYSCALE,
27 ::jpeg_error_mgr _err;
28 FILE* _outfile =
nullptr;
34 Color_space colorspace,
43 void write(
const byte_type* bytes);
44 void write_reverse(
const byte_type* bytes);
47 inline void start() { ::jpeg_start_compress(
this, TRUE); }
48 inline void finish() { ::jpeg_finish_compress(
this); }
49 inline void close() { ::fclose(this->_outfile); }
50 inline void destroy() { ::jpeg_destroy_compress(
this); }
58 #endif // vim:filetype=cpp