00001 /* === S Y N F I G ========================================================= */ 00025 /* === S T A R T =========================================================== */ 00026 00027 #ifndef __SYNFIG_TRGT_PNG_H 00028 #define __SYNFIG_TRGT_PNG_H 00029 00030 /* === H E A D E R S ======================================================= */ 00031 00032 #include <synfig/target_scanline.h> 00033 #include <synfig/string.h> 00034 #include <cstdio> 00035 #include <png.h> 00036 00037 /* === M A C R O S ========================================================= */ 00038 00039 /* === T Y P E D E F S ===================================================== */ 00040 00041 /* === C L A S S E S & S T R U C T S ======================================= */ 00042 00043 class png_trgt : public synfig::Target_Scanline 00044 { 00045 SYNFIG_TARGET_MODULE_EXT 00046 private: 00047 FILE *file; 00048 int w,h; 00049 png_structp png_ptr; 00050 png_infop info_ptr; 00051 00052 static void png_out_error(png_struct *png,const char *msg); 00053 static void png_out_warning(png_struct *png,const char *msg); 00054 bool multi_image,ready; 00055 int imagecount; 00056 synfig::String filename; 00057 unsigned char *buffer; 00058 synfig::Color *color_buffer; 00059 public: 00060 png_trgt(const char *filename); 00061 virtual ~png_trgt(); 00062 00063 virtual bool set_rend_desc(synfig::RendDesc *desc); 00064 virtual bool start_frame(synfig::ProgressCallback *cb); 00065 virtual void end_frame(); 00066 00067 virtual synfig::Color * start_scanline(int scanline); 00068 virtual bool end_scanline(); 00069 }; 00070 00071 /* === E N D =============================================================== */ 00072 00073 #endif