|
#include <Geometry.h>
Public Member Functions | |
Geometry (size_t width=0, size_t height=0, size_t channels=1, size_t alphas=0) | |
Constructor with dimensions. Channel count is one by default, allowing construction with width and height. | |
Geometry (const Geometry &g) | |
virtual const Geometry & | getGeometry () const |
virtual Geometry & | getGeometry () |
template<class T > | |
void | setGeometry (const T &g) |
void | setGeometry (const Geometry &g) |
void | setGeometry (size_t width, size_t height, size_t imageChannelCount=1, size_t alphaChannelCount=0) |
operator const AreaGeometry & () const | |
size_t | getWidth () const |
size_t | getHeight () const |
template<typename S , size_t N> | |
void | setArea (const TupleBase< S, N > &a) |
void | setArea (size_t width, size_t height) |
size_t | getArea () const |
size_t | getChannelCount () const |
Set... | |
void | setChannelCount (size_t imageChannels, size_t alphaChannels) |
void | setChannelCount (const ChannelGeometry &geom) |
const size_t | getImageChannelCount () const |
void | setImageChannelCount (size_t imageChannels) |
const size_t | getAlphaChannelCount () const |
void | setAlphaChannelCount (size_t alphaChannels) |
bool | hasAlphaChannel () const |
size_t | getChannelIndex (const std::string &index) const |
Returns numeric channel index from "r", "g", "b", or "a" or a non-negative number in string format. More... | |
size_t | getVolume () const |
bool | isEmpty () const |
bool | operator== (const Geometry &g) const |
bool | operator!= (const Geometry &g) const |
Public Member Functions inherited from UniTuple< size_t, 4 > | |
UniTuple (const TT &... args) | |
UniTuple (const UniTuple< size_t, N > &t) | |
Copy constructor. | |
UniTuple (std::initializer_list< S > l) | |
tuple_t & | operator= (const tuple_t &t) |
tuple_t & | operator= (const value_type &value) |
tuple_t & | operator= (std::initializer_list< S > l) |
virtual const_iterator | begin () const override final |
virtual iterator | begin () override final |
virtual const_iterator | end () const override final |
virtual iterator | end () override final |
tuple_t & | tuple () |
const tuple_t & | tuple () const |
void | debug (std::ostream &ostr) const |
Public Member Functions inherited from TupleBase< S, N > | |
const S & | at (size_t i) const |
Return const reference to element i. More... | |
const S & | operator[] (size_t i) const |
S & | at (size_t i) |
Return reference to element i. More... | |
S & | operator[] (size_t i) |
bool | operator== (const tuplebase_t &t) const |
Equality operator. | |
bool | operator!= (const tuplebase_t &t) const |
Inequality operator. | |
template<class T > | |
T & | toSequence (T &sequence) const |
Copy elements to a Sequence, like stl::list, stl::set or stl::vector. | |
void | set (const tuplebase_t &t) |
template<class T2 , size_t N2 = 2> | |
void | set (const TupleBase< T2, N2 > &t) |
Assign tuple of different type and/or size. | |
void | set (const S &arg) |
template<typename ... SS> | |
void | set (const S &arg, const SS &... rest) |
Set element(s). | |
template<typename T > | |
void | set (std::initializer_list< T > l) |
template<class T > | |
tuplebase_t & | assignSequence (T &sequence, bool LENIENT=false) |
Proposed for tuples only; derived classes should not shadow this. More... | |
void | fill (S i) |
Set all the elements to i. | |
void | clear () |
virtual std::ostream & | toStream (std::ostream &ostr, char separator=',') const |
std::string | toStr (char separator=',') const |
virtual void | updateTuple () |
Public Attributes | |
AreaGeometry | area |
ChannelGeometry | channels |
Additional Inherited Members | |
Public Types inherited from UniTuple< size_t, 4 > | |
typedef size_t | value_type |
typedef UniTuple< size_t, N > | tuple_t |
typedef size_t * | iterator |
typedef const size_t * | const_iterator |
Public Types inherited from TupleBase< S, N > | |
typedef TupleBase< S, N > | tuplebase_t |
typedef S | value_type |
typedef S * | iterator |
typedef S const * | const_iterator |
Static Public Member Functions inherited from TupleBase< S, N > | |
static size_t | size () |
Return the number of elements. More... | |
Static Public Attributes inherited from UniTuple< size_t, 4 > | |
static const size_t | tuple_size |
Static Public Attributes inherited from TupleBase< S, N > | |
static const size_t | storageTypeSize = sizeof(S) |
Protected Member Functions inherited from UniTuple< size_t, 4 > | |
UniTuple (UniTuple< size_t, N2 > &tuple, size_t i) | |
size_t & | next () |
Protected Member Functions inherited from TupleBase< S, N > | |
void | setIndexed (size_t i) |
Argument stack endpoint function; final step of variadic argument set(arg, ...) . | |
template<typename T2 , typename ... TT> | |
void | setIndexed (size_t i, T2 arg, const TT &... rest) |
Worker called by set(T2 arg, T2 arg2, ...) | |
Protected Attributes inherited from UniTuple< size_t, 4 > | |
const iterator | start |
The basic idea is to encode dimensions directly as a std::vector<int>; the number of elements is the number of dimensions. Each element states the discrete coordinate space.
For example, a three-channel image having width 640 and height 400 would have dimension vector [640,400,3]. The coordinates will be: x \in {0,1,...,639}, y \in {0,1,...,399} and z \in {0,1,2}. The size of the vector of unlimited, allowing hypermatrices of any size.
size_t getChannelIndex | ( | const std::string & | index | ) | const |
Returns numeric channel index from "r", "g", "b", or "a" or a non-negative number in string format.
Given a numeric channel index, returns it as a number.
Number