/* osgEarth
* Copyright 2008-2012 Pelican Mapping
* MIT License
*/
#ifndef OSGEARTH_PROCEDURAL_SPLATTING_MATERIALS_H
#define OSGEARTH_PROCEDURAL_SPLATTING_MATERIALS_H

#include <osgEarthProcedural/Export>
#include <osgEarth/TextureArena>
#include <osgDB/ReaderWriter>

namespace osgEarth { namespace Procedural
{
    /**
     * Loader for RGBH data (raw or compressed)
     */
    class OSGEARTHPROCEDURAL_EXPORT RGBH_Loader : public osgDB::ReaderWriter
    {
    public:
        RGBH_Loader();
        ReadResult readImage(const std::string&, const osgDB::Options*) const override;
        WriteResult writeImage(const osg::Image&, const std::string&, const osgDB::Options*) const override;

        ReadResult readImageFromSourceData(const std::string&, const osgDB::Options*) const;
        ReadResult readImageEncoded(const std::string&, const osgDB::Options*) const;
    };

    /**
     * Loader for NNRA data (raw or compressed)
     */
    class OSGEARTHPROCEDURAL_EXPORT NNRA_Loader : public osgDB::ReaderWriter
    {
    public:
        NNRA_Loader();
        ReadResult readImage(const std::string&, const osgDB::Options*) const override;
        WriteResult writeImage(const osg::Image&, const std::string&, const osgDB::Options*) const override;

        ReadResult readImageFromSourceData(const std::string&, const osgDB::Options*) const;
        ReadResult readImageEncoded(const std::string&, const osgDB::Options*) const;
    };

    class RGBH_NNRA_Loader
    {
    public:
        static bool load(
            const URI& colorURI,
            TextureArena* arena,
            const osgDB::Options* options);
    };

} } // namespace osgEarth::Procedural

#endif // OSGEARTH_PROCEDURAL_SPLATTING_MATERIALS_H
