NCBI C++ ToolKit
|
Search Toolkit Book for CPhyloImageGrabber
#include <gui/widgets/phylo_tree/phylo_image_grabber.hpp>
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 | |
CPhyloTreePane & | m_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< int > | m_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< IRender > | m_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... | |
Definition at line 62 of file phylo_image_grabber.hpp.
CPhyloImageGrabber::CPhyloImageGrabber | ( | CPhyloTreePane & | pane | ) |
Definition at line 42 of file phylo_image_grabber.cpp.
References CPhyloTreePane::GetPane(), m_Pane, and m_PreviousGlPane.
|
inlinevirtual |
Definition at line 67 of file phylo_image_grabber.hpp.
|
protectedvirtual |
Called to setup values before image capturing starts.
Reimplemented from IImageGrabber.
Definition at line 50 of file phylo_image_grabber.cpp.
References CPhyloTreeScheme::eLabelsFull, CPhyloTreeScheme::eZoomXY, CPhyloTreePane::GetCurrRenderer(), IPhyloTreeRender::GetDescription(), CPhyloTreeScheme::GetLabelTruncation(), CPhyloTreeScheme::GetMargins(), CPhyloTreePane::GetPane(), IPhyloTreeRender::GetScheme(), CPhyloTreeScheme::GetZoomBehavior(), int, IImageGrabber::m_GuidesEnabled, IImageGrabber::m_GuideWidth, IImageGrabber::m_GuideWidthX, IImageGrabber::m_GuideWidthY, IImageGrabber::m_ImageAspectRatio, IImageGrabber::m_ImagePartitions, m_LabelsTruncated, m_MarginBottom, m_MarginLeft, m_MarginRight, m_MarginTop, m_ModelViewScaler, m_Pane, IImageGrabber::m_TileAspectRatio, m_TileViewportHeight, m_TileViewportWidth, CPhyloTreeScheme::SetLabelTruncation(), CPhyloTreeScheme::SetMargins(), CPhyloTreePane::SetupHardcopyRender(), CGlPane::SetViewport(), CVect2< T >::X(), and CVect2< T >::Y().
|
protectedvirtual |
Capture the image at tile position 'index'.
Reimplemented from IImageGrabber.
Definition at line 192 of file phylo_image_grabber.cpp.
References b, IImageGrabber::eSuccess, CPhyloTreePane::GetCurrRenderer(), CGlPane::GetModelLimitsRect(), CPhyloTreePane::GetPane(), IPhyloTreeRender::GetRenderScale(), CGlRect< T >::Height(), CGlRect< T >::Init(), CGlRect< T >::Left(), IImageGrabber::m_GuideWidthX, IImageGrabber::m_GuideWidthY, m_ModelViewScaler, m_Pane, m_TileViewportHeight, m_TileViewportWidth, CPhyloTreePane::RenderHardcopy(), IPhyloTreeRender::SetRenderScale(), CGlPane::SetViewport(), CGlPane::SetVisibleRect(), CGlRect< T >::Top(), CGlRect< T >::Width(), CVect2< T >::X(), and CVect2< T >::Y().
|
protectedvirtual |
Called to restore values (in pane) when capturing stops.
Reimplemented from IImageGrabber.
Definition at line 181 of file phylo_image_grabber.cpp.
References CPhyloTreePane::GetCurrRenderer(), CPhyloTreePane::GetPane(), IPhyloTreeRender::GetScheme(), m_LabelsTruncated, m_MarginBottom, m_MarginLeft, m_MarginRight, m_MarginTop, m_Pane, m_PreviousGlPane, CPhyloTreeScheme::SetLabelTruncation(), and CPhyloTreeScheme::SetMargins().
|
protected |
Definition at line 85 of file phylo_image_grabber.hpp.
Referenced by x_BeginCaptures(), and x_EndCaptures().
|
protected |
Definition at line 86 of file phylo_image_grabber.hpp.
Referenced by x_BeginCaptures(), and x_EndCaptures().
|
protected |
Definition at line 86 of file phylo_image_grabber.hpp.
Referenced by x_BeginCaptures(), and x_EndCaptures().
|
protected |
Definition at line 86 of file phylo_image_grabber.hpp.
Referenced by x_BeginCaptures(), and x_EndCaptures().
|
protected |
Definition at line 86 of file phylo_image_grabber.hpp.
Referenced by x_BeginCaptures(), and x_EndCaptures().
|
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().
|
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().
|
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().
|
protected |
Definition at line 90 of file phylo_image_grabber.hpp.
Referenced by x_BeginCaptures(), and x_CaptureImage().
|
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().