G3D::Image3uint8 Class ReferenceCompact storage for RGB 8-bit per channel images.
More...
#include <Image3uint8.h>
Inherits G3D::Map2D< Color3uint8, Color3 >.
List of all members.
|
Public Types |
| typedef Color3 | ComputeType |
| typedef Image3uint8Ref | Ref |
| typedef Color3uint8 | StorageType |
| typedef Image3uint8 | Type |
Public Member Functions |
| Color3 | bicubic (const Vector2 &p) const |
| Color3 | bicubic (const Vector2 &p, WrapMode wrap) const |
| Color3 | bicubic (float x, float y) const |
| Color3 | bicubic (float x, float y, WrapMode wrap) const |
| Color3 | bilinear (const Vector2 &p, WrapMode wrap) const |
| Color3 | bilinear (const Vector2 &p) const |
| Color3 | bilinear (float x, float y) const |
| Color3 | bilinear (float x, float y, WrapMode wrap) const |
| bool | changed () |
| void | flipHorizontal () |
| void | flipVertical () |
| Color3uint8 & | get (const Vector2int16 &p) |
| Color3uint8 & | get (int x, int y) |
| Color3uint8 & | get (int x, int y, WrapMode wrap) |
| const Color3uint8 & | get (const Vector2int16 &p, WrapMode wrap) const |
| const Color3uint8 & | get (const Vector2int16 &p) const |
| const Color3uint8 & | get (int x, int y) const |
| const Color3uint8 & | get (int x, int y, WrapMode wrap) const |
| const Array< Color3uint8 > & | getArray () const |
| Array< Color3uint8 > & | getArray () |
| const Color3uint8 * | getCArray () const |
| Color3uint8 * | getCArray () |
| uint32 | height () const |
| bool | inBounds (const Vector2int16 &v) const |
| bool | inBounds (int x, int y) const |
| void | load (const std::string &filename, GImage::Format fmt=GImage::AUTODETECT) |
| Color3 | nearest (const Vector2 &p) const |
| Color3 | nearest (float x, float y) const |
| Color3 | nearest (float x, float y, WrapMode wrap) const |
| Rect2D | rect2DBounds () const |
| void | ReferenceCountedObject_zeroWeakPointers () |
| void | resize (uint32 newW, uint32 newH) |
| void | save (const std::string &filename, GImage::Format fmt=GImage::AUTODETECT) |
| void | set (int x, int y, const Color3uint8 &v) |
| void | set (int x, int y, const Color3uint8 &v, WrapMode wrap) |
| void | set (const Vector2int16 &p, const Color3uint8 &v) |
| void | setAll (const Color3uint8 &v) |
| void | setChanged (bool c) |
| void | setWrapMode (WrapMode m) |
| Vector2int16 | size () const |
| size_t | sizeInMemory () const |
| uint32 | width () const |
| WrapMode | wrapMode () const |
Static Public Member Functions |
| static Ref | create (int w=0, int h=0, WrapMode wrap=WrapMode::ERROR) |
| static Ref | createEmpty (WrapMode wrap=WrapMode::ERROR) |
| static Ref | createEmpty (int width, int height, WrapMode wrap=WrapMode::ERROR) |
| static Ref | fromArray (const class Color4 *ptr, int width, int height, WrapMode wrap=WrapMode::ERROR) |
| static Ref | fromArray (const class Color3 *ptr, int width, int height, WrapMode wrap=WrapMode::ERROR) |
| static Ref | fromArray (const class Color1 *ptr, int width, int height, WrapMode wrap=WrapMode::ERROR) |
| static Ref | fromArray (const class Color4uint8 *ptr, int width, int height, WrapMode wrap=WrapMode::ERROR) |
| static Ref | fromArray (const class Color3uint8 *ptr, int width, int height, WrapMode wrap=WrapMode::ERROR) |
| static Ref | fromArray (const class Color1uint8 *ptr, int width, int height, WrapMode wrap=WrapMode::ERROR) |
| static Ref | fromFile (const std::string &filename, WrapMode wrap=WrapMode::ERROR, GImage::Format fmt=GImage::AUTODETECT) |
| static Ref | fromGImage (const class GImage &im, WrapMode wrap=WrapMode::ERROR) |
| static Ref | fromImage3 (const ReferenceCountedPointer< class Image3 > &im) |
Public Attributes |
| GMutex | mutex |
| AtomicInt32 | ReferenceCountedObject_refCount |
| _WeakPtrLinkedList * | ReferenceCountedObject_weakPointer |
Protected Member Functions |
| Color3 | bicubic (const Color3 *ctrl, double s) const |
| void | copyArray (const Color4uint8 *src, int w, int h) |
| void | copyArray (const Color3uint8 *src, int w, int h) |
| void | copyArray (const Color1uint8 *src, int w, int h) |
| void | copyArray (const Color4 *src, int w, int h) |
| void | copyArray (const Color3 *src, int w, int h) |
| void | copyArray (const Color1 *src, int w, int h) |
| void | copyGImage (const class GImage &im) |
| const Color3uint8 & | fastGet (int x, int y) const |
| void | fastSet (int x, int y, const Color3uint8 &v) |
| | Image3uint8 (int w, int h, WrapMode wrap) |
| const Color3uint8 & | slowGet (int x, int y, WrapMode wrap) |
Protected Attributes |
| WrapMode | _wrapMode |
| Array< Color3uint8 > | data |
| uint32 | h |
| AtomicInt32 | m_changed |
| uint32 | w |
| Color3uint8 | ZERO |
Detailed Description
Compact storage for RGB 8-bit per channel images.
See also G3D::Image3, G3D::GImage
Member Typedef Documentation
Constructor & Destructor Documentation
| G3D::Image3uint8::Image3uint8 |
( |
int |
w, |
|
|
int |
h, |
|
|
WrapMode |
wrap | |
|
) |
| | [protected] |
Member Function Documentation
Uses Catmull-Rom splines to interpolate between grid values.
Guaranteed to match nearest(x, y) at integers.
Given four control points and a value on the range [0, 1) evaluates the Catmull-rom spline between the times of the middle two control points.
Needs to access elements from (floor(x), floor(y)) to (floor(x) + 1, floor(y) + 1) and will use the wrap mode appropriately (possibly generating out of bounds errors).
Guaranteed to match nearest(x, y) at integers.
Returns true if this map has been written to since the last call to setChanged(false).
This is useful if you are caching a texture map other value that must be recomputed whenever this changes.
| void G3D::Image3uint8::copyArray |
( |
const Color4uint8 * |
src, |
|
|
int |
w, |
|
|
int |
h | |
|
) |
| | [protected] |
| void G3D::Image3uint8::copyArray |
( |
const Color3uint8 * |
src, |
|
|
int |
w, |
|
|
int |
h | |
|
) |
| | [protected] |
| void G3D::Image3uint8::copyArray |
( |
const Color1uint8 * |
src, |
|
|
int |
w, |
|
|
int |
h | |
|
) |
| | [protected] |
| void G3D::Image3uint8::copyArray |
( |
const Color4 * |
src, |
|
|
int |
w, |
|
|
int |
h | |
|
) |
| | [protected] |
| void G3D::Image3uint8::copyArray |
( |
const Color3 * |
src, |
|
|
int |
w, |
|
|
int |
h | |
|
) |
| | [protected] |
| void G3D::Image3uint8::copyArray |
( |
const Color1 * |
src, |
|
|
int |
w, |
|
|
int |
h | |
|
) |
| | [protected] |
| void G3D::Image3uint8::copyGImage |
( |
const class GImage & |
im |
) |
[protected] |
| static Ref G3D::Image3uint8::createEmpty |
( |
WrapMode |
wrap = WrapMode::ERROR |
) |
[static] |
| static Ref G3D::Image3uint8::createEmpty |
( |
int |
width, |
|
|
int |
height, |
|
|
WrapMode |
wrap = WrapMode::ERROR | |
|
) |
| | [static] |
Creates an all-zero width x height image.
| static Ref G3D::Image3uint8::fromArray |
( |
const class Color4 * |
ptr, |
|
|
int |
width, |
|
|
int |
height, |
|
|
WrapMode |
wrap = WrapMode::ERROR | |
|
) |
| | [static] |
| static Ref G3D::Image3uint8::fromArray |
( |
const class Color3 * |
ptr, |
|
|
int |
width, |
|
|
int |
height, |
|
|
WrapMode |
wrap = WrapMode::ERROR | |
|
) |
| | [static] |
| static Ref G3D::Image3uint8::fromArray |
( |
const class Color1 * |
ptr, |
|
|
int |
width, |
|
|
int |
height, |
|
|
WrapMode |
wrap = WrapMode::ERROR | |
|
) |
| | [static] |
| static Ref G3D::Image3uint8::fromArray |
( |
const class Color4uint8 * |
ptr, |
|
|
int |
width, |
|
|
int |
height, |
|
|
WrapMode |
wrap = WrapMode::ERROR | |
|
) |
| | [static] |
| static Ref G3D::Image3uint8::fromArray |
( |
const class Color3uint8 * |
ptr, |
|
|
int |
width, |
|
|
int |
height, |
|
|
WrapMode |
wrap = WrapMode::ERROR | |
|
) |
| | [static] |
| static Ref G3D::Image3uint8::fromArray |
( |
const class Color1uint8 * |
ptr, |
|
|
int |
width, |
|
|
int |
height, |
|
|
WrapMode |
wrap = WrapMode::ERROR | |
|
) |
| | [static] |
| static Ref G3D::Image3uint8::fromFile |
( |
const std::string & |
filename, |
|
|
WrapMode |
wrap = WrapMode::ERROR, |
|
|
GImage::Format |
fmt = GImage::AUTODETECT | |
|
) |
| | [static] |
| static Ref G3D::Image3uint8::fromGImage |
( |
const class GImage & |
im, |
|
|
WrapMode |
wrap = WrapMode::ERROR | |
|
) |
| | [static] |
Get the value at (x, y).
Note that the type of image->get(x, y) is the storage type, not the computation type. If the constructor promoting Storage to Compute rescales values (as, for example Color3(Color3uint8&) does), this will not match the value returned by Map2D::nearest.
Row-major array.
You should call setChanged(true) if you mutate the array.
Returns a pointer to the underlying row-major data.
There is no padding at the end of the row. Be careful--this will be reallocated during a resize. You should call setChanged(true) if you mutate the array.
is (x, y) strictly within the image bounds, or will it trigger some kind of wrap mode
is (x, y) strictly within the image bounds, or will it trigger some kind of wrap mode
| void G3D::Image3uint8::load |
( |
const std::string & |
filename, |
|
|
GImage::Format |
fmt = GImage::AUTODETECT | |
|
) |
| | |
Loads from any of the file formats supported by G3D::GImage.
If there is an alpha channel on the input, it is stripped.
Returns the nearest neighbor.
Pixel values are considered to be at the upper left corner, so image->nearest(x, y) == image(x, y)
Rectangle from (0, 0) to (w, h).
| void G3D::ReferenceCountedObject::ReferenceCountedObject_zeroWeakPointers |
( |
|
) |
[inline, inherited] |
Automatically called immediately before the object is deleted.
This is not called from the destructor because it needs to be invoked before the subclass destructor.
Resizes without clearing, leaving garbage.
| void G3D::Image3uint8::save |
( |
const std::string & |
filename, |
|
|
GImage::Format |
fmt = GImage::AUTODETECT | |
|
) |
| | |
Set/unset the changed flag.
Number of bytes occupied by the image data and this structure.
Handles the exceptional cases from get.
Member Data Documentation
0 if no mutating method has been invoked since the last call to setChanged();
Although Map2D is not threadsafe (except for the setChanged() method), you can use this mutex to create your own threadsafe access to a Map2D.
Not used by the default implementation.
The long name is to keep this from accidentally conflicting with a subclass's variable name.
Do not use or explicitly manipulate this value--its type may change in the future and is not part of the supported API.
Linked list of all weak pointers that reference this (some may be on the stack!).
Do not use or explicitly manipulate this value.
The documentation for this class was generated from the following file:
Generated on Thu Aug 2 11:40:46 2007 for G3D by
1.5.2
Hosted by
|