From 913bfcaffa8b2fd6c4343cc86abab74fdddf4712 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Fri, 27 Mar 2009 10:03:57 +0100 Subject: make ScreenDump more generic --- src/ScreenDump.H | 5 +++-- src/ScreenDump.cxx | 11 +++++------ 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/ScreenDump.H b/src/ScreenDump.H index d99a72d..8564054 100644 --- a/src/ScreenDump.H +++ b/src/ScreenDump.H @@ -7,7 +7,8 @@ #ifndef SCREENDUMP_H #define SCREENDUMP_H -#include "GipfelWidget.H" +#include + #include "OutputImage.H" class ScreenDump { @@ -16,7 +17,7 @@ class ScreenDump { unsigned char * rgb; public: - ScreenDump(GipfelWidget *gipf); + ScreenDump(Fl_Widget *widget); ~ScreenDump(); int save(OutputImage *out); diff --git a/src/ScreenDump.cxx b/src/ScreenDump.cxx index 7a3447a..43fd6b1 100644 --- a/src/ScreenDump.cxx +++ b/src/ScreenDump.cxx @@ -4,17 +4,17 @@ #include "ScreenDump.H" -ScreenDump::ScreenDump(GipfelWidget *gipf) { +ScreenDump::ScreenDump(Fl_Widget *widget) { Fl_Offscreen offscreen; - w = gipf->w(); - h = gipf->h(); + w = widget->w(); + h = widget->h(); Fl::flush(); offscreen = fl_create_offscreen(w, h); fl_begin_offscreen(offscreen); - gipf->redraw(); - gipf->draw(); + widget->redraw(); + widget->draw(); rgb = fl_read_image(NULL, 0, 0, w, h); fl_end_offscreen(); fl_delete_offscreen(offscreen); @@ -27,7 +27,6 @@ ScreenDump::~ScreenDump() { int ScreenDump::save(OutputImage *out) { - out->init(w, h); for (int y = 0; y < h; y++) { -- cgit v1.2.3