00001 /* === S Y N F I G ========================================================= */ 00021 /* ========================================================================= */ 00022 00023 /* === S T A R T =========================================================== */ 00024 00025 #ifndef __SYNFIG_TARGET_NULL_H 00026 #define __SYNFIG_TARGET_NULL_H 00027 00028 /* === H E A D E R S ======================================================= */ 00029 00030 #include "target_scanline.h" 00031 #include "general.h" 00032 00033 /* === M A C R O S ========================================================= */ 00034 00035 /* === T Y P E D E F S ===================================================== */ 00036 00037 /* === C L A S S E S & S T R U C T S ======================================= */ 00038 00039 namespace synfig { 00040 00045 class Target_Null : public Target_Scanline 00046 { 00047 Color *buffer; 00048 00049 Target_Null():buffer(0) { } 00050 00051 public: 00052 00053 ~Target_Null() { delete buffer; } 00054 00055 virtual bool start_frame(ProgressCallback *cb=NULL) 00056 { delete buffer; buffer=new Color[desc.get_w()*sizeof(Color)]; return true; } 00057 00058 virtual void end_frame() { delete buffer; buffer=0; return; } 00059 00060 virtual Color * start_scanline(int scanline) { return buffer; } 00061 00062 virtual bool end_scanline() { return true; } 00063 00064 static Target* create(const char *filename=0) { return new Target_Null(); } 00065 }; // END of class Target_Null 00066 00067 }; // END of namespace synfig 00068 00069 /* === E N D =============================================================== */ 00070 00071 #endif