Hugin trunk 0.1
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
PreviewWindow Class Reference

preview window More...

#include <PreviewWindow.h>

Inheritance diagram for PreviewWindow:
Inheritance graph

Public Member Functions

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
 
void setScale (double factor)
 set the scaling factor f.
 
double getScale ()
 return scale factor, 0 for autoscale
 
void OnPaint (wxPaintEvent &e)
 drawing routine
 

Protected Member Functions

void OnSize (wxSizeEvent &e)
 handler called when size of control was changed
 
double getScaleFactor () const
 get scale factor (calculates factor when fit to window is active)
 
double calcAutoScaleFactor (wxSize size)
 calculate new scale factor for this image
 
void rescaleImage ()
 rescale the image
 

Private Member Functions

int scale (int x) const
 helper function to scale of width/height
 
double scale (double x) const
 

Private Attributes

wxImage m_image
 
wxBitmap m_bitmap
 
double m_scaleFactor { 1.0 }
 store current scale factor
 
bool m_fitToWindow { false }
 
vigra::ImageImportInfo::ICCProfile m_iccProfile
 remember icc profile of currently loaded file
 

Detailed Description

preview window

This class handles display of an image at different zoom ratio

Definition at line 38 of file PreviewWindow.h.

Member Function Documentation

◆ calcAutoScaleFactor()

double PreviewWindow::calcAutoScaleFactor ( wxSize  size)
protected

calculate new scale factor for this image

Definition at line 173 of file PreviewWindow.cpp.

References threshold().

Referenced by rescaleImage(), and setScale().

◆ Create()

bool PreviewWindow::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

Definition at line 33 of file PreviewWindow.cpp.

References m_fitToWindow, m_scaleFactor, OnPaint(), OnSize(), and threshold().

Referenced by EnfusePanel::Create(), and StackerPanel::Create().

◆ getScale()

double PreviewWindow::getScale ( )

return scale factor, 0 for autoscale

Definition at line 167 of file PreviewWindow.cpp.

References m_fitToWindow, and m_scaleFactor.

◆ getScaleFactor()

double PreviewWindow::getScaleFactor ( ) const
protected

get scale factor (calculates factor when fit to window is active)

Definition at line 183 of file PreviewWindow.cpp.

References m_scaleFactor.

Referenced by rescaleImage(), scale(), and scale().

◆ OnPaint()

void PreviewWindow::OnPaint ( wxPaintEvent e)

drawing routine

Definition at line 76 of file PreviewWindow.cpp.

References m_bitmap, and threshold().

Referenced by Create().

◆ OnSize()

void PreviewWindow::OnSize ( wxSizeEvent e)
protected

handler called when size of control was changed

Definition at line 89 of file PreviewWindow.cpp.

References m_fitToWindow, m_image, and setScale().

Referenced by Create().

◆ rescaleImage()

void PreviewWindow::rescaleImage ( )
protected

◆ scale() [1/2]

double PreviewWindow::scale ( double  x) const
private

Definition at line 193 of file PreviewWindow.cpp.

References getScaleFactor().

◆ scale() [2/2]

int PreviewWindow::scale ( int  x) const
private

helper function to scale of width/height

Definition at line 188 of file PreviewWindow.cpp.

References getScaleFactor().

Referenced by rescaleImage().

◆ setImage()

void PreviewWindow::setImage ( const wxString filename)

set the current image and mask list, this loads also the image from cache

Definition at line 46 of file PreviewWindow.cpp.

References HUGIN_CONV_FILENAME, m_iccProfile, m_image, rescaleImage(), and threshold().

Referenced by EnfusePanel::OnProcessFinished(), and StackerPanel::OnProcessFinished().

◆ setScale()

void PreviewWindow::setScale ( double  factor)

set the scaling factor f.

Parameters
factorzoom factor, 0 means fit to window.

Definition at line 147 of file PreviewWindow.cpp.

References calcAutoScaleFactor(), m_fitToWindow, m_image, m_scaleFactor, and rescaleImage().

Referenced by OnSize(), EnfusePanel::OnZoom(), and StackerPanel::OnZoom().

Member Data Documentation

◆ m_bitmap

wxBitmap PreviewWindow::m_bitmap
private

Definition at line 67 of file PreviewWindow.h.

Referenced by OnPaint(), and rescaleImage().

◆ m_fitToWindow

bool PreviewWindow::m_fitToWindow { false }
private

Definition at line 73 of file PreviewWindow.h.

Referenced by Create(), getScale(), OnSize(), rescaleImage(), and setScale().

◆ m_iccProfile

vigra::ImageImportInfo::ICCProfile PreviewWindow::m_iccProfile
private

remember icc profile of currently loaded file

Definition at line 75 of file PreviewWindow.h.

Referenced by rescaleImage(), and setImage().

◆ m_image

wxImage PreviewWindow::m_image
private

Definition at line 65 of file PreviewWindow.h.

Referenced by OnSize(), rescaleImage(), setImage(), and setScale().

◆ m_scaleFactor

double PreviewWindow::m_scaleFactor { 1.0 }
private

store current scale factor

Definition at line 72 of file PreviewWindow.h.

Referenced by Create(), getScale(), getScaleFactor(), rescaleImage(), and setScale().


The documentation for this class was generated from the following files: