#include #include #include #include #include #include /**************************************************************************** * * Follows is code extracted from the simage library. Original Authors: * * Systems in Motion, * * * Peder Blekken * Morten Eriksen * Marius Bugge Monsen * * The original COPYING notice * * All files in this library are public domain, except simage_rgb.cpp which is * Copyright (c) Mark J Kilgard . I will contact Mark * very soon to hear if this source also can become public domain. * * Please send patches for bugs and new features to: . * * Peder Blekken * * * Ported into the OSG as a plugin, Robert Osfield Decemeber 2000. * Note, reference above to license of simage_rgb is not relevent to the OSG * as the OSG does not use it. Also for patches, bugs and new features * please send them direct to the OSG dev team rather than address above. * **********************************************************************/ /* * Based on example code found in the libjpeg archive * */ using namespace osg; extern "C" { #include } #define ERR_NO_ERROR 0 #define ERR_OPEN 1 #define ERR_MEM 2 #define ERR_PNGLIB 3 static int pngerror = ERR_NO_ERROR; /* my setjmp buffer */ static jmp_buf setjmp_buffer; /* called my libpng */ static void warn_callback(png_structp /*ps*/, png_const_charp pc) { /*FIXME: notify? */ osg::notify(osg::WARN)<<"Warning in .png reader: "; if (pc) osg::notify(osg::WARN)<< pc; osg::notify(osg::WARN)<setFileName(fileName.c_str()); pOsgImage->setImage(s,t,r, internalFormat, pixelFormat, dataType, imageData); return pOsgImage; } }; // now register with Registry to instantiate the above // reader/writer. osgDB::RegisterReaderWriterProxy g_readerWriter_PNG_Proxy;