Hugin trunk 0.1
Loading...
Searching...
No Matches
PreviewWindow.h
Go to the documentation of this file.
1// -*- c-basic-offset: 4 -*-
10/* This is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public
12 * License as published by the Free Software Foundation; either
13 * version 2 of the License, or (at your option) any later version.
14 *
15 * This software is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public
21 * License along with this software. If not, see
22 * <http://www.gnu.org/licenses/>.
23 *
24 */
25
26#ifndef PREVIEWWINDOW_H
27#define PREVIEWWINDOW_H
28
29#include <wx/scrolwin.h>
30#include <wx/bitmap.h>
31#include <wx/image.h>
32#include "base_wx/wxcms.h"
33
38class PreviewWindow : public wxScrolledWindow
39{
40public:
42 bool Create(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL, const wxString& name = "panel");
44 void setImage (const wxString& filename);
49 void setScale(double factor);
51 double getScale();
53 void OnPaint(wxPaintEvent& e);
54protected:
56 void OnSize(wxSizeEvent & e);
58 double getScaleFactor() const;
60 double calcAutoScaleFactor(wxSize size);
62 void rescaleImage();
63 private:
64 //orignal image
66 // scaled bitmap
69 int scale(int x) const;
70 double scale(double x) const;
72 double m_scaleFactor{ 1.0 };
73 bool m_fitToWindow{ false };
75 vigra::ImageImportInfo::ICCProfile m_iccProfile;
77};
78
79#endif // PREVIEWWINDOW_H
preview window
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name="panel")
create the control
void setImage(const wxString &filename)
set the current image and mask list, this loads also the image from cache
vigra::ImageImportInfo::ICCProfile m_iccProfile
remember icc profile of currently loaded file
double calcAutoScaleFactor(wxSize size)
calculate new scale factor for this image
double m_scaleFactor
store current scale factor
int scale(int x) const
helper function to scale of width/height
double getScale()
return scale factor, 0 for autoscale
wxBitmap m_bitmap
void OnSize(wxSizeEvent &e)
handler called when size of control was changed
void OnPaint(wxPaintEvent &e)
drawing routine
double getScaleFactor() const
get scale factor (calculates factor when fit to window is active)
void setScale(double factor)
set the scaling factor f.
void rescaleImage()
rescale the image
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.
Definition threshold.h:41