PNGProgressBar Class Reference

Controls the status bar while loading / saving png files. More...

#include <pngprgrs.h>

List of all members.

Public Member Functions

 CC_DECLARE_MEMDUMP (PNGProgressBar)
 PNGProgressBar (String_64 *ProgressString, bool new_interlaced, UINT32 new_height)
 Constructor. Sets show_progress_bar. If ProgressString != NULL, starts prorgress bar. Scope: Public.
 ~PNGProgressBar ()
 Constructor. Sets show_progress_bar. If ProgressString != NULL, starts prorgress bar. Scope: Public.
void UpdateCallback (png_structp png_ptr, png_uint_32 row_number, INT32 pass)

Protected Member Functions

 PNGProgressBar ()

Private Attributes

bool show_progress_bar
bool interlaced
UINT32 height
INT32 next_update


Detailed Description

Controls the status bar while loading / saving png files.

Author:
Jonathan_Payne (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/8/2000

Definition at line 116 of file pngprgrs.h.


Constructor & Destructor Documentation

PNGProgressBar::PNGProgressBar String_64 ProgressString,
bool  new_interlaced,
UINT32  new_height
 

Constructor. Sets show_progress_bar. If ProgressString != NULL, starts prorgress bar. Scope: Public.

Author:
Jonathan_Payne (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/8/2000
Parameters:
ProgressString [INPUTS]
Progress bar on screen [OUTPUTS]
Returns:
void

Definition at line 125 of file pngprgrs.cpp.

00126 {
00127     interlaced = new_interlaced;
00128     height = new_height;
00129 
00130     if (ProgressString != NULL)
00131     {
00132         show_progress_bar = true;
00133         if (interlaced)
00134         // An interlaced image
00135         {
00136             // PNG interlaced files always have 7 passes so use 7 as
00137             // final value for status bar
00138             BeginSlowJob(8, FALSE, ProgressString);
00139 
00140             // Next update the status bar at pass 0
00141             next_update = 0;
00142         }
00143         else
00144         // A non-interlaced image
00145         {
00146             BeginSlowJob(height, FALSE, ProgressString);
00147             
00148             // Update the status bar on row 0
00149             next_update = 0;
00150         }
00151     }
00152     else
00153     {
00154         show_progress_bar = false;
00155     }
00156 }

PNGProgressBar::~PNGProgressBar  ) 
 

Constructor. Sets show_progress_bar. If ProgressString != NULL, starts prorgress bar. Scope: Public.

Author:
Jonathan_Payne (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/8/2000
Parameters:
Removes progress bar from screen [OUTPUTS]
Returns:
void

Definition at line 172 of file pngprgrs.cpp.

00173 {
00174     // If started, then stop then progress bar
00175     if (show_progress_bar)
00176         EndSlowJob();
00177 }

PNGProgressBar::PNGProgressBar  )  [protected]
 


Member Function Documentation

PNGProgressBar::CC_DECLARE_MEMDUMP PNGProgressBar   ) 
 

void PNGProgressBar::UpdateCallback png_structp  png_ptr,
png_uint_32  row_number,
INT32  pass
 

Definition at line 179 of file pngprgrs.cpp.

00180 {
00181     if (show_progress_bar)
00182     {
00183         if (interlaced)
00184         // Interlaced image
00185         {
00186             if (pass + 1 >= next_update)
00187                 ContinueSlowJob(pass + 1);
00188         }
00189         else
00190         // Non-interlaced image
00191         {
00192             if ((INT32)row_number >= next_update)
00193                 ContinueSlowJob(row_number);
00194         }
00195     }
00196 }


Member Data Documentation

UINT32 PNGProgressBar::height [private]
 

Definition at line 137 of file pngprgrs.h.

bool PNGProgressBar::interlaced [private]
 

Definition at line 136 of file pngprgrs.h.

INT32 PNGProgressBar::next_update [private]
 

Definition at line 138 of file pngprgrs.h.

bool PNGProgressBar::show_progress_bar [private]
 

Definition at line 135 of file pngprgrs.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:59:50 2007 for Camelot by  doxygen 1.4.4