|
Two-dimensional array of sizes. More...
#include <size2.h>
Public Member Functions | |
GfSize2 () | |
Default constructor initializes components to zero. | |
GfSize2 (const GfSize2 &o) | |
Copy constructor. | |
GfSize2 (const GfVec2i &o) | |
Conversion from GfVec2i. | |
GfSize2 (const size_t v[2]) | |
Construct from an array. | |
GfSize2 (size_t v0, size_t v1) | |
Construct from two values. | |
GfSize2 & | Set (const size_t v[2]) |
Set to the values in a given array. | |
GfSize2 & | Set (size_t v0, size_t v1) |
Set to values passed directly. | |
size_t & | operator[] (size_t i) |
Array operator. | |
const size_t & | operator[] (size_t i) const |
Const array operator. | |
bool | operator== (const GfSize2 &v) const |
Component-wise equality. | |
bool | operator!= (const GfSize2 &v) const |
Component-wise inequality. | |
GfSize2 & | operator+= (const GfSize2 &v) |
Component-wise in-place addition. | |
GfSize2 & | operator-= (const GfSize2 &v) |
Component-wise in-place subtraction. | |
GfSize2 & | operator*= (GfSize2 const &v) |
Component-wise in-place multiplication. | |
GfSize2 & | operator*= (int d) |
Component-wise in-place multiplication by a scalar. | |
GfSize2 & | operator/= (int d) |
Component-wise in-place division by a scalar. | |
operator GfVec2i () const | |
Conversion to GfVec2i. | |
Friends | |
GfSize2 | operator+ (const GfSize2 &v1, const GfSize2 &v2) |
Component-wise addition. | |
GfSize2 | operator- (const GfSize2 &v1, const GfSize2 &v2) |
Component-wise subtraction. | |
GfSize2 | operator* (const GfSize2 &v1, const GfSize2 &v2) |
Component-wise multiplication. | |
GfSize2 | operator* (const GfSize2 &v1, int s) |
Component-wise multiplication by a scalar. | |
GfSize2 | operator* (int s, const GfSize2 &v1) |
Component-wise multiplication by a scalar. | |
GfSize2 | operator/ (const GfSize2 &v1, int s) |
Component-wise division by a scalar. | |
GF_API friend std::ostream & | operator<< (std::ostream &o, GfSize2 const &v) |
Output operator. | |
Two-dimensional array of sizes.
GfSize2 is used to represent pairs of counts. It is based on the datatype size_t, and thus can only represent non-negative values in each dimension. If you need to represent negative numbers as well, use GfVec2i.
Usage of GfSize2 is similar to that of GfVec2i, except that all mathematical operations are componentwise (including multiplication).
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
friend |
Output operator.