30#include <wx/dcbuffer.h>
33#include "vigra/transformimage.hxx"
68 ImageCache::getInstance().softFlush();
69 m_img = ImageCache::getInstance().getImage(file);
79 m_img = ImageCache::EntryPtr(
new ImageCache::Entry);
105 m_img = ImageCache::EntryPtr(
new ImageCache::Entry);
468 if (
rect.size() == 4)
471 for (
unsigned int j = 0;
j < 4;
j++)
480 for (
unsigned int j = 0;
j < 4;
j++)
496 for (
const auto& p :
lines)
500 dc.DrawLine(start, end);
617 for (
const auto& l :
lines)
654 if (img.GetWidth() == 0)
672 if (std::max(img.GetWidth(), img.GetHeight()) > (
ULONG_MAX >> 16))
692 img = img.Rotate90(
true);
695 img = img.Rotate180();
698 img = img.Rotate90(
false);
704 if (!
m_img->iccProfile->empty() ||
wxGetApp().GetToolboxFrame()->HasMonitorProfile())
742 if (!
m_img->iccProfile->empty() ||
wxGetApp().GetToolboxFrame()->HasMonitorProfile())
754 const double l = (p - a) * r / (r * r);
755 if (l >= 0.0 && l <= 1.0)
773 for (
int i = 0;
i < 4; ++
i)
796 for (
int i = 0;
i < 4; ++
i)
821 std::sort(
xpos.begin(),
xpos.end());
822 std::sort(
ypos.begin(),
ypos.end());
823 const unsigned int index = (
xpos.size() - 1) / 2;
924 int w = size.GetWidth();
925 int h = size.GetHeight();
double GetDistance(const hugin_utils::FDiff2D &p, const hugin_utils::FDiff2D &a, const hugin_utils::FDiff2D &b)
returns distance between point p and line between points a and p, the footpoint of p has to be betwee...
declaration of preview for lens calibration gui
const int maxSelectionDistance
maximal distance for selection of one point
const int polygonPointSize
half size of markers
const int PerspectiveOffset
size of border at all sides
Contains functions to transform whole images.
Dummy progress display, without output.
represents a control point
@ X
evaluate x, points are on a vertical line
@ Y
evaluate y, points are on a horizontal line
struct to hold a image state for stitching
const vigra::Rect2D & getROI() const
void setWidth(unsigned int w, bool keepView=true)
set panorama width keep the HFOV, if keepView=true
unsigned int getWidth() const
const PanoramaOptions & getOptions() const
returns the options for this panorama
SrcPanoImage getSrcImage(unsigned imgNr) const
get a description of a source image
Panorama duplicate() const
duplicate the panorama
image previewer for perspective correction
void RemoveLines()
remove all lines from the list
std::vector< hugin_utils::FDiff2D > m_rectPointsStartDrag
std::vector< Line > m_lines
int GetNearestRectanglePoint(const hugin_utils::FDiff2D &p)
return index of nearest rectangle point or -1 if the point is too far from rectangle
T applyRotInv(const T &p) const
PerspectiveEditorState m_editorState
std::string m_imageFilename
HuginBase::CPVector GetControlPoints(const unsigned int index)
return list of control points
void DrawRect(wxDC &dc, const std::vector< hugin_utils::FDiff2D > &rect)
void OnMiddleMouseUp(wxMouseEvent &mouse)
event handler for middle mouse button, end scrolling
HuginBase::ControlPoint GetCP(const unsigned int index, const hugin_utils::FDiff2D &p1, const hugin_utils::FDiff2D &p2)
return the HuginBase::ControlPoint, using index as image index, p1 and p2 as position,...
void OnRightMouseUp(wxMouseEvent &mouse)
event handler when right mouse button is released
void AddLines(const HuginBase::CPVector &lines)
add the lines to the list
double getScaleFactor() const
get scale factor (calculates factor when fit to window is active)
void OnSize(wxSizeEvent &e)
handler called when size of control was changed
int GetNearestRectangleLine(const hugin_utils::FDiff2D &p)
return index of nearest rectangle line or -1 if the point is too far from the rectangle lines
void setOriginalMode()
show the original images with selected zoom ration, the mouse handlers are activated
void OnMiddleMouseDown(wxMouseEvent &mouse)
event handler for middle mouse button, start scrolling
HuginBase::Panorama m_pano
HuginBase::Panorama object for calculation of remapped image.
ImageRotation m_imgRotation
void rescaleImage()
rescale the image
double calcAutoScaleFactor(wxSize size)
calculate new scale factor for this image
bool IsInsideRect(const hugin_utils::FDiff2D &p)
return true, if the point p is inside the rect
int GetNearestLine(const hugin_utils::FDiff2D &p)
return index of nearest line or -1 if the point is too far from all lines
ImageCache::EntryPtr m_img
image cache entry for current image
void setScale(double factor)
set the scaling factor for mask editing display.
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name="panel")
creates the control
void ChangeRotation(ImageRotation newRot)
wxColor m_colour_selected
int invtransform(int x) const
translate screen coordinates to image coordinates, considers additional added border
wxBitmap m_remappedImg
the remapped image as wxBitmap
int transform(int x) const
convert image coordinate to screen coordinates, considers additional added border
ImageRotation
image rotation.
double getScale() const
return scale factor, 0 for autoscale
void UpdateVirtualSize()
update the virtual size of the control, necessary for correctly display the scrollbars
void SetLineColour(wxColour newColour)
sets the colour for the lines
void OnLeftMouseUp(wxMouseEvent &mouse)
event handler when right mouse button is released
void OnKillFocus(wxFocusEvent &e)
event handler, when editor lost focus, mainly cancels creating new polygon
std::vector< hugin_utils::FDiff2D > m_rectPoints
void DrawLines(wxDC &dc, const std::vector< Line > &lines)
void GenerateRemappedImage(const unsigned int newWidth, const unsigned int newHeight)
generates the remapped image suitable for wxBitmap
void OnCaptureLost(wxMouseCaptureLostEvent &e)
event handler, when mouse capture is lost, e.g.
int scale(int x) const
helper function for scale, offset and rotation
void OnMouseMove(wxMouseEvent &mouse)
event handler when mouse is moving
void OnPaint(wxPaintEvent &e)
drawing routine
std::vector< Line > m_currentLine
void setImage(const std::string &filename, ImageRotation rot)
set the current image and mask list, this loads also the image from cache
void ClipPos(hugin_utils::FDiff2D &pos)
clip the given pos to image size + offset
void SetRemappedMode(const HuginBase::Panorama &pano)
set the panorama object for remapping, the mouse handler are deactivated
void SetRectMode(bool newMode)
set line or rect mode
T applyRot(const T &p) const
int GetNearestLinePoint(const hugin_utils::FDiff2D &p, bool &isStart)
return index of nearest line or -1 if the point to far from line
void OnLeftMouseDown(wxMouseEvent &mouse)
event handler when left mouse button is pressed
void CorrectImage(wxImage &image, const vigra::ImageImportInfo::ICCProfile &iccProfile, const cmsHPROFILE &monitorProfile)
apply color correction to given image using input iccProfile and monitor profile
std::vector< ControlPoint > CPVector
include file for the hugin project
include file for the hugin project
T squareDistance(TDiff2D< T > other) const
Return square of the distance to another point.
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.
wxImage imageCacheEntry2wxImage(ImageCache::EntryPtr e)