From 2a7604a5f909115a5fd633f4a058b1890b13d7ef Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Tue, 1 Aug 2006 16:03:46 +0200 Subject: add OutputImage stuff --- src/OutputImage.H | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 src/OutputImage.H (limited to 'src/OutputImage.H') diff --git a/src/OutputImage.H b/src/OutputImage.H new file mode 100644 index 0000000..4ecb0e4 --- /dev/null +++ b/src/OutputImage.H @@ -0,0 +1,59 @@ +// +// Copyright 2006 by Johannes Hofmann +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Library General Public +// License as published by the Free Software Foundation; either +// version 2 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Library General Public License for more details. +// +// You should have received a copy of the GNU Library General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA. +// + +#ifndef OUTPUTIMAGE_H +#define OUTPUTIMAGE_H + + +class OutputImage { + public: + OutputImage(); + + ~OutputImage(); + + virtual int init(int w, int h); + + int set_pixel(int x, char r, char g, char b); + + int next_line(); + + protected: + virtual int set_pixel_internal(int x, char r, char g, char b); + + virtual int next_line_internal(); +}; + +class OutputImages { + public: + OutputImages(); + + ~OutputImages(); + + int add(OutputImage *i); + + int remove(OutputImage *i); + + int init(int w, int h); + + int set_pixel(int x, char r, char g, char b); + + int next_line(); +} + +#endif -- cgit v1.2.3 From 97f03d296d77284c723d9ff8485fed51dc17c32c Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Tue, 1 Aug 2006 16:30:44 +0200 Subject: implement OutputImage stuff --- src/JPEGOutputImage.H | 2 ++ src/OutputImage.H | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'src/OutputImage.H') diff --git a/src/JPEGOutputImage.H b/src/JPEGOutputImage.H index 2a56bca..23ca25c 100644 --- a/src/JPEGOutputImage.H +++ b/src/JPEGOutputImage.H @@ -29,6 +29,8 @@ class JPEGOutputImage : OutputImage { int init(int w, int h); + int done(); + protected: int set_pixel_internal(int x, char r, char g, char b); diff --git a/src/OutputImage.H b/src/OutputImage.H index 4ecb0e4..65aca92 100644 --- a/src/OutputImage.H +++ b/src/OutputImage.H @@ -22,21 +22,30 @@ class OutputImage { + private: + int w, h; + public: OutputImage(); ~OutputImage(); - virtual int init(int w, int h); + virtual int init(int w1, int h1); int set_pixel(int x, char r, char g, char b); int next_line(); + int done(); + protected: + virtual int init_internal(int w1, h1); + virtual int set_pixel_internal(int x, char r, char g, char b); virtual int next_line_internal(); + + virtual int done_internal(); }; class OutputImages { @@ -54,6 +63,8 @@ class OutputImages { int set_pixel(int x, char r, char g, char b); int next_line(); + + int done(); } #endif -- cgit v1.2.3 From d40e2b31d77face2fb65c41cc4d901f01c5de5d1 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Tue, 1 Aug 2006 22:40:33 +0200 Subject: implement JPEGOutputImage --- src/JPEGOutputImage.H | 25 ++++++++++++++++++++----- src/Makefile.am | 6 ++++-- src/OutputImage.H | 14 +++++++++----- 3 files changed, 33 insertions(+), 12 deletions(-) (limited to 'src/OutputImage.H') 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 +extern "C" { +#include +} + +#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 -- cgit v1.2.3 From 732e18ac89479a9a789068b32145825bb0c98ba4 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Wed, 2 Aug 2006 18:00:23 +0200 Subject: implement PreviewOutputImage --- src/DataImage.H | 55 ------------- src/DataImage.cxx | 198 --------------------------------------------- src/GipfelWidget.H | 3 + src/GipfelWidget.cxx | 15 +++- src/Makefile.am | 4 +- src/OutputImage.H | 2 +- src/PreviewOutputImage.H | 53 ++++++++++++ src/PreviewOutputImage.cxx | 93 +++++++++++++++++++++ src/gipfel.cxx | 11 +-- 9 files changed, 170 insertions(+), 264 deletions(-) delete mode 100644 src/DataImage.H delete mode 100644 src/DataImage.cxx create mode 100644 src/PreviewOutputImage.H create mode 100644 src/PreviewOutputImage.cxx (limited to 'src/OutputImage.H') diff --git a/src/DataImage.H b/src/DataImage.H deleted file mode 100644 index 1846857..0000000 --- a/src/DataImage.H +++ /dev/null @@ -1,55 +0,0 @@ -// -// Copyright 2006 by Johannes Hofmann -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// - -#ifndef DATAIMAGE_H -#define DATAIMAGE_H - -#include -#include - -class DataImage : public Fl_Widget { - private: - int d; - uchar *data; - - - public: - DataImage(int X, int Y, int W, int H, int channels=3); - - ~DataImage(); - - int set_pixel(int x, int y, char r, char g, char b); - - void draw(); - - int write_jpeg(const char *file, int quality); - - int write_tiff(const char *file); - - static int get_pixel(Fl_Image *img, int x, int y, - char *r, char *g, char *b); - - static int get_pixel_bilinear(Fl_Image *img, double x, double y, - char *r, char *g, char *b); - - static int get_pixel_nearest(Fl_Image *img, double x, double y, - char *r, char *g, char *b); -}; - -#endif diff --git a/src/DataImage.cxx b/src/DataImage.cxx deleted file mode 100644 index 21aa226..0000000 --- a/src/DataImage.cxx +++ /dev/null @@ -1,198 +0,0 @@ -// -// DataImage routines. -// -// Copyright 2006 by Johannes Hofmann -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// - -#include -#include -#include -#include -extern "C" { -#include -#include -} - -#include - -#include "DataImage.H" - -DataImage::DataImage(int X, int Y, int W, int H, int channels): Fl_Widget(X, Y, W, H) { - d = channels; - data = (uchar*) malloc(W * H * d); - memset(data, 0, W * H * d); -} - -DataImage::~DataImage() { - -} - - -int -DataImage::set_pixel(int x, int y, char r, char g, char b) { - if (x < 0 || x >= w() || y < 0 || y >= h()) { - return 1; - } - - long index = (y * w() * d + (x * d)); // X/Y -> buf index - *(data+index+0) = r; - *(data+index+1) = g; - *(data+index+2) = b; - if (d == 4) { - *(data+index+3) = 255; - } - - return 0; -} - - -void -DataImage::draw() { - fl_push_clip(x(), y(), w(), h()); - - fl_draw_image(data, x(), y(), w(), h(), d); - - fl_pop_clip(); -} - -int -DataImage::get_pixel_bilinear(Fl_Image *img, double x, double y, - char *r, char *g, char *b) { - - -} - -int -DataImage::get_pixel_nearest(Fl_Image *img, double x, double y, - char *r, char *g, char *b) { - if (isnan(x) || isnan(y)) { - return 1; - } else { - return get_pixel(img, (int) rint(x), (int) rint(y), r, g, b); - } -} - -int -DataImage::get_pixel(Fl_Image *img, int x, int y, - char *r, char *g, char *b) { - if ( img->d() == 0 ) { - return 1; - } - - if (x < 0 || x >=img->w() || y < 0 || y >= img->h()) { - return 1; - } - long index = (y * img->w() * img->d()) + (x * img->d()); // X/Y -> buf index - switch ( img->count() ) { - case 1: { // bitmap - const char *buf = img->data()[0]; - switch ( img->d() ) { - case 1: { // 8bit - *r = *g = *b = *(buf+index); - break; - } - case 3: // 24bit - *r = *(buf+index+0); - *g = *(buf+index+1); - *b = *(buf+index+2); - break; - default: // ?? - printf("Not supported: chans=%d\n", img->d()); - return 1; - } - break; - } - default: // ?? pixmap, bit vals - printf("Not supported: count=%d\n", img->count()); - exit(1); - } - - return 0; -} - - -int -DataImage::write_jpeg(const char *file, int quality) { - struct jpeg_compress_struct cinfo; - struct jpeg_error_mgr jerr; - FILE *outfile; - JSAMPROW row_pointer[1]; - int row_stride; - - cinfo.err = jpeg_std_error(&jerr); - jpeg_create_compress(&cinfo); - - if ((outfile = fopen(file, "wb")) == NULL) { - fprintf(stderr, "can't open %s\n", file); - return 1; - } - - jpeg_stdio_dest(&cinfo, outfile); - cinfo.image_width = w(); - cinfo.image_height = h(); - cinfo.input_components = 3; /* # of color components per pixel */ - cinfo.in_color_space = JCS_RGB; - - jpeg_set_defaults(&cinfo); - jpeg_set_quality(&cinfo, quality, TRUE); - - jpeg_start_compress(&cinfo, TRUE); - - row_stride = w() * d; /* JSAMPLEs per row in image_buffer */ - while (cinfo.next_scanline < cinfo.image_height) { - row_pointer[0] = & data[cinfo.next_scanline * row_stride]; - jpeg_write_scanlines(&cinfo, row_pointer, 1); - } - - jpeg_finish_compress(&cinfo); - fclose(outfile); - jpeg_destroy_compress(&cinfo); - - return 0; -} - -int -DataImage::write_tiff(const char *file) { - TIFF *output; - uint32 width, height; - char *raster; - - // Open the output image - if((output = TIFFOpen(file, "w")) == NULL){ - fprintf(stderr, "can't open %s\n", file); - return 1; - } - - // Write the tiff tags to the file - TIFFSetField(output, TIFFTAG_IMAGEWIDTH, w()); - TIFFSetField(output, TIFFTAG_IMAGELENGTH, h()); - TIFFSetField(output, TIFFTAG_COMPRESSION, COMPRESSION_DEFLATE); - TIFFSetField(output, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); - TIFFSetField(output, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB); - TIFFSetField(output, TIFFTAG_BITSPERSAMPLE, 8); - TIFFSetField(output, TIFFTAG_SAMPLESPERPIXEL, d); - - // Actually write the image - if(TIFFWriteEncodedStrip(output, 0, data, w() * h() * d) == 0){ - fprintf(stderr, "Could not write image\n"); - return 2; - } - - TIFFClose(output); - return 0; -} diff --git a/src/GipfelWidget.H b/src/GipfelWidget.H index 50cb10d..4e74cb4 100644 --- a/src/GipfelWidget.H +++ b/src/GipfelWidget.H @@ -52,6 +52,9 @@ class GipfelWidget : public Fl_Widget { static int get_pixel_nearest(Fl_Image *img, double x, double y, char *r, char *g, char *b); + static int get_pixel(Fl_Image *img, int x, int y, + char *r, char *g, char *b); + public: GipfelWidget(int X,int Y,int W, int H); diff --git a/src/GipfelWidget.cxx b/src/GipfelWidget.cxx index 34716e0..c4fe032 100644 --- a/src/GipfelWidget.cxx +++ b/src/GipfelWidget.cxx @@ -770,11 +770,18 @@ GipfelWidget::get_pixel(double a_view, double a_nick, int GipfelWidget::get_pixel_nearest(Fl_Image *img, double x, double y, - char *r, char *g, char *b) { - if (isnan(x) || isnan(y)) { - return 1; - } + char *r, char *g, char *b) { + if (isnan(x) || isnan(y)) { + return 1; + } else { + return get_pixel(img, (int) rint(x), (int) rint(y), r, g, b); + } +} + +int +GipfelWidget::get_pixel(Fl_Image *img, int x, int y, + char *r, char *g, char *b) { if ( img->d() == 0 ) { return 1; } diff --git a/src/Makefile.am b/src/Makefile.am index 466b772..b686716 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -14,7 +14,8 @@ gipfel_SOURCES = \ choose_hill.cxx \ Stitch.cxx \ OutputImage.cxx \ - JPEGOutputImage.cxx + JPEGOutputImage.cxx \ + PreviewOutputImage.cxx noinst_HEADERS = \ GipfelWidget.H \ @@ -30,4 +31,5 @@ noinst_HEADERS = \ Stitch.H \ OutputImage.H \ JPEGOutputImage.H \ + PreviewOutputImage.H \ util.h diff --git a/src/OutputImage.H b/src/OutputImage.H index 9a99548..e7ab4e5 100644 --- a/src/OutputImage.H +++ b/src/OutputImage.H @@ -23,7 +23,7 @@ class OutputImage { private: - int w, h, initialized, line; + int W, H, initialized, line; public: OutputImage(); diff --git a/src/PreviewOutputImage.H b/src/PreviewOutputImage.H new file mode 100644 index 0000000..02e60c5 --- /dev/null +++ b/src/PreviewOutputImage.H @@ -0,0 +1,53 @@ +// +// Copyright 2006 by Johannes Hofmann +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Library General Public +// License as published by the Free Software Foundation; either +// version 2 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Library General Public License for more details. +// +// You should have received a copy of the GNU Library General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA. +// + +#ifndef PREVIEWOUTPUTIMAGE_H +#define PREVIEWOUTPUTIMAGE_H + +#include + +#include +#include + +#include "OutputImage.H" + +class PreviewOutputImage : OutputImage , public Fl_Widget { + private: + uchar *data; + int d; + int row; + + public: + PreviewOutputImage(int X, int Y, int W, int H); + + ~PreviewOutputImage(); + + void draw(); + + 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/PreviewOutputImage.cxx b/src/PreviewOutputImage.cxx new file mode 100644 index 0000000..ba86edc --- /dev/null +++ b/src/PreviewOutputImage.cxx @@ -0,0 +1,93 @@ +// +// DataImage routines. +// +// Copyright 2006 by Johannes Hofmann +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Library General Public +// License as published by the Free Software Foundation; either +// version 2 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Library General Public License for more details. +// +// You should have received a copy of the GNU Library General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA. +// + +#include +#include +#include + +#include +#include + +#include "PreviewOutputImage.H" + +PreviewOutputImage::PreviewOutputImage(int X, int Y, int W, int H): Fl_Widget(X, Y, W, H) { + d = 3; + data = NULL; +} + +PreviewOutputImage::~PreviewOutputImage() { + if (data) { + free(data); + } +} + +int +PreviewOutputImage::init_internal(int w, int h) { + data = (uchar*) malloc(w * h * d); + memset(data, 0, w * h * d); + row = 0; + size(w, h); + return 0; +} + + + +int +PreviewOutputImage::set_pixel_internal(int x, char r, char g, char b) { + if (!data) { + return 1; + } + + long index = (row * w() * d + (x * d)); + *(data+index+0) = r; + *(data+index+1) = g; + *(data+index+2) = b; + + return 0; +} + +int +PreviewOutputImage::next_line_internal() { + row++; + if (row % (h() / 100) == 0) { + redraw(); + Fl::check(); + } + return 0; +} + +int +PreviewOutputImage::done_internal() { + return 0; +} + +void +PreviewOutputImage::draw() { + if (!data) { + return; + } + fl_push_clip(x(), y(), w(), h()); + + fl_draw_image(data, x(), y(), w(), h(), d); + + fl_pop_clip(); +} + diff --git a/src/gipfel.cxx b/src/gipfel.cxx index 5cd170a..5dd69a7 100644 --- a/src/gipfel.cxx +++ b/src/gipfel.cxx @@ -42,6 +42,7 @@ #include "Fl_Search_Chooser.H" #include "GipfelWidget.H" #include "JPEGOutputImage.H" +#include "PreviewOutputImage.H" #include "Stitch.H" #include "choose_hill.H" #include "../config.h" @@ -448,18 +449,18 @@ static int stitch(int stitch_w, int stitch_h, int argc, char **argv) { for (int i=0; iload_image(argv[i]); } -#if 0 + win = new Fl_Window(0,0, 1000, stitch_h); scroll = new Fl_Scroll(0, 0, win->w(), win->h()); - PreviewOutputImage *img = new PreviewOutputImage(); + PreviewOutputImage *img = new PreviewOutputImage(0, 0, stitch_w, stitch_h); win->resizable(scroll); win->show(0, argv); - st->resample(img, 0.0, 7.0); -#endif - st->set_output((OutputImage*) new JPEGOutputImage("/tmp/bla.jpg", 90)); + //st->set_output((OutputImage*) new JPEGOutputImage("/tmp/bla.jpg", 90)); + st->set_output((OutputImage*) img); st->resample(stitch_w, stitch_h, 0.0, 7.0); + img->redraw(); Fl::run(); return 0; -- cgit v1.2.3 From f2e115a29f85d8d637f2e0894532212e93691118 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Wed, 2 Aug 2006 18:06:28 +0200 Subject: cleanup --- src/OutputImage.H | 4 +++- src/PreviewOutputImage.H | 1 - src/PreviewOutputImage.cxx | 6 ++---- src/gipfel.cxx | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) (limited to 'src/OutputImage.H') diff --git a/src/OutputImage.H b/src/OutputImage.H index e7ab4e5..a7f01f5 100644 --- a/src/OutputImage.H +++ b/src/OutputImage.H @@ -23,7 +23,7 @@ class OutputImage { private: - int W, H, initialized, line; + int initialized; public: OutputImage(); @@ -39,6 +39,8 @@ class OutputImage { int done(); protected: + int W, H, line; + virtual int init_internal(int w1, int h1); virtual int set_pixel_internal(int x, char r, char g, char b); diff --git a/src/PreviewOutputImage.H b/src/PreviewOutputImage.H index 02e60c5..7095999 100644 --- a/src/PreviewOutputImage.H +++ b/src/PreviewOutputImage.H @@ -31,7 +31,6 @@ class PreviewOutputImage : OutputImage , public Fl_Widget { private: uchar *data; int d; - int row; public: PreviewOutputImage(int X, int Y, int W, int H); diff --git a/src/PreviewOutputImage.cxx b/src/PreviewOutputImage.cxx index ba86edc..078ba26 100644 --- a/src/PreviewOutputImage.cxx +++ b/src/PreviewOutputImage.cxx @@ -43,7 +43,6 @@ int PreviewOutputImage::init_internal(int w, int h) { data = (uchar*) malloc(w * h * d); memset(data, 0, w * h * d); - row = 0; size(w, h); return 0; } @@ -56,7 +55,7 @@ PreviewOutputImage::set_pixel_internal(int x, char r, char g, char b) { return 1; } - long index = (row * w() * d + (x * d)); + long index = (line * w() * d + (x * d)); *(data+index+0) = r; *(data+index+1) = g; *(data+index+2) = b; @@ -66,8 +65,7 @@ PreviewOutputImage::set_pixel_internal(int x, char r, char g, char b) { int PreviewOutputImage::next_line_internal() { - row++; - if (row % (h() / 100) == 0) { + if (line % 10 == 0) { redraw(); Fl::check(); } diff --git a/src/gipfel.cxx b/src/gipfel.cxx index 5dd69a7..8256cd8 100644 --- a/src/gipfel.cxx +++ b/src/gipfel.cxx @@ -450,7 +450,7 @@ static int stitch(int stitch_w, int stitch_h, int argc, char **argv) { st->load_image(argv[i]); } - win = new Fl_Window(0,0, 1000, stitch_h); + win = new Fl_Window(0,0, stitch_w, stitch_h); scroll = new Fl_Scroll(0, 0, win->w(), win->h()); PreviewOutputImage *img = new PreviewOutputImage(0, 0, stitch_w, stitch_h); win->resizable(scroll); -- cgit v1.2.3 From b289453edc8c3f83824b2e2964779de0bad148a7 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Thu, 3 Aug 2006 20:53:10 +0200 Subject: remove OutputImages --- src/OutputImage.H | 23 -------------- src/OutputImage.cxx | 87 ----------------------------------------------------- 2 files changed, 110 deletions(-) (limited to 'src/OutputImage.H') diff --git a/src/OutputImage.H b/src/OutputImage.H index a7f01f5..8792eb6 100644 --- a/src/OutputImage.H +++ b/src/OutputImage.H @@ -50,27 +50,4 @@ class OutputImage { virtual int done_internal(); }; -class OutputImages { - private: - OutputImage **imgs; - int max_imgs; - - public: - OutputImages(); - - ~OutputImages(); - - int add(OutputImage *img); - - int remove(OutputImage *img); - - int init(int w, int h); - - int set_pixel(int x, char r, char g, char b); - - int next_line(); - - int done(); -}; - #endif diff --git a/src/OutputImage.cxx b/src/OutputImage.cxx index 52af058..f2e7296 100644 --- a/src/OutputImage.cxx +++ b/src/OutputImage.cxx @@ -90,90 +90,3 @@ OutputImage::done_internal() { return 0; } -#define MAX_OUTPUT_IMAGES 16 -OutputImages::OutputImages() { - imgs = (OutputImage **) calloc(MAX_OUTPUT_IMAGES, sizeof(OutputImage *)); - max_imgs = MAX_OUTPUT_IMAGES; -} - -OutputImages::~OutputImages() { - free(imgs); -} - -int -OutputImages::add(OutputImage *img) { - for (int i=0; iinit(w, h); - } - } - - return ret; -} - -int -OutputImages::set_pixel(int x, char r, char g, char b) { - int ret = 0; - - for (int i=0; iset_pixel(x, r, g, b); - } - } - - return ret; -} - -int -OutputImages::next_line() { - int ret = 0; - - for (int i=0; inext_line(); - } - } - - return ret; -} - -int -OutputImages::done() { - int ret = 0; - - for (int i=0; idone(); - } - } - - return ret; -} - -- cgit v1.2.3