This is the documentation for Enlighten.
class Geo GeoV128Texture
class Geo::GeoV128Texture
A really simple texture where all elements are float vectors.
Functions
Name | Description |
|---|---|
Virtual destructor required to make sure that the concrete class destructor gets called. | |
Increments the reference count and return new value. | |
Clear all pixels in this texture to the given value. | |
CopyUnscaled(GeoV128Texture *, GeoV128Texture *, GeoRect, GeoRect) | Copy a block from one texture to a different texture. |
CopyUnscaledFromBuffer(v128 *, u32, GeoV128Texture *, GeoRect, GeoRect) | Copies from a buffer of V128s with given pitch, rather than a texture. |
Copy a block from one texture to a different texture, with a mask specified in the destination texture space. | |
CopyUnscaledWithSourceMask(GeoV128Texture *, GeoV128Texture *, GeoRect, GeoRect, GeoV128Texture *) | Copy a block from one texture to a different texture, with a mask specified in the source texture space. |
Create gives you back an uninitialised (values undefined!) texture of the appropriate size with a ref count of 1. | |
Serialise in and out. | |
Dest is half the size of source. Takes the average of the four values. | |
For debugging purposes. | |
Return true if [x,y] is contained with the image. | |
Default constructor. The reference count is initially zero. | |
Return the height of this image. | |
Return a raw pointer to the start of the pixel array. | |
Return a const raw pointer to the start of the pixel array. | |
Return the width of this image. | |
Checks if this texture has valid data. | |
Return true if (x, y) is in bounds for this texture, and the value of the x component is positive. | |
Multiply all pixels in this texture by the given value. | |
Output for debugging purposes. | |
Decrements the reference count, deleting the object if it reaches zero. | |
Return the Sample at position [x,y]. | |
Serialise in and out. | |
For debugging purposes. |
Variables
Name | Description |
|---|---|
s32 m_RefCount | The reference count, once it reaches zero the object deletes itself. |
virtual Geo::GeoRefCount::~GeoRefCount
public: virtual ~GeoRefCount()
Virtual destructor required to make sure that the concrete class destructor gets called.
s32 Geo::GeoRefCount::AddRef
public: s32 AddRef()
Increments the reference count and return new value.
Returns
New value of reference count.
void Geo::GeoV128Texture::ClearToValue
public: void ClearToValue
(
v128 v
)
Clear all pixels in this texture to the given value.
static bool Geo::GeoV128Texture::CopyUnscaled
public: bool CopyUnscaled
(
GeoV128Texture * source,
GeoV128Texture * target,
GeoRect sourceBB,
GeoRect targetBB
)
Copy a block from one texture to a different texture.
It expects a one to one correspondence between the pixels in each bounding box - no scaling is applied and it will return false if this isn't met. All parameters must be valid.
static bool Geo::GeoV128Texture::CopyUnscaledFromBuffer
public: bool CopyUnscaledFromBuffer
(
v128 * source,
u32 sourcePitch,
GeoV128Texture * target,
GeoRect sourceBB,
GeoRect targetBB
)
Copies from a buffer of V128s with given pitch, rather than a texture.
Otherwise the same as CopyUnscaled
static bool Geo::GeoV128Texture::CopyUnscaledWithDestinationMask
public: bool CopyUnscaledWithDestinationMask
(
GeoV128Texture * source,
GeoV128Texture * target,
GeoRect sourceBB,
GeoRect targetBB,
GeoV128Texture * mask
)
Copy a block from one texture to a different texture, with a mask specified in the destination texture space.
Same as CopyUnscaled but only copies where the mask is non-zero in the X co-ord.
static bool Geo::GeoV128Texture::CopyUnscaledWithSourceMask
public: bool CopyUnscaledWithSourceMask
(
GeoV128Texture * source,
GeoV128Texture * target,
GeoRect sourceBB,
GeoRect targetBB,
GeoV128Texture * mask
)
Copy a block from one texture to a different texture, with a mask specified in the source texture space.
Same as CopyUnscaled but only copies where the mask is non-zero in the X co-ord.
static GeoV128Texture* Geo::GeoV128Texture::Create
public: GeoV128Texture * Create
(
s32 w,
s32 h
)
Create gives you back an uninitialised (values undefined!) texture of the appropriate size with a ref count of 1.
So no need to AddRef it immediately.
void Geo::GeoV128Texture::DeserialiseFrom
public: void DeserialiseFrom
(
FILE * fp
)
Serialise in and out.
void Geo::GeoV128Texture::Downsample
public: void Downsample
(
GeoV128Texture * dest
) const
Dest is half the size of source. Takes the average of the four values.
void Geo::GeoV128Texture::DrawRect
public: void DrawRect
(
s32 x,
s32 y,
s32 w,
s32 h,
v128 value
)
For debugging purposes.
bool Geo::GeoV128Texture::Exists
public: bool Exists
(
s32 x,
s32 y
) const
Return true if [x,y] is contained with the image.
Geo::GeoRefCount::GeoRefCount
public: GeoRefCount()
Default constructor. The reference count is initially zero.
s32 Geo::GeoV128Texture::GetHeight
public: s32 GetHeight() const
Return the height of this image.
v128* Geo::GeoV128Texture::GetPixels
public: v128 * GetPixels()
Return a raw pointer to the start of the pixel array.
const v128* Geo::GeoV128Texture::GetPixels
public: const v128 * GetPixels() const
Return a const raw pointer to the start of the pixel array.
s32 Geo::GeoV128Texture::GetWidth
public: s32 GetWidth() const
Return the width of this image.
bool Geo::GeoV128Texture::IsValid
public: bool IsValid() const
Checks if this texture has valid data.
bool Geo::GeoV128Texture::MaskedIn
public: bool MaskedIn
(
s32 x,
s32 y
) const
Return true if (x, y) is in bounds for this texture, and the value of the x component is positive.
void Geo::GeoV128Texture::MultiplyBy
public: void MultiplyBy
(
v128 multiplicand
)
Multiply all pixels in this texture by the given value.
bool Geo::GeoV128Texture::OutputToPFM
public: bool OutputToPFM
(
const char * filename
) const
Output for debugging purposes.
s32 Geo::GeoRefCount::Release
public: s32 Release()
Decrements the reference count, deleting the object if it reaches zero.
Returns
Returns reference count after decrement. 0 if deleted.
v128 Geo::GeoV128Texture::Sample
public: v128 Sample
(
s32 x,
s32 y
) const
Return the Sample at position [x,y].
bool Geo::GeoV128Texture::SerialiseTo
public: bool SerialiseTo
(
FILE * fp
) const
Serialise in and out.
void Geo::GeoV128Texture::SetSample
public: void SetSample
(
s32 x,
s32 y,
v128 value
)
For debugging purposes.