diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /dviware/dvi2bitmap/PNGBitmap.h |
Initial commit
Diffstat (limited to 'dviware/dvi2bitmap/PNGBitmap.h')
-rw-r--r-- | dviware/dvi2bitmap/PNGBitmap.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/dviware/dvi2bitmap/PNGBitmap.h b/dviware/dvi2bitmap/PNGBitmap.h new file mode 100644 index 0000000000..486999ef0b --- /dev/null +++ b/dviware/dvi2bitmap/PNGBitmap.h @@ -0,0 +1,35 @@ +/* This file is part of dvi2bitmap; see README for copyrights and licence */ + +#ifndef PNGBITMAP_HEADER_READ +#define PNGBITMAP_HEADER_READ 1 + +#include "BitmapImage.h" +#ifdef HAVE_CSTD_INCLUDE +#include <cstdio> +#else +#include <stdio.h> +#endif + +#include <png.h> + +class PNGBitmap : public BitmapImage { + public: + PNGBitmap (const int w, const int h, const int bpp=1); + ~PNGBitmap (); + void write (const string filename); + string fileExtension () const { return "png"; } + static const char *version_string (void) { return PNG_LIBPNG_VER_STRING; }; + + private: + static png_structp png_ptr_; + static png_infop info_ptr_; + static png_color* palettes_[]; + static png_byte* trans_[]; + static void png_error_fn (png_structp png_ptr, + png_const_charp error_msg); + static void png_warning_fn (png_structp png_ptr, + png_const_charp warning_msg); +}; + + +#endif /* #ifndef PNGBITMAP_HEADER_READ */ |