X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fmodules%2Fmod_jpeg%2Ftrgt_jpeg.cpp;h=fc6557efb987473360f52e54f35ef1189f3f674e;hb=b5318fd86e61cb9065346a5b959809636ffe5dce;hp=d3fffa426e8b851ca10572d7b7526fdbb06bcee9;hpb=28f28705612902c15cd0702cc891fba35bf2d2df;p=synfig.git diff --git a/synfig-core/trunk/src/modules/mod_jpeg/trgt_jpeg.cpp b/synfig-core/trunk/src/modules/mod_jpeg/trgt_jpeg.cpp index d3fffa4..fc6557e 100644 --- a/synfig-core/trunk/src/modules/mod_jpeg/trgt_jpeg.cpp +++ b/synfig-core/trunk/src/modules/mod_jpeg/trgt_jpeg.cpp @@ -1,18 +1,22 @@ -/*! ======================================================================== -** Synfig -** jpeg_trgt Target Module -** $Id: trgt_jpeg.cpp,v 1.1.1.1 2005/01/04 01:23:11 darco Exp $ +/* === S Y N F I G ========================================================= */ +/*! \file trgt_jpeg.cpp +** \brief jpeg_trgt Target Module ** -** Copyright (c) 2002 Robert B. Quattlebaum Jr. +** $Id$ ** -** This software and associated documentation -** are CONFIDENTIAL and PROPRIETARY property of -** the above-mentioned copyright holder. +** \legal +** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley ** -** You may not copy, print, publish, or in any -** other way distribute this software without -** a prior written agreement with -** the copyright holder. +** This package is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License as +** published by the Free Software Foundation; either version 2 of +** the License, or (at your option) any later version. +** +** This package is distributed in the hope that it will be useful, +** 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 =========================================================== ** @@ -49,7 +53,7 @@ SYNFIG_TARGET_INIT(jpeg_trgt); SYNFIG_TARGET_SET_NAME(jpeg_trgt,"jpeg"); SYNFIG_TARGET_SET_EXT(jpeg_trgt,"jpg"); SYNFIG_TARGET_SET_VERSION(jpeg_trgt,"0.1"); -SYNFIG_TARGET_SET_CVS_ID(jpeg_trgt,"$Id: trgt_jpeg.cpp,v 1.1.1.1 2005/01/04 01:23:11 darco Exp $"); +SYNFIG_TARGET_SET_CVS_ID(jpeg_trgt,"$Id$"); /* === M E T H O D S ======================================================= */ @@ -60,7 +64,7 @@ jpeg_trgt::jpeg_trgt(const char *Filename) buffer=NULL; ready=false; quality=95; - color_buffer=0; + color_buffer=0; set_remove_alpha(); } @@ -95,7 +99,7 @@ bool jpeg_trgt::start_frame(synfig::ProgressCallback *callback) { int w=desc.get_w(),h=desc.get_h(); - + if(file && file!=stdout) fclose(file); if(filename=="-") @@ -109,7 +113,7 @@ jpeg_trgt::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=fopen(newfilename.c_str(),"wb"); if(callback)callback->task(newfilename); @@ -119,13 +123,13 @@ jpeg_trgt::start_frame(synfig::ProgressCallback *callback) file=fopen(filename.c_str(),"wb"); if(callback)callback->task(filename); } - + if(!file) return false; - + delete [] buffer; buffer=new unsigned char[3*w]; - + delete [] color_buffer; color_buffer=new Color[w]; @@ -147,14 +151,14 @@ jpeg_trgt::start_frame(synfig::ProgressCallback *callback) * Here we just illustrate the use of quality (quantization table) scaling: */ jpeg_set_quality(&cinfo, quality, TRUE /* limit to baseline-JPEG values */); - + /* Step 4: Start compressor */ - + /* TRUE ensures that we will write a complete interchange-JPEG file. * Pass TRUE unless you are very sure of what you're doing. */ jpeg_start_compress(&cinfo, TRUE); - + ready=true; return true; } @@ -176,7 +180,7 @@ jpeg_trgt::end_frame() } Color * -jpeg_trgt::start_scanline(int scanline) +jpeg_trgt::start_scanline(int /*scanline*/) { return color_buffer; }