triskele/include/IImage.hpp
Git Merciol ed9141d5c5 modifié : include/ArrayTree/ArrayTreeBuilder.hpp
modifié :         include/ArrayTree/ArrayTreeBuilder.tpp
	modifié :         include/ArrayTree/Border.hpp
	modifié :         include/ArrayTree/GraphWalker.tpp
	modifié :         include/ArrayTree/Leader.hpp
	modifié :         include/ArrayTree/Leader.tpp
	modifié :         include/ArrayTree/Weight.hpp
	modifié :         include/ArrayTree/Weight.tpp
	modifié :         include/ArrayTree/triskeleArrayTreeBase.hpp
	modifié :         include/ArrayTree/triskeleArrayTreeBase.tpp
	modifié :         include/IImage.hpp
	modifié :         include/IImage.tpp
	modifié :         include/Tree.hpp
	modifié :         include/Tree.tpp
	modifié :         include/TreeBuilder.hpp
	modifié :         include/XMLTree/XMLTreeBuilder.hpp
	modifié :         include/triskeleBase.hpp
	modifié :         include/triskeleDealThreads.hpp
	modifié :         include/triskeleDealThreads.tpp
	modifié :         include/triskeleDebug.hpp
	modifié :         include/triskeleGdalGetType.hpp
	nouveau fichier : src/IImage.cpp
	modifié :         src/QuadTree/QuadTreeBuilder.cpp
	modifié :         src/Tree.cpp
	modifié :         src/testMain.cpp
	modifié :         src/triskeleDebug.cpp
2018-02-18 08:24:25 +01:00

81 lines
2.2 KiB
C++

#ifndef _OTB_TRISKELE_I_IMAGE_HPP
#define _OTB_TRISKELE_I_IMAGE_HPP
#include <string>
#include <iostream>
#include <boost/assert.hpp>
#include <gdal/gdal_priv.h>
#include "triskeleBase.hpp"
#include "triskeleDebug.hpp"
#include "triskeleGdalGetType.hpp"
namespace triskele {
using namespace std;
template<typename PixelT>
class Raster {
private:
Size size;
PixelT *pixels;
public:
inline void setSize (const Size &size);
inline const Size &getSize () const;
inline const PixelT *getPixels () const;
inline PixelT *getPixels ();
inline DimNodeId pointIdx (const Point &p) const;
inline PixelT getValue (const DimImg &idx) const;
inline PixelT getValue (const Point &point) const;
inline Raster (const Size &size = NullSize);
inline ~Raster ();
};
// ========================================
/** Interface Image */
class IImage {
public:
void setFileName (string fileName);
inline const string &getFileName () const;
inline const Size &getSize () const;
inline const DimChanel &getBandCount () const;
inline GDALDataType getDataType () const;
inline const bool isRead () const;
inline const bool isEmpty () const;
IImage (const std::string &imageFileName = "");
~IImage ();
void readImage ();
void createImage (const Size &size, const GDALDataType &dataType, const DimChanel &nbOutputBands);
void close ();
template<typename PixelT>
inline void readBand (Raster<PixelT> &raster, const DimChanel &band) const;
template<typename PixelT>
inline void readBand (Raster<PixelT> &raster, DimChanel band, const Point &cropOrig, const Size &cropSize) const;
template<typename PixelT>
inline void writeBand (Raster<PixelT> &raster, DimChanel band) const;
private:
IImage (const IImage &o) = delete;
IImage &operator= (const IImage&) = delete;
private:
static size_t gdalCount;
string fileName;
Size size;
DimChanel bandCount;
GDALDataType dataType;
GDALDataset *gdalInputDataset;
GDALDataset *gdalOutputDataset;
bool read;
};
#include "IImage.tpp"
} // triskele
#endif // _OTB_TRISKELE_I_IMAGE_HPP