2007-04-17 08:49:19 +00:00
|
|
|
// This code is in the public domain -- castanyo@yahoo.es
|
|
|
|
|
|
|
|
#ifndef NV_IMAGE_IMAGEIO_H
|
|
|
|
#define NV_IMAGE_IMAGEIO_H
|
|
|
|
|
|
|
|
#include <nvimage/nvimage.h>
|
|
|
|
|
|
|
|
namespace nv
|
|
|
|
{
|
|
|
|
class Image;
|
|
|
|
class FloatImage;
|
|
|
|
class Stream;
|
|
|
|
|
|
|
|
namespace ImageIO
|
|
|
|
{
|
2007-10-16 20:53:12 +00:00
|
|
|
NVIMAGE_API Image * load(const char * fileName);
|
|
|
|
NVIMAGE_API Image * load(const char * fileName, Stream & s);
|
2007-12-03 09:14:19 +00:00
|
|
|
|
2007-10-16 20:53:12 +00:00
|
|
|
NVIMAGE_API FloatImage * loadFloat(const char * fileName);
|
|
|
|
NVIMAGE_API FloatImage * loadFloat(const char * fileName, Stream & s);
|
2007-04-17 08:49:19 +00:00
|
|
|
|
2008-11-21 07:57:28 +00:00
|
|
|
NVIMAGE_API bool save(const char * fileName, Stream & s, const Image * img);
|
|
|
|
NVIMAGE_API bool save(const char * fileName, const Image * img);
|
2007-12-03 09:14:19 +00:00
|
|
|
NVIMAGE_API bool saveFloat(const char * fileName, const FloatImage * fimage, uint base_component, uint num_components);
|
|
|
|
|
2007-04-17 08:49:19 +00:00
|
|
|
NVIMAGE_API Image * loadTGA(Stream & s);
|
|
|
|
NVIMAGE_API bool saveTGA(Stream & s, const Image * img);
|
|
|
|
|
2007-07-02 07:27:23 +00:00
|
|
|
NVIMAGE_API Image * loadPSD(Stream & s);
|
|
|
|
|
2007-04-17 08:49:19 +00:00
|
|
|
#if defined(HAVE_PNG)
|
|
|
|
NVIMAGE_API Image * loadPNG(Stream & s);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(HAVE_JPEG)
|
|
|
|
NVIMAGE_API Image * loadJPG(Stream & s);
|
|
|
|
#endif
|
2007-10-16 20:53:12 +00:00
|
|
|
|
2007-04-17 08:49:19 +00:00
|
|
|
#if defined(HAVE_TIFF)
|
2007-10-16 20:53:12 +00:00
|
|
|
NVIMAGE_API FloatImage * loadFloatTIFF(const char * fileName, Stream & s);
|
|
|
|
|
2007-11-01 05:35:33 +00:00
|
|
|
NVIMAGE_API bool saveFloatTIFF(const char * fileName, const FloatImage * fimage, uint base_component, uint num_components);
|
2007-10-16 20:53:12 +00:00
|
|
|
#endif
|
2007-04-17 08:49:19 +00:00
|
|
|
|
2007-12-03 09:14:19 +00:00
|
|
|
#if defined(HAVE_OPENEXR)
|
2007-11-01 05:35:33 +00:00
|
|
|
NVIMAGE_API FloatImage * loadFloatEXR(const char * fileName, Stream & s);
|
|
|
|
|
|
|
|
NVIMAGE_API bool saveFloatEXR(const char * fileName, const FloatImage * fimage, uint base_component, uint num_components);
|
2007-04-17 08:49:19 +00:00
|
|
|
#endif
|
2008-04-17 06:59:13 +00:00
|
|
|
/*
|
|
|
|
NVIMAGE_API FloatImage * loadFloatPFM(const char * fileName, Stream & s);
|
|
|
|
NVIMAGE_API bool saveFloatPFM(const char * fileName, const FloatImage * fimage, uint base_component, uint num_components);
|
2007-04-17 08:49:19 +00:00
|
|
|
|
2008-04-17 06:59:13 +00:00
|
|
|
// GridFloat is a simple, open format for terrain elevation data. See http://ned.usgs.gov/Ned/faq.asp.
|
|
|
|
// Expects: 1) fileName will be an ".hdr" header file, 2) there will also exist a corresponding float data
|
|
|
|
// blob in a ".flt" file. (This is what USGS gives you.)
|
|
|
|
NVIMAGE_API FloatImage * loadGridFloat(const char * fileName, Stream & s);
|
|
|
|
*/
|
2007-04-17 08:49:19 +00:00
|
|
|
} // ImageIO namespace
|
|
|
|
|
|
|
|
} // nv namespace
|
|
|
|
|
|
|
|
|
|
|
|
#endif // NV_IMAGE_IMAGEIO_H
|