This is the documentation for Enlighten.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

class Geo::GeoV128Texture

    └>Geo::GeoRefCount

A really simple texture where all elements are float vectors.

Functions

Name Description
~GeoRefCount()

Virtual destructor required to make sure that the concrete class destructor gets called.

AddRef()

Increments the reference count and return new value.

ClearToValue(v128)

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.

CopyUnscaledWithDestinationMask(GeoV128Texture *, GeoV128Texture *, GeoRect, GeoRect, GeoV128Texture *)

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(s32, s32)

Create gives you back an uninitialised (values undefined!) texture of the appropriate size with a ref count of 1.

DeserialiseFrom(FILE *)

Serialise in and out.

Downsample(GeoV128Texture *)

Dest is half the size of source. Takes the average of the four values.

DrawRect(s32, s32, s32, s32, v128)

For debugging purposes.

Exists(s32, s32)

Return true if [x,y] is contained with the image.

GeoRefCount()

Default constructor. The reference count is initially zero.

GetHeight()

Return the height of this image.

GetPixels()

Return a raw pointer to the start of the pixel array.

GetPixels()

Return a const raw pointer to the start of the pixel array.

GetWidth()

Return the width of this image.

IsValid()

Checks if this texture has valid data.

MaskedIn(s32, s32)

Return true if (x, y) is in bounds for this texture, and the value of the x component is positive.

MultiplyBy(v128)

Multiply all pixels in this texture by the given value.

OutputToPFM(const char *)

Output for debugging purposes.

Release()

Decrements the reference count, deleting the object if it reaches zero.

Sample(s32, s32)

Return the Sample at position [x,y].

SerialiseTo(FILE *)

Serialise in and out.

SetSample(s32, s32, v128)

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.

  • No labels