/* -*- C++ -*- * Copyright ©2004 Hugo Mills * * This software is distributed under the terms of the GNU GPL v3 * For more information on the GPL, see the file COPYING or * visit http://www.gnu.org/ * * This software is distributed without warranty */ #ifndef CONTENT_BITMAP_H #define CONTENT_BITMAP_H #include "magellan/content.h" #include "config.h" #ifdef HAVE_PAINTLIB #include #include #else #ifdef HAVE_LIBJPEG #include #else #error Paintlib or libjpeg required to build this plugin #endif #endif class Content_Bitmap : public Content { public: Content_Bitmap( std::string fn, std::string fmt, bool sm ); virtual ~Content_Bitmap();// { } virtual void plot( Output* bm, XfView* vp, XfMap* proj, XfOrbit* orb, XfSphere* sph ); static Content* parse( ConfigLexer* lex, const std::string& type, const std::string& subtype = "" ); private: std::string filename; std::string format; bool smooth; #ifdef HAVE_PAINTLIB PLAnyBmp source_bitmap; // Assuming a 32 bpp bitmap. PLPixel32** pixlines; #else #ifdef HAVE_LIBJPEG int bpp; // Bytes-per-pixel, not bits JSAMPARRAY bitmap_data; #else #endif #endif int wid, hgt; double xconv, yconv; void getpixel(ivec3&, const dvec2&) const; void blend(ivec3&, const ivec3&, const ivec3&, const ivec3&, const ivec3&, double, double) const; }; #endif