Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

PNGBitmap.h

Go to the documentation of this file.
00001 // This file is part of dvi2bitmap. 00002 // Copyright 1999--2002, Council for the Central Laboratory of the Research Councils 00003 // 00004 // This program is part of the Starlink Software Distribution: see 00005 // http://www.starlink.ac.uk 00006 // 00007 // dvi2bitmap is free software; you can redistribute it and/or modify 00008 // it under the terms of the GNU General Public License as published by 00009 // the Free Software Foundation; either version 2 of the License, or 00010 // (at your option) any later version. 00011 // 00012 // dvi2bitmap is distributed in the hope that it will be useful, 00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 // GNU General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU General Public License 00018 // along with dvi2bitmap; if not, write to the Free Software 00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 // 00021 // The General Public License is distributed along with this 00022 // program in the file LICENCE. 00023 // 00024 // Author: Norman Gray <norman@astro.gla.ac.uk> 00025 // $Id: PNGBitmap.h,v 1.11 2003/02/17 16:11:29 norman Exp $ 00026 00027 00028 #ifndef PNGBITMAP_HEADER_READ 00029 #define PNGBITMAP_HEADER_READ 1 00030 00031 #include "BitmapImage.h" 00032 #ifdef HAVE_CSTD_INCLUDE 00033 #include <cstdio> 00034 #else 00035 #include <stdio.h> 00036 #endif 00037 00038 #include <png.h> 00039 00040 class PNGBitmap : public BitmapImage { 00041 public: 00042 PNGBitmap (const int w, const int h, const int bpp=1); 00043 ~PNGBitmap (); 00044 void write (const string filename); 00045 string fileExtension () const { return "png"; } 00046 static const char *version_string (void) { return PNG_LIBPNG_VER_STRING; }; 00047 00048 private: 00049 static png_structp png_ptr_; 00050 static png_infop info_ptr_; 00051 static png_color* palettes_[]; 00052 static png_byte* trans_[]; 00053 static void png_error_fn (png_structp png_ptr, 00054 png_const_charp error_msg); 00055 static void png_warning_fn (png_structp png_ptr, 00056 png_const_charp warning_msg); 00057 }; 00058 00059 00060 #endif /* #ifndef PNGBITMAP_HEADER_READ */

Generated on Sun Aug 21 18:21:02 2005 for dvi2bitmap by doxygen 1.3.8