image: make offset constexpr, and move inline
This commit is contained in:
parent
4ea5896d21
commit
c2bdd29944
@ -255,15 +255,6 @@ util::image::buffer<T>::downsample (float factor) const
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
template <typename T>
|
||||
size_t
|
||||
buffer<T>::offset (point<2,size_t> p) const
|
||||
{
|
||||
return dot (stride (), p);
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T>
|
||||
T
|
||||
buffer<T>::operator[] (point<2,size_t> p) const
|
||||
{
|
||||
|
@ -61,7 +61,7 @@ namespace util { namespace image {
|
||||
size_t s;
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
size_t offset (point<2,size_t>) const;
|
||||
constexpr size_t offset (point<2,size_t>) const;
|
||||
|
||||
T operator[] (point<2,size_t>) const;
|
||||
T& operator[] (point<2,size_t>);
|
||||
|
@ -38,6 +38,15 @@ namespace util { namespace image {
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
template <typename T>
|
||||
constexpr size_t
|
||||
buffer<T>::offset (point<2,size_t> p) const
|
||||
{
|
||||
return dot (stride (), p);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
template <typename T>
|
||||
constexpr size_t
|
||||
|
Loading…
Reference in New Issue
Block a user