Support Forum G3D Web Page |
Manages CPU and GPU versions of image data and performs conversions as needed. More...
Inherits G3D::ReferenceCountedObject.
Public Member Functions | |
const class shared_ptr< Image > & | image () const |
Returns the CPU image portion of this component, synthesizing it if necessary. More... | |
const Image::StorageType & | max () const |
Largest value in each channel of the image. More... | |
const Image::ComputeType & | mean () const |
Average value in each channel of the image. More... | |
const Image::StorageType & | min () const |
Smallest value in each channel of the image. More... | |
void | setStorage (ImageStorage s) const |
const shared_ptr< Texture > & | texture () const |
Returns the GPU image portion of this component, synthesizing it if necessary. More... | |
Static Public Member Functions | |
static shared_ptr< MapComponent< Image > > | create (const class shared_ptr< Image > &im, const shared_ptr< Texture > &tex) |
Returns nullptr if both are nullptr. More... | |
Protected Member Functions | |
MapComponent (const class shared_ptr< Image > &im, const shared_ptr< Texture > &tex) | |
void | computeCPUStats () |
void | forceStats () const |
Used to compute min/max/mean from m_gpuImage without triggering a Texture::force() at construction time. More... | |
Static Protected Member Functions | |
static void | convert (const Color4 &c, Color3 &v) |
static void | convert (const Color4 &c, Color4 &v) |
static void | convert (const Color4 &c, Color1 &v) |
template<class T , class ... ArgTypes> | |
static shared_ptr< T > | createShared (ArgTypes &&... args) |
Like std::make_shared, but works for protected constructors. More... | |
static void | getTexture (const shared_ptr< Image > &im, shared_ptr< Texture > &tex) |
Protected Attributes | |
shared_ptr< Image > | m_cpuImage |
shared_ptr< Texture > | m_gpuImage |
Image::StorageType | m_max |
Image::ComputeType | m_mean |
Image::StorageType | m_min |
bool | m_needsForce |
True when stats are out of date. More... | |
Manages CPU and GPU versions of image data and performs conversions as needed.
Image | the CPU floating-point image format to use. On the GPU, the corresponding uint8 format is used. |
Primarily used by Component.
|
inlineprotected |
|
inlineprotected |
Referenced by G3D::MapComponent< Image >::forceStats(), and G3D::MapComponent< Image >::MapComponent().
|
inlinestaticprotected |
Referenced by G3D::MapComponent< Image >::forceStats().
|
inlinestaticprotected |
|
inlinestaticprotected |
|
inlinestatic |
Returns nullptr if both are nullptr.
|
inlinestaticprotectedinherited |
Like std::make_shared, but works for protected constructors.
Call as createShared<myclass>.
|
inlineprotected |
Used to compute min/max/mean from m_gpuImage without triggering a Texture::force() at construction time.
Referenced by G3D::MapComponent< Image >::max(), G3D::MapComponent< Image >::mean(), and G3D::MapComponent< Image >::min().
|
inlinestaticprotected |
Referenced by G3D::MapComponent< Image >::texture().
|
inline |
Returns the CPU image portion of this component, synthesizing it if necessary.
Returns nullptr if there is no GPU data to synthesize from.
Referenced by G3D::MapComponent< Image >::setStorage().
|
inline |
Largest value in each channel of the image.
|
inline |
Average value in each channel of the image.
|
inline |
Smallest value in each channel of the image.
|
inline |
|
inline |
Returns the GPU image portion of this component, synthesizing it if necessary.
Referenced by G3D::MapComponent< Image >::setStorage().
|
protected |
|
protected |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
True when stats are out of date.
Referenced by G3D::MapComponent< Image >::forceStats(), and G3D::MapComponent< Image >::MapComponent().