34 #ifndef CARTODATA_VOLUME_VOLUMEOPERATORS_H
35 #define CARTODATA_VOLUME_VOLUMEOPERATORS_H
46 template <
typename T>
inline
47 VolumeRef<T>
operator - (
const VolumeRef<T> & o1 )
53 template <
typename T>
inline
54 VolumeRef<T>
operator + (
const VolumeRef<T> & o1,
const VolumeRef<T> & o2 )
60 template <
typename T>
inline
61 VolumeRef<T> &
operator += ( VolumeRef<T> & o1,
const VolumeRef<T> & o2 )
68 template <
typename T>
inline
69 VolumeRef<T>
operator - (
const VolumeRef<T> & o1,
const VolumeRef<T> & o2 )
75 template <
typename T>
inline
76 VolumeRef<T> &
operator -= ( VolumeRef<T> & o1,
const VolumeRef<T> & o2 )
83 template <
typename T>
inline
84 VolumeRef<T>
operator * (
const VolumeRef<T> & o1,
const VolumeRef<T> & o2 )
90 template <
typename T>
inline
91 VolumeRef<T> &
operator *= ( VolumeRef<T> & o1,
const VolumeRef<T> & o2 )
98 template <
typename T>
inline
99 VolumeRef<T>
operator / (
const VolumeRef<T> & o1,
const VolumeRef<T> & o2 )
105 template <
typename T>
inline
106 VolumeRef<T> &
operator /= ( VolumeRef<T> & o1,
const VolumeRef<T> & o2 )
113 template <
typename T>
inline
114 VolumeRef<T>
operator + (
const VolumeRef<T> & o1,
const T & val )
117 ( UnaryFromConstantBinaryFunctor<T, std::plus<T> >
118 ( val, std::plus<T>() ), o1 );
122 template <
typename T>
inline
123 VolumeRef<T>
operator + (
const T & val,
const VolumeRef<T> & o1 )
126 ( UnaryFromConstantBinaryFunctor2<T, std::plus<T> >
127 ( val, std::plus<T>() ), o1 );
131 template <
typename T>
inline
132 VolumeRef<T> &
operator += ( VolumeRef<T> & o1,
const T & val )
135 ( val, std::plus<T>() ), o1 );
140 template <
typename T>
inline
141 VolumeRef<T>
operator - (
const VolumeRef<T> & o1,
const T & val )
144 ( UnaryFromConstantBinaryFunctor<T, std::minus<T> >
145 ( val, std::minus<T>() ), o1 );
149 template <
typename T>
inline
150 VolumeRef<T>
operator - (
const T & val,
const VolumeRef<T> & o1 )
153 ( UnaryFromConstantBinaryFunctor2<T, std::minus<T> >
154 ( val, std::minus<T>() ), o1 );
158 template <
typename T>
inline
159 VolumeRef<T> &
operator -= ( VolumeRef<T> & o1,
const T & val )
162 ( val, std::minus<T>() ), o1 );
167 template <
typename T,
typename U>
inline
168 VolumeRef<T>
operator * (
const VolumeRef<T> & o1, U val )
174 template <
typename T,
typename U>
inline
175 VolumeRef<T>
operator * ( U val,
const VolumeRef<T> & o1 )
181 template <
typename T,
typename U>
inline
182 VolumeRef<T> &
operator *= ( VolumeRef<T> & o1, U val )
189 template <
typename T,
typename U>
inline
190 VolumeRef<T>
operator / (
const VolumeRef<T> & o1, U val )
196 template <
typename T>
inline
197 VolumeRef<T>
operator / (
double val,
const VolumeRef<T> & o1 )
200 ( UnaryFromConstantBinaryFunctor2<T, std::divides<T> >
201 ( val, std::divides<T>() ), o1 );
205 template <
typename T,
typename U>
inline
206 VolumeRef<T> &
operator /= ( VolumeRef<T> & o1, U val )
static void selfApply(UnaryFunction f, VolumeRef< T > &o)
applies a binary function to each voxel of a pair of volumes
static VolumeRef< T > apply(UnaryFunction f, const VolumeRef< T > &o)
applies a unary function to each voxel of a volume
carto::Volume< T > & operator*=(carto::Volume< T > &vol, const U &value)
carto::Volume< T > & operator/=(carto::Volume< T > &vol, const U &value)
VoxelRGB operator/(const VoxelRGB &aa, const uint8_t &bb)
VoxelRGB operator+(const VoxelRGB &aa, const VoxelRGB &bb)
VoxelRGB operator-(const VoxelRGB &aa, const VoxelRGB &bb)
VoxelRGB operator*(const VoxelRGB &aa, const uint8_t &bb)
carto::Volume< T > & operator-=(carto::Volume< T > &vol, const U &value)
carto::Volume< T > & operator+=(carto::Volume< T > &vol, const U &value)