NCBI C++ ToolKit
Classes | Macros | Functions | Variables
cn3d_png.cpp File Reference
#include <ncbi_pch.hpp>
#include <corelib/ncbistd.hpp>
#include <corelib/ncbi_limits.h>
#include <png.h>
#include <zlib.h>
#include "remove_header_conflicts.hpp"
#include <wx/platform.h>
#include "cn3d_png.hpp"
#include "cn3d_glcanvas.hpp"
#include "opengl_renderer.hpp"
#include "progress_meter.hpp"
#include "cn3d_tools.hpp"
#include "messenger.hpp"
#include <wx/image.h>
#include <wx/statline.h>
#include <wx/spinbutt.h>
#include <wx/spinctrl.h>
#include <wx/splitter.h>
#include <wx/listctrl.h>
#include <wx/treectrl.h>
#include <wx/notebook.h>
#include <wx/grid.h>
+ Include dependency graph for cn3d_png.cpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

class  PNGOptionsDialog
 

Macros

#define ID_TEXT   10000
 
#define ID_B_BROWSE   10001
 
#define ID_T_NAME   10002
 
#define ID_T_WIDTH   10003
 
#define ID_T_HEIGHT   10004
 
#define ID_C_ASPECT   10005
 
#define ID_C_INTERLACE   10006
 
#define ID_B_OK   10007
 
#define ID_B_CANCEL   10008
 
#define DECLARE_AND_FIND_WINDOW_RETURN_ON_ERR(var, id, type)
 
#define DECLARE_AND_FIND_WINDOW_RETURN_RESULT_ON_ERR(var, id, type, errResult)
 
#define GET_AND_IS_VALID_SIZE(textctrl, var)    (textctrl->GetValue().ToDouble(&var) && var >= 1 && fmod(var, 1.0) == 0.0 && var <= kMax_Int)
 

Functions

wxSizer * SetupPNGOptionsDialog (wxPanel *parent, bool call_fit=TRUE, bool set_sizer=TRUE)
 
static bool GetOutputParameters (wxString *outputFilename, int *width, int *height, bool *interlaced)
 
static void writepng_error_handler (png_structp png_ptr, png_const_charp msg)
 
static void write_row_callback (png_structp png_ptr, png_uint_32 row, int pass)
 
bool ExportPNG (Cn3DGLCanvas *glCanvas, OpenGLRenderer *renderer, const string &outputFilename, int outputWidth, int outputHeight, bool interlaced)
 

Variables

 USING_NCBI_SCOPE
 
static ProgressMeterprogressMeter = NULL
 
static const int PROGRESS_RESOLUTION = 100
 
static const int MAX_BUFFER_PIXELS = 1000000
 
static int nRows
 
const wxWindowID ButtonID = wxID_HIGHEST + 1
 

Macro Definition Documentation

◆ DECLARE_AND_FIND_WINDOW_RETURN_ON_ERR

#define DECLARE_AND_FIND_WINDOW_RETURN_ON_ERR (   var,
  id,
  type 
)
Value:
type *var; \
var = wxDynamicCast(FindWindow(id), type); \
if (!var) { \
ERRORMSG("Can't find window with id " << id); \
return; \
}
Definition: type.c:6

Definition at line 138 of file cn3d_png.cpp.

◆ DECLARE_AND_FIND_WINDOW_RETURN_RESULT_ON_ERR

#define DECLARE_AND_FIND_WINDOW_RETURN_RESULT_ON_ERR (   var,
  id,
  type,
  errResult 
)
Value:
type *var; \
var = wxDynamicCast(FindWindow(id), type); \
if (!var) { \
ERRORMSG("Can't find window with id " << id); \
return errResult; \
}

Definition at line 146 of file cn3d_png.cpp.

◆ GET_AND_IS_VALID_SIZE

#define GET_AND_IS_VALID_SIZE (   textctrl,
  var 
)     (textctrl->GetValue().ToDouble(&var) && var >= 1 && fmod(var, 1.0) == 0.0 && var <= kMax_Int)

Definition at line 156 of file cn3d_png.cpp.

◆ ID_B_BROWSE

#define ID_B_BROWSE   10001

Definition at line 91 of file cn3d_png.cpp.

◆ ID_B_CANCEL

#define ID_B_CANCEL   10008

Definition at line 98 of file cn3d_png.cpp.

◆ ID_B_OK

#define ID_B_OK   10007

Definition at line 97 of file cn3d_png.cpp.

◆ ID_C_ASPECT

#define ID_C_ASPECT   10005

Definition at line 95 of file cn3d_png.cpp.

◆ ID_C_INTERLACE

#define ID_C_INTERLACE   10006

Definition at line 96 of file cn3d_png.cpp.

◆ ID_T_HEIGHT

#define ID_T_HEIGHT   10004

Definition at line 94 of file cn3d_png.cpp.

◆ ID_T_NAME

#define ID_T_NAME   10002

Definition at line 92 of file cn3d_png.cpp.

◆ ID_T_WIDTH

#define ID_T_WIDTH   10003

Definition at line 93 of file cn3d_png.cpp.

◆ ID_TEXT

#define ID_TEXT   10000

Definition at line 90 of file cn3d_png.cpp.

Function Documentation

◆ ExportPNG()

bool ExportPNG ( Cn3DGLCanvas glCanvas,
OpenGLRenderer renderer,
const string outputFilename,
int  outputWidth,
int  outputHeight,
bool  interlaced 
)

◆ GetOutputParameters()

static bool GetOutputParameters ( wxString *  outputFilename,
int width,
int height,
bool interlaced 
)
static

Definition at line 342 of file cn3d_png.cpp.

References PNGOptionsDialog::Activate(), PNGOptionsDialog::GetValues(), NULL, and ok.

Referenced by ExportPNG().

◆ SetupPNGOptionsDialog()

wxSizer * SetupPNGOptionsDialog ( wxPanel *  parent,
bool  call_fit = TRUE,
bool  set_sizer = TRUE 
)

◆ write_row_callback()

static void write_row_callback ( png_structp  png_ptr,
png_uint_32  row,
int  pass 
)
static

Definition at line 366 of file cn3d_png.cpp.

References int, nRows, PROGRESS_RESOLUTION, progressMeter, row, and ProgressMeter::SetValue().

Referenced by ExportPNG().

◆ writepng_error_handler()

static void writepng_error_handler ( png_structp  png_ptr,
png_const_charp  msg 
)
static

Definition at line 351 of file cn3d_png.cpp.

References ERRORMSG.

Referenced by ExportPNG().

Variable Documentation

◆ ButtonID

const wxWindowID ButtonID = wxID_HIGHEST + 1

Definition at line 159 of file cn3d_png.cpp.

◆ MAX_BUFFER_PIXELS

const int MAX_BUFFER_PIXELS = 1000000
static

◆ nRows

int nRows
static

◆ PROGRESS_RESOLUTION

const int PROGRESS_RESOLUTION = 100
static

Definition at line 114 of file cn3d_png.cpp.

Referenced by ExportPNG(), and write_row_callback().

◆ progressMeter

ProgressMeter* progressMeter = NULL
static

Definition at line 113 of file cn3d_png.cpp.

Referenced by ExportPNG(), and write_row_callback().

◆ USING_NCBI_SCOPE

USING_NCBI_SCOPE

Definition at line 108 of file cn3d_png.cpp.

Modified on Sat May 25 14:16:01 2024 by modify_doxy.py rev. 669887