triskele/include/IImage.hpp
Git Merciol f687310939 modifié : CMakeLists.txt
modifié :         CMakeListsOTB.txt
	modifié :         LICENSE
	modifié :         MakefileNoOTB
	modifié :         Readme.html
	modifié :         Readme.txt
	modifié :         include/Appli/Option.hpp
	modifié :         include/Appli/Selected.hpp
	modifié :         include/Appli/Selected.tpp
	modifié :         include/ArrayTree/ArrayTreeBuilder.hpp
	modifié :         include/ArrayTree/ArrayTreeBuilder.tpp
	modifié :         include/ArrayTree/Border.hpp
	modifié :         include/ArrayTree/Border.tpp
	modifié :         include/ArrayTree/GraphWalker.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/ArrayTree/triskeleSort.hpp
	modifié :         include/ArrayTree/triskeleSort.tpp
	modifié :         include/AttributeProfiles.hpp
	modifié :         include/AttributeProfiles.tpp
	modifié :         include/Attributes/AreaAttributes.hpp
	modifié :         include/Attributes/AreaAttributes.tpp
	modifié :         include/Attributes/AverageAttributes.hpp
	modifié :         include/Attributes/AverageAttributes.tpp
	modifié :         include/Attributes/MoIAttributes.hpp
	modifié :         include/Attributes/MoIAttributes.tpp
	modifié :         include/Attributes/SDAttributes.hpp
	modifié :         include/Attributes/SDAttributes.tpp
	modifié :         include/Attributes/WeightAttributes.hpp
	modifié :         include/Attributes/WeightAttributes.tpp
	modifié :         include/Attributes/XYAttributes.hpp
	modifié :         include/Attributes/XYAttributes.tpp
	modifié :         include/CompAttribute.hpp
	modifié :         include/CompAttribute.tpp
	modifié :         include/IImage.hpp
	modifié :         include/IImage.tpp
	modifié :         include/QuadTree/QuadTreeBuilder.hpp
	modifié :         include/Tree.hpp
	modifié :         include/Tree.tpp
	modifié :         include/TreeBuilder.hpp
	modifié :         include/TreeBuilder.tpp
	modifié :         include/TreeStats.hpp
	modifié :         include/TreeStats.tpp
	modifié :         include/XMLTree/XMLTreeBuilder.hpp
	modifié :         include/triskeleBase.hpp
	modifié :         include/triskeleBase.tpp
	modifié :         include/triskeleDealThreads.hpp
	modifié :         include/triskeleDealThreads.tpp
	modifié :         include/triskeleDebug.hpp
	modifié :         include/triskeleGdalGetType.hpp
	modifié :         otb-module.cmake
	modifié :         src/Appli/Option.cpp
	modifié :         src/Appli/Selected.cpp
	modifié :         src/ArrayTree/triskeleArrayTreeBase.cpp
	modifié :         src/CMakeLists.txt
	modifié :         src/IImage.cpp
	modifié :         src/PerfArrayTreeBuilder.cpp
	modifié :         src/QuadTree/QuadTreeBuilder.cpp
	modifié :         src/TestArrayTreeBuilder.cpp
	modifié :         src/Tree.cpp
	modifié :         src/TreeStats.cpp
	modifié :         src/XMLTree/XMLTreeBuilder.cpp
	modifié :         src/apGenerator.cpp
	modifié :         src/triskeleBase.cpp
	modifié :         src/triskeleDebug.cpp
2018-04-02 19:25:37 +02:00

83 lines
2.3 KiB
C++

#ifndef _OTB_TRISKELE_I_IMAGE_HPP
#define _OTB_TRISKELE_I_IMAGE_HPP
#include <string>
#include <iostream>
#include <boost/assert.hpp>
#include <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;
vector<PixelT> pixels;
public:
inline void setSize (const Size &size);
inline const Size &getSize () const;
inline const PixelT *getPixels () const;
inline PixelT *getPixels ();
inline vector<PixelT> &getPixelsVector ();
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 (const Raster &raster, const Rect &tile);
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 (PixelT *pixels, 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