#include <Surface.h>
Classes | |
class | ConstIter |
class | Iter |
Public Member Functions | |
SurfaceT () | |
SurfaceT (int32_t aWidth, int32_t aHeight, bool alpha, SurfaceChannelOrder aChannelOrder=SurfaceChannelOrder::UNSPECIFIED) | |
SurfaceT (int32_t aWidth, int32_t aHeight, bool alpha, const SurfaceConstraints &constraints) | |
SurfaceT (T *aData, int32_t aWidth, int32_t aHeight, int32_t aRowBytes, SurfaceChannelOrder aChannelOrder) | |
SurfaceT (shared_ptr< class ImageSource > imageSource, const SurfaceConstraints &constraints=SurfaceConstraintsDefault(), boost::tribool alpha=boost::logic::indeterminate) | |
operator ImageSourceRef () const | |
int32_t | getWidth () const |
Returns the width of the Surface in pixels. | |
int32_t | getHeight () const |
Returns the height of the Surface in pixels. | |
Vec2i | getSize () const |
Returns the size of the Surface in pixels. | |
float | getAspectRatio () const |
Returns the Surface aspect ratio, which is its width / height. | |
Area | getBounds () const |
Returns the bounding Area of the Surface in pixels: [0,0]-(width,height). | |
bool | hasAlpha () const |
Returns whether the Surface contains an alpha channel. | |
bool | isPremultiplied () const |
Returns whether the Surface color data is premultiplied by its alpha channel or not. | |
bool | setPremultiplied (bool premult=true) const |
Sets whether the Surface color data should be interpreted as being premultiplied by its alpha channel or not. | |
int32_t | getRowBytes () const |
Returns the width of a row of the Surface measured in bytes, which is not necessarily getWidth() * getPixelInc(). | |
uint8_t | getPixelInc () const |
Returns the amount to increment a T* to increment by a pixel. Analogous to the number of channels, which is either 3 or 4. | |
SurfaceT | clone (bool copyPixels=true) const |
Returns a new Surface which is a duplicate. If copyPixels the pixel values are copied, otherwise the clone's pixels remain uninitialized. | |
SurfaceT | clone (const Area &area, bool copyPixels=true) const |
Returns a new Surface which is a duplicate of an Area area. If copyPixels the pixel values are copied, otherwise the clone's pixels remain uninitialized. | |
T * | getData () |
const T * | getData () const |
T * | getData (const Vec2i &offset) |
const T * | getData (const Vec2i &offset) const |
T * | getDataRed (const Vec2i &offset) |
const T * | getDataRed (const Vec2i &offset) const |
T * | getDataGreen (const Vec2i &offset) |
const T * | getDataGreen (const Vec2i &offset) const |
T * | getDataBlue (const Vec2i &offset) |
const T * | getDataBlue (const Vec2i &offset) const |
T * | getDataAlpha (const Vec2i &offset) |
const T * | getDataAlpha (const Vec2i &offset) const |
void | setData (T *aData, int32_t aWidth, int32_t aHeight, int32_t aRowBytes) |
void | setDeallocator (void(*aDeallocatorFunc)(void *), void *aDeallocatorRefcon) |
const SurfaceChannelOrder & | getChannelOrder () const |
uint8_t | getRedOffset () const |
uint8_t | getGreenOffset () const |
uint8_t | getBlueOffset () const |
uint8_t | getAlphaOffset () const |
void | setChannelOrder (const SurfaceChannelOrder &aChannelOrder) |
ChannelT< T > * | getChannel (uint8_t ChannelT) |
ChannelT< T > * | getChannelRed () |
ChannelT< T > * | getChannelGreen () |
ChannelT< T > * | getChannelBlue () |
ChannelT< T > * | getChannelAlpha () |
const ChannelT< T > * | getChannel (uint8_t ChannelT) const |
const ChannelT< T > * | getChannelRed () const |
const ChannelT< T > * | getChannelGreen () const |
const ChannelT< T > * | getChannelBlue () const |
const ChannelT< T > * | getChannelAlpha () const |
ColorAT< T > | getPixel (Vec2i pos) const |
Convenience method for getting a single pixel. For performance-sensitive code consider Surface::Iter instead. | |
void | setPixel (Vec2i pos, const ColorT< T > &c) |
Convenience method for setting a single pixel. For performance-sensitive code consider SurfaceT<T>::Iter instead. | |
void | setPixel (Vec2i pos, const ColorAT< T > &c) |
Convenience method for setting a single pixel. For performance-sensitive code consider SurfaceT<T>::Iter instead. | |
void | copyFrom (const SurfaceT< T > &srcSurface, const Area &srcArea, const Vec2i &relativeOffset=Vec2i::zero()) |
ColorT< T > | areaAverage (const Area &area) const |
Iter | getIter () |
Iter | getIter (const Area &area) |
ConstIter | getIter () const |
ConstIter | getIter (const Area &area) const |
| |
typedef shared_ptr< Obj > SurfaceT::* | unspecified_bool_type |
Emulates shared_ptr-like behavior. | |
operator unspecified_bool_type () | |
Emulates shared_ptr-like behavior. | |
void | reset () |
Emulates shared_ptr-like behavior. |
typedef shared_ptr<Obj> SurfaceT::* cinder::SurfaceT< T >::unspecified_bool_type |
Emulates shared_ptr-like behavior.
cinder::SurfaceT< T >::SurfaceT | ( | ) |
cinder::SurfaceT< T >::SurfaceT | ( | int32_t | aWidth, | |
int32_t | aHeight, | |||
bool | alpha, | |||
SurfaceChannelOrder | aChannelOrder = SurfaceChannelOrder::UNSPECIFIED | |||
) |
cinder::SurfaceT< T >::SurfaceT | ( | int32_t | aWidth, | |
int32_t | aHeight, | |||
bool | alpha, | |||
const SurfaceConstraints & | constraints | |||
) |
cinder::SurfaceT< T >::SurfaceT | ( | T * | aData, | |
int32_t | aWidth, | |||
int32_t | aHeight, | |||
int32_t | aRowBytes, | |||
SurfaceChannelOrder | aChannelOrder | |||
) |
cinder::SurfaceT< T >::SurfaceT | ( | shared_ptr< class ImageSource > | imageSource, | |
const SurfaceConstraints & | constraints = SurfaceConstraintsDefault() , |
|||
boost::tribool | alpha = boost::logic::indeterminate | |||
) |
cinder::SurfaceT< T >::operator ImageSourceRef | ( | ) | const |
int32_t cinder::SurfaceT< T >::getWidth | ( | ) | const |
Returns the width of the Surface in pixels.
int32_t cinder::SurfaceT< T >::getHeight | ( | ) | const |
Returns the height of the Surface in pixels.
Vec2i cinder::SurfaceT< T >::getSize | ( | ) | const |
Returns the size of the Surface in pixels.
float cinder::SurfaceT< T >::getAspectRatio | ( | ) | const |
Returns the Surface aspect ratio, which is its width / height.
Area cinder::SurfaceT< T >::getBounds | ( | ) | const |
Returns the bounding Area of the Surface in pixels: [0,0]-(width,height).
bool cinder::SurfaceT< T >::hasAlpha | ( | ) | const |
Returns whether the Surface contains an alpha channel.
bool cinder::SurfaceT< T >::isPremultiplied | ( | ) | const |
Returns whether the Surface color data is premultiplied by its alpha channel or not.
bool cinder::SurfaceT< T >::setPremultiplied | ( | bool | premult = true |
) | const |
Sets whether the Surface color data should be interpreted as being premultiplied by its alpha channel or not.
int32_t cinder::SurfaceT< T >::getRowBytes | ( | ) | const |
Returns the width of a row of the Surface measured in bytes, which is not necessarily getWidth() * getPixelInc().
uint8_t cinder::SurfaceT< T >::getPixelInc | ( | ) | const |
Returns the amount to increment a T* to increment by a pixel. Analogous to the number of channels, which is either 3 or 4.
SurfaceT< T > cinder::SurfaceT< T >::clone | ( | bool | copyPixels = true |
) | const |
Returns a new Surface which is a duplicate. If copyPixels the pixel values are copied, otherwise the clone's pixels remain uninitialized.
SurfaceT< T > cinder::SurfaceT< T >::clone | ( | const Area & | area, | |
bool | copyPixels = true | |||
) | const |
Returns a new Surface which is a duplicate of an Area area. If copyPixels the pixel values are copied, otherwise the clone's pixels remain uninitialized.
T* cinder::SurfaceT< T >::getData | ( | ) |
const T* cinder::SurfaceT< T >::getData | ( | ) | const |
T* cinder::SurfaceT< T >::getData | ( | const Vec2i & | offset | ) |
const T* cinder::SurfaceT< T >::getData | ( | const Vec2i & | offset | ) | const |
T* cinder::SurfaceT< T >::getDataRed | ( | const Vec2i & | offset | ) |
const T* cinder::SurfaceT< T >::getDataRed | ( | const Vec2i & | offset | ) | const |
T* cinder::SurfaceT< T >::getDataGreen | ( | const Vec2i & | offset | ) |
const T* cinder::SurfaceT< T >::getDataGreen | ( | const Vec2i & | offset | ) | const |
T* cinder::SurfaceT< T >::getDataBlue | ( | const Vec2i & | offset | ) |
const T* cinder::SurfaceT< T >::getDataBlue | ( | const Vec2i & | offset | ) | const |
T* cinder::SurfaceT< T >::getDataAlpha | ( | const Vec2i & | offset | ) |
const T* cinder::SurfaceT< T >::getDataAlpha | ( | const Vec2i & | offset | ) | const |
void cinder::SurfaceT< T >::setData | ( | T * | aData, | |
int32_t | aWidth, | |||
int32_t | aHeight, | |||
int32_t | aRowBytes | |||
) |
void cinder::SurfaceT< T >::setDeallocator | ( | void(*)(void *) | aDeallocatorFunc, | |
void * | aDeallocatorRefcon | |||
) |
Set's the deallocator, an optional callback which will fire upon the Surface::Obj's destruction. This is useful when a Surface is wrapping another API's image data structure whose lifetime is tied to the Surface's.
const SurfaceChannelOrder& cinder::SurfaceT< T >::getChannelOrder | ( | ) | const |
uint8_t cinder::SurfaceT< T >::getRedOffset | ( | ) | const |
uint8_t cinder::SurfaceT< T >::getGreenOffset | ( | ) | const |
uint8_t cinder::SurfaceT< T >::getBlueOffset | ( | ) | const |
uint8_t cinder::SurfaceT< T >::getAlphaOffset | ( | ) | const |
void cinder::SurfaceT< T >::setChannelOrder | ( | const SurfaceChannelOrder & | aChannelOrder | ) |
ChannelT<T>* cinder::SurfaceT< T >::getChannel | ( | uint8_t | ChannelT | ) |
ChannelT<T>* cinder::SurfaceT< T >::getChannelRed | ( | ) |
ChannelT<T>* cinder::SurfaceT< T >::getChannelGreen | ( | ) |
ChannelT<T>* cinder::SurfaceT< T >::getChannelBlue | ( | ) |
ChannelT<T>* cinder::SurfaceT< T >::getChannelAlpha | ( | ) |
const ChannelT<T>* cinder::SurfaceT< T >::getChannel | ( | uint8_t | ChannelT | ) | const |
const ChannelT<T>* cinder::SurfaceT< T >::getChannelRed | ( | ) | const |
const ChannelT<T>* cinder::SurfaceT< T >::getChannelGreen | ( | ) | const |
const ChannelT<T>* cinder::SurfaceT< T >::getChannelBlue | ( | ) | const |
const ChannelT<T>* cinder::SurfaceT< T >::getChannelAlpha | ( | ) | const |
ColorAT<T> cinder::SurfaceT< T >::getPixel | ( | Vec2i | pos | ) | const |
Convenience method for getting a single pixel. For performance-sensitive code consider Surface::Iter instead.
void cinder::SurfaceT< T >::setPixel | ( | Vec2i | pos, | |
const ColorT< T > & | c | |||
) |
Convenience method for setting a single pixel. For performance-sensitive code consider SurfaceT<T>::Iter instead.
void cinder::SurfaceT< T >::setPixel | ( | Vec2i | pos, | |
const ColorAT< T > & | c | |||
) |
Convenience method for setting a single pixel. For performance-sensitive code consider SurfaceT<T>::Iter instead.
void cinder::SurfaceT< T >::copyFrom | ( | const SurfaceT< T > & | srcSurface, | |
const Area & | srcArea, | |||
const Vec2i & | relativeOffset = Vec2i::zero() | |||
) |
ColorT< T > cinder::SurfaceT< T >::areaAverage | ( | const Area & | area | ) | const |
cinder::SurfaceT< T >::operator unspecified_bool_type | ( | ) |
Emulates shared_ptr-like behavior.
void cinder::SurfaceT< T >::reset | ( | ) |
Emulates shared_ptr-like behavior.
Iter cinder::SurfaceT< T >::getIter | ( | ) |
Iter cinder::SurfaceT< T >::getIter | ( | const Area & | area | ) |
ConstIter cinder::SurfaceT< T >::getIter | ( | ) | const |
ConstIter cinder::SurfaceT< T >::getIter | ( | const Area & | area | ) | const |