Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
LayoutRemapper Class Reference

Draw undistored images, but with the correct centre position. More...

#include <LayoutRemapper.h>

Inheritance diagram for LayoutRemapper:
Inheritance graph

Public Member Functions

 LayoutRemapper (HuginBase::Panorama *m_pano, HuginBase::SrcPanoImage *image, VisualizationState *visualization_state)
 
virtual void UpdateAndResetIndex ()
 
virtual bool GetNextFaceCoordinates (Coords *result)
 Get the texture and vertex coordinates for the next face. More...
 
void setScale (double scale)
 Set the size to draw the images. More...
 
- Public Member Functions inherited from MeshRemapper
 MeshRemapper (HuginBase::Panorama *m_pano, HuginBase::SrcPanoImage *image, VisualizationState *visualization_state)
 
virtual ~MeshRemapper ()
 

Private Attributes

double m_layoutScale
 
bool done
 
ArrayCoords face
 

Additional Inherited Members

- Protected Member Functions inherited from MeshRemapper
void SetCrop ()
 Fill the crop values of the MeshRemapper from the source image. More...
 
void ClipFace (Coords *face)
 Crop a face to the source image, return true if there is anything left. More...
 
bool GiveClipFaceResult (Coords *result)
 Get a face that was produced by ClipFace. More...
 
- Protected Attributes inherited from MeshRemapper
VisualizationStatevisualization_state
 
HuginBase::Panoramam_pano
 
HuginBase::SrcPanoImageimage
 
float scale
 The number number of units between vertex coorinates that gives a pixel in the display. More...
 
double height
 The sizes of the input images in pixels. More...
 
double width
 
HuginBase::PTools::Transform transform
 A transform to use to remap the images. More...
 
HuginBase::SrcPanoImage::CropMode crop_mode
 Crop mode of the source image. More...
 
double crop_x1
 
double crop_x2
 
double crop_y1
 
double crop_y2
 
double circle_crop_centre_x
 
double circle_crop_centre_y
 
double circle_crop_radius_x
 
double circle_crop_radius_y
 
bool circle_crop
 

Detailed Description

Draw undistored images, but with the correct centre position.

Must be given a scale to draw with, using SetScale.

Definition at line 32 of file LayoutRemapper.h.

Constructor & Destructor Documentation

LayoutRemapper::LayoutRemapper ( HuginBase::Panorama m_pano,
HuginBase::SrcPanoImage image,
VisualizationState visualization_state 
)

Definition at line 34 of file LayoutRemapper.cpp.

References face, and MeshRemapper::ArrayCoords::tex_c.

Member Function Documentation

bool LayoutRemapper::GetNextFaceCoordinates ( Coords result)
virtual

Get the texture and vertex coordinates for the next face.

The coordinates are ordered [left / right][top / bottom][x coord / y coord].

Returns
false once specified all faces, true otherwise.

Implements MeshRemapper.

Definition at line 113 of file LayoutRemapper.cpp.

References done, face, MeshRemapper::Coords::tex_c, MeshRemapper::ArrayCoords::tex_c, MeshRemapper::Coords::vertex_c, and MeshRemapper::ArrayCoords::vertex_c.

void LayoutRemapper::setScale ( double  scale)

Set the size to draw the images.

Specify the maximum dimension you would like the image to have. The actual size of the image will have this maximum dimension, and the same aspect ratio as the original image file.

Definition at line 128 of file LayoutRemapper.cpp.

References m_layoutScale.

Referenced by MeshManager::MeshInfo::Update().

void LayoutRemapper::UpdateAndResetIndex ( )
virtual
Todo:
Offset the centre position for images in brackets, when showing all brackets together.

I think a good offset would be about scale * bracket number / 5, assuming bracket numbers are a sequence of consecutive integers starting at 0.

Reimplemented from MeshRemapper.

Definition at line 52 of file LayoutRemapper.cpp.

References HuginBase::PTools::Transform::createInvTransform(), done, face, VisualizationState::GetOptions(), MeshRemapper::image, m_layoutScale, M_PI, MeshRemapper::transform, HuginBase::PTools::Transform::transformImgCoord(), MeshRemapper::ArrayCoords::vertex_c, and MeshRemapper::visualization_state.

Member Data Documentation

bool LayoutRemapper::done
private

Definition at line 48 of file LayoutRemapper.h.

Referenced by GetNextFaceCoordinates(), and UpdateAndResetIndex().

ArrayCoords LayoutRemapper::face
private

Definition at line 49 of file LayoutRemapper.h.

Referenced by GetNextFaceCoordinates(), LayoutRemapper(), and UpdateAndResetIndex().

double LayoutRemapper::m_layoutScale
private

Definition at line 47 of file LayoutRemapper.h.

Referenced by setScale(), and UpdateAndResetIndex().


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