NCBI C++ ToolKit
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CPhyloImageGrabber Class Reference

Search Toolkit Book for CPhyloImageGrabber

#include <gui/widgets/phylo_tree/phylo_image_grabber.hpp>

+ Inheritance diagram for CPhyloImageGrabber:
+ Collaboration diagram for CPhyloImageGrabber:

Public Member Functions

 CPhyloImageGrabber (CPhyloTreePane &pane)
 
virtual ~CPhyloImageGrabber ()
 
- Public Member Functions inherited from IImageGrabber
 IImageGrabber ()
 
virtual ~IImageGrabber ()
 
virtual eCaptureResult GrabImages (int tex_size, IImageGrabberProgress *p=NULL)
 Grab the requested images. More...
 
eCaptureResult GrabImage (int tex_size, CVect2< int > img_idx, IImageGrabberProgress *p=NULL)
 Grab a single image for preview purposes. More...
 
eCaptureResult PreviewImages (int tex_size, int ref_img_width, int ref_img_height, IImageGrabberProgress *p=NULL)
 Grab images to update the on-screen image to approximate final output. More...
 
void SetPartitions (const CVect2< int > &p)
 Set number of desired image partitions. More...
 
void SetOutputInfo (const std::string &dir, const std::string &base_name, const std::string &img_format)
 Set file output information. More...
 
void SetNumberingFormat (eImageNumberingFormat fmt)
 Set the numbering format for sequential image names. More...
 
void SetTileAspectRatio (float ar)
 Set aspect ratio tiles captured. More...
 
void SetImageAspectRatio (float ar)
 Set aspect ratio for image as a whole. More...
 
void SetOutputFormat (const string &f)
 Set output format on which image aspect is based, e.g. A4, US Letter.. More...
 
void SetPrintingGuidesEnabled (bool b)
 Set to true to put cutting/printing guides on output images. More...
 
void DisableGouraudShading (bool b)
 Set to true force all triangles to be printed flat (no shadingtype 4) This makes the file compatible with Adobe Illustrator. More...
 
void SetTitleHeight (TModelUnit h)
 Set size for optional pdf title. More...
 
virtual void SetOutputStream (CNcbiOstream *ostr)
 

Protected Member Functions

void x_BeginCaptures (int buffer_size)
 Called to setup values before image capturing starts. More...
 
void x_EndCaptures ()
 Called to restore values (in pane) when capturing stops. More...
 
eCaptureResult x_CaptureImage (CVect2< int > partitions, CVect2< int > index, CVect2< size_t > &capture_size)
 Capture the image at tile position 'index'. More...
 
- Protected Member Functions inherited from IImageGrabber
void x_RenderGuides (CVect2< size_t > capture_size, const std::string &image_name, std::string image_bottom, std::string image_right, std::string image_top, std::string image_left)
 Render guides around image edge (cut marks + adjacent image names) More...
 
std::string x_GetImageName (int x, int y)
 Return image filename for a tile index based on the numbering scheme. More...
 

Protected Attributes

CPhyloTreePanem_Pane
 Pane display canvas for the tree we are saving. More...
 
CGlPane m_PreviousGlPane
 We change some rendering options. More...
 
CPhyloTreeScheme::TLabelTruncation m_LabelsTruncated
 
double m_MarginLeft
 
double m_MarginTop
 
double m_MarginRight
 
double m_MarginBottom
 
int m_TileViewportWidth
 Width and height of individual images being saved. More...
 
int m_TileViewportHeight
 
CVect2< float > m_ModelViewScaler
 Ratio scalers for the drawing area that maps to the images. More...
 
- Protected Attributes inherited from IImageGrabber
CVect2< intm_ImagePartitions
 Number of partitions (tilings) in x and 1. More...
 
std::string m_Directory
 Target directory for saved images. More...
 
std::string m_BaseImageName
 Image name without its appended number (e.g. img for img1, img2...) More...
 
std::string m_ImageFormat
 Image output format (e.g. jpeg, png...) More...
 
eImageNumberingFormat m_NumberingFormat
 Numbering format, such as sequential or tiled (x and y) More...
 
bool m_GuidesEnabled
 If true, printing guides (like where to cut paper) will be added to image edges. More...
 
int m_GuideWidthX
 If we are making space for printing guides (margins) on the sides, those margins may have different sizes (in x and y) if we are forcing a proportional output size. More...
 
int m_GuideWidthY
 
float m_TileAspectRatio
 Ratio of width to height (w/h) in captured images. More...
 
string m_OutputFormat
 Name of output format, e.g. A4, US Letter.. More...
 
float m_ImageAspectRatio
 Aspect ratio of image from which we are generating tiles. More...
 
bool m_DisableGouraudShaded
 If true, disable gouraud-shaded polys (shadingtype 4) More...
 
TModelUnit m_TitleHeight = TModelUnit(0)
 Allow space at the top for a title. More...
 
CIRef< IRenderm_SavedRender
 

Additional Inherited Members

- Public Types inherited from IImageGrabber
enum  eCaptureResult { eSuccess =0 , eOpenGLError , eFileError , eError }
 
enum  eImageNumberingFormat { eSequentialFormat , eCartesionFormat }
 
- Static Protected Attributes inherited from IImageGrabber
static const int m_GuideWidth = 24
 Width of printing guides, if enabled. More...
 

Detailed Description

Definition at line 62 of file phylo_image_grabber.hpp.

Constructor & Destructor Documentation

◆ CPhyloImageGrabber()

CPhyloImageGrabber::CPhyloImageGrabber ( CPhyloTreePane pane)

Definition at line 42 of file phylo_image_grabber.cpp.

References CPhyloTreePane::GetPane(), m_Pane, and m_PreviousGlPane.

◆ ~CPhyloImageGrabber()

virtual CPhyloImageGrabber::~CPhyloImageGrabber ( )
inlinevirtual

Definition at line 67 of file phylo_image_grabber.hpp.

Member Function Documentation

◆ x_BeginCaptures()

void CPhyloImageGrabber::x_BeginCaptures ( int  buffer_size)
protectedvirtual

◆ x_CaptureImage()

CPhyloImageGrabber::eCaptureResult CPhyloImageGrabber::x_CaptureImage ( CVect2< int partitions,
CVect2< int index,
CVect2< size_t > &  capture_size 
)
protectedvirtual

◆ x_EndCaptures()

void CPhyloImageGrabber::x_EndCaptures ( )
protectedvirtual

Member Data Documentation

◆ m_LabelsTruncated

CPhyloTreeScheme::TLabelTruncation CPhyloImageGrabber::m_LabelsTruncated
protected

Definition at line 85 of file phylo_image_grabber.hpp.

Referenced by x_BeginCaptures(), and x_EndCaptures().

◆ m_MarginBottom

double CPhyloImageGrabber::m_MarginBottom
protected

Definition at line 86 of file phylo_image_grabber.hpp.

Referenced by x_BeginCaptures(), and x_EndCaptures().

◆ m_MarginLeft

double CPhyloImageGrabber::m_MarginLeft
protected

Definition at line 86 of file phylo_image_grabber.hpp.

Referenced by x_BeginCaptures(), and x_EndCaptures().

◆ m_MarginRight

double CPhyloImageGrabber::m_MarginRight
protected

Definition at line 86 of file phylo_image_grabber.hpp.

Referenced by x_BeginCaptures(), and x_EndCaptures().

◆ m_MarginTop

double CPhyloImageGrabber::m_MarginTop
protected

Definition at line 86 of file phylo_image_grabber.hpp.

Referenced by x_BeginCaptures(), and x_EndCaptures().

◆ m_ModelViewScaler

CVect2<float> CPhyloImageGrabber::m_ModelViewScaler
protected

Ratio scalers for the drawing area that maps to the images.

These are both 1.0 unless we are forcing the individual images to a fixed proportion in which case the scale the underlying image extent accordingly.

Definition at line 96 of file phylo_image_grabber.hpp.

Referenced by x_BeginCaptures(), and x_CaptureImage().

◆ m_Pane

CPhyloTreePane& CPhyloImageGrabber::m_Pane
protected

Pane display canvas for the tree we are saving.

Definition at line 80 of file phylo_image_grabber.hpp.

Referenced by CPhyloImageGrabber(), x_BeginCaptures(), x_CaptureImage(), and x_EndCaptures().

◆ m_PreviousGlPane

CGlPane CPhyloImageGrabber::m_PreviousGlPane
protected

We change some rendering options.

These are the previous values used in m_Pane so we can set them back when were done.

Definition at line 84 of file phylo_image_grabber.hpp.

Referenced by CPhyloImageGrabber(), and x_EndCaptures().

◆ m_TileViewportHeight

int CPhyloImageGrabber::m_TileViewportHeight
protected

Definition at line 90 of file phylo_image_grabber.hpp.

Referenced by x_BeginCaptures(), and x_CaptureImage().

◆ m_TileViewportWidth

int CPhyloImageGrabber::m_TileViewportWidth
protected

Width and height of individual images being saved.

Definition at line 89 of file phylo_image_grabber.hpp.

Referenced by x_BeginCaptures(), and x_CaptureImage().


The documentation for this class was generated from the following files:
Modified on Fri Sep 20 14:58:33 2024 by modify_doxy.py rev. 669887