diff options
-rw-r--r-- | src/JPEGOutputImage.H | 25 | ||||
-rw-r--r-- | src/Makefile.am | 6 | ||||
-rw-r--r-- | src/OutputImage.H | 14 |
3 files changed, 33 insertions, 12 deletions
diff --git a/src/JPEGOutputImage.H b/src/JPEGOutputImage.H index 23ca25c..bf1c6c1 100644 --- a/src/JPEGOutputImage.H +++ b/src/JPEGOutputImage.H @@ -20,21 +20,36 @@ #ifndef JPEGOUTPUTIMAGE_H #define JPEGOUTPUTIMAGE_H +#include <stdio.h> +extern "C" { +#include <jpeglib.h> +} + +#include "OutputImage.H" class JPEGOutputImage : OutputImage { + private: + unsigned char *row; + char *file; + int w, h; + struct jpeg_compress_struct cinfo; + struct jpeg_error_mgr jerr; + FILE *fp; + int quality; + public: - JPEGOutputImage(); + JPEGOutputImage(const char *file, int quality = 90); ~JPEGOutputImage(); - - int init(int w, int h); - - int done(); protected: + int init_internal(int w, int h); + int set_pixel_internal(int x, char r, char g, char b); int next_line_internal(); + + int done_internal(); }; #endif diff --git a/src/Makefile.am b/src/Makefile.am index e8b384a..466b772 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -13,7 +13,8 @@ gipfel_SOURCES = \ Fl_Search_Chooser.cxx \ choose_hill.cxx \ Stitch.cxx \ - DataImage.cxx + OutputImage.cxx \ + JPEGOutputImage.cxx noinst_HEADERS = \ GipfelWidget.H \ @@ -27,5 +28,6 @@ noinst_HEADERS = \ Fl_Search_Chooser.H \ choose_hill.H \ Stitch.H \ - DataImage.H \ + OutputImage.H \ + JPEGOutputImage.H \ util.h diff --git a/src/OutputImage.H b/src/OutputImage.H index 65aca92..9a99548 100644 --- a/src/OutputImage.H +++ b/src/OutputImage.H @@ -23,7 +23,7 @@ class OutputImage { private: - int w, h; + int w, h, initialized, line; public: OutputImage(); @@ -39,7 +39,7 @@ class OutputImage { int done(); protected: - virtual int init_internal(int w1, h1); + virtual int init_internal(int w1, int h1); virtual int set_pixel_internal(int x, char r, char g, char b); @@ -49,14 +49,18 @@ class OutputImage { }; class OutputImages { + private: + OutputImage **imgs; + int max_imgs; + public: OutputImages(); ~OutputImages(); - int add(OutputImage *i); + int add(OutputImage *img); - int remove(OutputImage *i); + int remove(OutputImage *img); int init(int w, int h); @@ -65,6 +69,6 @@ class OutputImages { int next_line(); int done(); -} +}; #endif |