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

A preview panel that renders the pictures using the panotools library. More...

#include <PreviewPanel.h>

Inheritance diagram for PreviewPanel:
Inheritance graph

Public Types

enum  BlendMode { BLEND_COPY , BLEND_DIFFERENCE }
 

Public Member Functions

 PreviewPanel ()
 ctor.
 
bool Create (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name="panel")
 
void Init (PreviewFrame *parent, HuginBase::Panorama *pano)
 
virtual ~PreviewPanel ()
 dtor.
 
void panoramaChanged (HuginBase::Panorama &pano)
 Notification about a Panorama change.
 
void panoramaImagesChanged (HuginBase::Panorama &pano, const HuginBase::UIntSet &imgNr)
 notifies about changes to images
 
void SetAutoUpdate (bool enabled)
 
void ForceUpdate ()
 
void SetBlendMode (BlendMode b)
 
- Public Member Functions inherited from HuginBase::PanoramaObserver
virtual ~PanoramaObserver ()
 

Private Types

typedef HuginBase::Nona::RemappedPanoImage< vigra::BRGBImage, vigra::BImage > RemappedImage
 

Private Member Functions

void DrawPreview (wxDC &dc)
 
void updatePreview ()
 
void mapPreviewImage (unsigned int imgNr)
 
void OnResize (wxSizeEvent &e)
 recalculate panorama to fit the panel
 
void OnPaint (wxPaintEvent &event)
 
void OnMouse (wxMouseEvent &e)
 
void mousePressRMBEvent (wxMouseEvent &e)
 
void mousePressLMBEvent (wxMouseEvent &e)
 
void OnUpdatePreview (wxCommandEvent &e)
 
void DrawOutline (const std::vector< hugin_utils::FDiff2D > &points, wxDC &dc, int offX, int offY)
 
void mouse2erect (int xm, int ym, double &xd, double &yd)
 

Private Attributes

HuginBase::Panoramapano
 the model
 
bool m_autoPreview
 
vigra::Diff2D m_panoImgSize
 
wxBitmapm_panoBitmap
 
HuginBase::UIntSet m_dirtyImgs
 
HuginBase::PanoramaOptions opts
 
HuginBase::PTools::Transformm_pano2erect
 
SmallRemappedImageCache m_remapCache
 
BlendMode m_blendMode
 
PreviewFrameparentWindow
 
wxCursorm_cursor
 
bool m_state_rendering
 
bool m_rerender
 
bool m_imgsDirty
 

Detailed Description

A preview panel that renders the pictures using the panotools library.

Lets hope this works out fine..

Definition at line 40 of file PreviewPanel.h.

Member Typedef Documentation

◆ RemappedImage

Definition at line 42 of file PreviewPanel.h.

Member Enumeration Documentation

◆ BlendMode

Enumerator
BLEND_COPY 
BLEND_DIFFERENCE 

Definition at line 69 of file PreviewPanel.h.

Constructor & Destructor Documentation

◆ PreviewPanel()

PreviewPanel::PreviewPanel ( )

ctor.

Definition at line 49 of file PreviewPanel.cpp.

◆ ~PreviewPanel()

PreviewPanel::~PreviewPanel ( )
virtual

Member Function Documentation

◆ Create()

bool PreviewPanel::Create ( wxWindow *  parent,
wxWindowID  id = wxID_ANY,
const wxPoint pos = wxDefaultPosition,
const wxSize size = wxDefaultSize,
long  style = wxTAB_TRAVERSAL,
const wxString name = "panel" 
)

◆ DrawOutline()

void PreviewPanel::DrawOutline ( const std::vector< hugin_utils::FDiff2D > &  points,
wxDC dc,
int  offX,
int  offY 
)
private

Definition at line 702 of file PreviewPanel.cpp.

References m_panoImgSize, hugin_utils::roundi(), and threshold().

◆ DrawPreview()

void PreviewPanel::DrawPreview ( wxDC dc)
private

◆ ForceUpdate()

void PreviewPanel::ForceUpdate ( )

◆ Init()

void PreviewPanel::Init ( PreviewFrame parent,
HuginBase::Panorama pano 
)

◆ mapPreviewImage()

void PreviewPanel::mapPreviewImage ( unsigned int  imgNr)
private

◆ mouse2erect()

void PreviewPanel::mouse2erect ( int  xm,
int  ym,
double xd,
double yd 
)
private

◆ mousePressLMBEvent()

void PreviewPanel::mousePressLMBEvent ( wxMouseEvent e)
private

◆ mousePressRMBEvent()

void PreviewPanel::mousePressRMBEvent ( wxMouseEvent e)
private

◆ OnMouse()

void PreviewPanel::OnMouse ( wxMouseEvent e)
private

Definition at line 675 of file PreviewPanel.cpp.

References mouse2erect(), parentWindow, and threshold().

Referenced by Create().

◆ OnPaint()

void PreviewPanel::OnPaint ( wxPaintEvent event)
private

Definition at line 600 of file PreviewPanel.cpp.

References DrawPreview(), and threshold().

Referenced by Create().

◆ OnResize()

void PreviewPanel::OnResize ( wxSizeEvent e)
private

recalculate panorama to fit the panel

Definition at line 606 of file PreviewPanel.cpp.

References DEBUG_TRACE, ForceUpdate(), HuginBase::SmallRemappedImageCache::invalidate(), m_autoPreview, m_panoImgSize, m_remapCache, and threshold().

Referenced by Create().

◆ OnUpdatePreview()

void PreviewPanel::OnUpdatePreview ( wxCommandEvent &  e)
private

◆ panoramaChanged()

void PreviewPanel::panoramaChanged ( HuginBase::Panorama pano)
virtual

◆ panoramaImagesChanged()

void PreviewPanel::panoramaImagesChanged ( HuginBase::Panorama pano,
const HuginBase::UIntSet changed 
)
virtual

notifies about changes to images

Images might have been added/removed. to find out how many images are still there, use Panorama::getNrOfImages.

Parameters
panothe panorama object that changed
changedset of changed images

Implements HuginBase::PanoramaObserver.

Definition at line 163 of file PreviewPanel.cpp.

References DEBUG_TRACE, and m_imgsDirty.

◆ SetAutoUpdate()

void PreviewPanel::SetAutoUpdate ( bool  enabled)

◆ SetBlendMode()

void PreviewPanel::SetBlendMode ( BlendMode  b)

Definition at line 169 of file PreviewPanel.cpp.

References m_blendMode, and updatePreview().

Referenced by PreviewFrame::OnBlendChoice(), and PreviewFrame::PreviewFrame().

◆ updatePreview()

void PreviewPanel::updatePreview ( )
private

Definition at line 229 of file PreviewPanel.cpp.

References vigra_ext::applyMapping(), BLEND_COPY, BLEND_DIFFERENCE, HuginBase::Color::CorrectImage(), vigra_ext::EMoR::createEMoRLUT(), vigra_ext::createGammaLUT(), HuginBase::PTools::Transform::createTransform(), DEBUG_DEBUG, DEBUG_ERROR, DEBUG_INFO, DEBUG_TRACE, HuginBase::BaseSrcPanoImage::EQUIRECTANGULAR, huginApp::Get(), HuginBase::Panorama::getActiveImages(), HuginBase::PanoramaOptions::getHeight(), HuginBase::Panorama::getOptions(), HuginBase::PanoramaOptions::getSize(), HuginBase::Panorama::getSrcImage(), HuginBase::PanoramaOptions::getWidth(), huginApp::HasMonitorProfile(), HUGIN_IMGCACHE_MAPPING_FLOAT, hugin_utils::HuginMessageBox(), vigra_ext::INTERP_BILINEAR, HuginBase::PanoramaOptions::interpolator, m_blendMode, m_pano2erect, m_panoBitmap, m_panoImgSize, m_remapCache, m_rerender, m_state_rendering, opts, HuginBase::PanoramaOptions::OUTPUT_HDR, HuginBase::PanoramaOptions::outputExposureValue, HuginBase::PanoramaOptions::outputMode, HuginBase::PanoramaOptions::outputRangeCompression, pano, parentWindow, HuginBase::PanoramaOptions::remapUsingGPU, HuginBase::BaseSrcPanoImage::RESPONSE_EMOR, HuginBase::BaseSrcPanoImage::RESPONSE_GAMMA, HuginBase::BaseSrcPanoImage::RESPONSE_LINEAR, hugin_utils::round(), HuginBase::PanoramaOptions::setHeight(), HuginBase::PanoramaOptions::setROI(), HuginBase::SrcPanoImage::setSize(), HuginBase::PanoramaOptions::setWidth(), threshold(), and vigra::omp::transformImage().

Referenced by ForceUpdate(), panoramaChanged(), SetAutoUpdate(), and SetBlendMode().

Member Data Documentation

◆ m_autoPreview

bool PreviewPanel::m_autoPreview
private

◆ m_blendMode

BlendMode PreviewPanel::m_blendMode
private

Definition at line 116 of file PreviewPanel.h.

Referenced by SetBlendMode(), and updatePreview().

◆ m_cursor

wxCursor* PreviewPanel::m_cursor
private

Definition at line 119 of file PreviewPanel.h.

Referenced by Create(), and ~PreviewPanel().

◆ m_dirtyImgs

HuginBase::UIntSet PreviewPanel::m_dirtyImgs
private

Definition at line 105 of file PreviewPanel.h.

◆ m_imgsDirty

bool PreviewPanel::m_imgsDirty
private

Definition at line 123 of file PreviewPanel.h.

Referenced by panoramaChanged(), and panoramaImagesChanged().

◆ m_pano2erect

HuginBase::PTools::Transform* PreviewPanel::m_pano2erect
private

Definition at line 111 of file PreviewPanel.h.

Referenced by mouse2erect(), updatePreview(), and ~PreviewPanel().

◆ m_panoBitmap

wxBitmap* PreviewPanel::m_panoBitmap
private

Definition at line 102 of file PreviewPanel.h.

Referenced by DrawPreview(), updatePreview(), and ~PreviewPanel().

◆ m_panoImgSize

vigra::Diff2D PreviewPanel::m_panoImgSize
private

Definition at line 100 of file PreviewPanel.h.

Referenced by DrawOutline(), DrawPreview(), mouse2erect(), OnResize(), and updatePreview().

◆ m_remapCache

SmallRemappedImageCache PreviewPanel::m_remapCache
private

Definition at line 114 of file PreviewPanel.h.

Referenced by OnResize(), panoramaChanged(), and updatePreview().

◆ m_rerender

bool PreviewPanel::m_rerender
private

Definition at line 122 of file PreviewPanel.h.

Referenced by updatePreview().

◆ m_state_rendering

bool PreviewPanel::m_state_rendering
private

Definition at line 121 of file PreviewPanel.h.

Referenced by Create(), and updatePreview().

◆ opts

HuginBase::PanoramaOptions PreviewPanel::opts
private

Definition at line 108 of file PreviewPanel.h.

Referenced by panoramaChanged(), and updatePreview().

◆ pano

HuginBase::Panorama* PreviewPanel::pano
private

◆ parentWindow

PreviewFrame* PreviewPanel::parentWindow
private

Definition at line 118 of file PreviewPanel.h.

Referenced by Init(), OnMouse(), and updatePreview().


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