31 #ifndef IMAGETEMPLATE_H_
32 #define IMAGETEMPLATE_H_ "Image 1.3, 2010.05.05 Markus.Peura@fmi.fi"
37 #include <drain/Log.h>
44 #include "Intensity.h"
45 #include "../util/Point.h"
65 template <
class T=
unsigned char>
78 ImageT(
size_t width,
size_t height,
size_t channelCount=1,
size_t alphaChannelCount=0){
79 initialize(
typeid(T), width,height,channelCount,alphaChannelCount);
84 initialize(
typeid(T), image.getWidth(),image.getHeight(),image.getImageChannelCount(),image.getAlphaChannelCount());
92 const T & at(
size_t i)
const {
93 return *retrieve<const T>(
address(i));
99 return *retrieve<T>(
address(i));
105 const T & at(
size_t i,
size_t j)
const {
106 return *(
const T *) retrieve<T>(
address(i,j));
111 T & at(
size_t i,
size_t j){
112 return *(T *) retrieve<T>(
address(i,j));
size_t address(size_t i) const
Computes the index location from image coordinates. Does not involve bit resolution.
Definition: ImageFrame.h:148
const CoordinatePolicy & getCoordinatePolicy() const
Coord policy.
Definition: ImageLike.h:167
A template class for images with static storage type.
Definition: ImageT.h:67
Image with modifiable geometry.
Definition: Image.h:63
virtual void initialize(const std::type_info &t, const Geometry &g)
Sets the type and allocates a data buffer.
Definition: Image.h:147
Definition: DataSelector.cpp:1277