X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fmodules%2Fmod_ppm%2Ftrgt_ppm.cpp;h=502c60e7e5b1f1cc85036839ca71bf5f40655f88;hb=c3ad95144d148602f672e95ddda1f18fc35502f8;hp=c3495852a650d19ac1c3b62946f0b993a4a61161;hpb=21bfc670b83d4c45da9ed1b95063b7e6a007168c;p=synfig.git diff --git a/synfig-core/trunk/src/modules/mod_ppm/trgt_ppm.cpp b/synfig-core/trunk/src/modules/mod_ppm/trgt_ppm.cpp index c349585..502c60e 100644 --- a/synfig-core/trunk/src/modules/mod_ppm/trgt_ppm.cpp +++ b/synfig-core/trunk/src/modules/mod_ppm/trgt_ppm.cpp @@ -1,8 +1,10 @@ -/*! ======================================================================== -** Synfig -** ppm Target Module -** $Id: trgt_ppm.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $ +/* === S Y N F I G ========================================================= */ +/*! \file trgt_ppm.cpp +** \brief ppm Target Module ** +** $Id$ +** +** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley ** ** This package is free software; you can redistribute it and/or @@ -14,6 +16,7 @@ ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** General Public License for more details. +** \endlegal ** ** === N O T E S =========================================================== ** @@ -31,7 +34,6 @@ #endif #include "trgt_ppm.h" -#include #include #include #include @@ -50,7 +52,7 @@ SYNFIG_TARGET_INIT(ppm); SYNFIG_TARGET_SET_NAME(ppm,"ppm"); SYNFIG_TARGET_SET_EXT(ppm,"ppm"); SYNFIG_TARGET_SET_VERSION(ppm,"0.1"); -SYNFIG_TARGET_SET_CVS_ID(ppm,"$Id: trgt_ppm.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $"); +SYNFIG_TARGET_SET_CVS_ID(ppm,"$Id$"); /* === M E T H O D S ======================================================= */ @@ -92,7 +94,7 @@ bool ppm::start_frame(synfig::ProgressCallback *callback) { int w=desc.get_w(),h=desc.get_h(); - + if(filename=="-") { if(callback)callback->task(strprintf("(stdout) %d",imagecount).c_str()); @@ -104,7 +106,7 @@ ppm::start_frame(synfig::ProgressCallback *callback) newfilename(filename), ext(find(filename.begin(),filename.end(),'.'),filename.end()); newfilename.erase(find(newfilename.begin(),newfilename.end(),'.'),newfilename.end()); - + newfilename+=etl::strprintf("%04d",imagecount)+ext; file=SmartFILE(fopen(newfilename.c_str(),"wb")); if(callback)callback->task(newfilename); @@ -114,25 +116,25 @@ ppm::start_frame(synfig::ProgressCallback *callback) file=SmartFILE(fopen(filename.c_str(),"wb")); if(callback)callback->task(filename); } - + if(!file) return false; - + fprintf(file.get(), "P6\n"); fprintf(file.get(), "%d %d\n", w, h); - fprintf(file.get(), "%d\n", 255); - + fprintf(file.get(), "%d\n", 255); + delete [] buffer; buffer=new unsigned char[3*w]; delete [] color_buffer; color_buffer=new Color[desc.get_w()]; - + return true; } Color * -ppm::start_scanline(int scanline) +ppm::start_scanline(int /*scanline*/) { return color_buffer; } @@ -144,7 +146,7 @@ ppm::end_scanline() return false; convert_color_format(buffer, color_buffer, desc.get_w(), PF_RGB, gamma()); - + if(!fwrite(buffer,1,desc.get_w()*3,file.get())) return false;