IClipMapImageSource Class Reference

#include <clipMapImageSource.h>

Inheritance diagram for IClipMapImageSource:

Inheritance graph
[legend]
List of all members.

Detailed Description

Interface to fetch bits from an image source.

This abstracts the clipmap system from the source of its image bits - might be an Atlas TOC or just a GBitmap, depending on the user of the clipmap.

Note:
Please note that the clip mapping code uses different mipmap level numbering than the GBitmap code. Whereas for GBitmaps miplevel 0 is the original image, it is the 1x1 mipmap for the clip map code.


Public Member Functions

virtual ~IClipMapImageSource ()
virtual const U32 getMipLevelCount () const =0
 Number of mip levels. Used to compensate for varied image source depths.
virtual void setInterestCenter (const Point2I &origin, const U32 radius)=0
 Set a new interest center for this image source.
virtual bool isDataAvailable (const U32 mipLevel, const RectI &region) const =0
 True if the data for the specified mip level and region is available.
virtual bool isTiling () const =0
 If true, this image source tiles itself infinitely; if the image source is tiling then the clipmap can also be tiling.
virtual void copyBits (const U32 mipLevel, const ClipMap::ClipStackEntry *cse, const RectI &srcRegion, U8 *bits, const U32 pitch, const U32 expandonecomponent)=0
 Copy bits from source into a locked texture buffer.
virtual F32 texelOffset () const =0
 This is used to deal with geometry that wants texels to be at vertices vs.


Constructor & Destructor Documentation

virtual IClipMapImageSource::~IClipMapImageSource (  )  [inline, virtual]


Member Function Documentation

virtual const U32 IClipMapImageSource::getMipLevelCount (  )  const [pure virtual]

Number of mip levels. Used to compensate for varied image source depths.

Implemented in AtlasClipMapImageSource, and TerrClipMapImageSource.

virtual void IClipMapImageSource::setInterestCenter ( const Point2I origin,
const U32  radius 
) [pure virtual]

Set a new interest center for this image source.

This gives the source important cues for paging of content.

Implemented in AtlasClipMapImageSource, and TerrClipMapImageSource.

virtual bool IClipMapImageSource::isDataAvailable ( const U32  mipLevel,
const RectI region 
) const [pure virtual]

True if the data for the specified mip level and region is available.

Implemented in AtlasClipMapImageSource, and TerrClipMapImageSource.

virtual bool IClipMapImageSource::isTiling (  )  const [pure virtual]

If true, this image source tiles itself infinitely; if the image source is tiling then the clipmap can also be tiling.

Specifically this means that the source can update a rectangle from any location in image-space as long as its extents are no bigger than the reported size of the image source.

Implemented in AtlasClipMapImageSource, and TerrClipMapImageSource.

virtual void IClipMapImageSource::copyBits ( const U32  mipLevel,
const ClipMap::ClipStackEntry cse,
const RectI srcRegion,
U8 bits,
const U32  pitch,
const U32  expandonecomponent 
) [pure virtual]

Copy bits from source into a locked texture buffer.

Parameters:
mipLevel What mip level of the texture?
cse Information about the clip stack layer we're uploading to. Can be NULL.
srcRegion Region in pixels on this mip level to copy from.
bits Pointer to beginning of locked buffer.
pitch Stride in bytes from start of one row to start of next.

Implemented in AtlasClipMapImageSource, and TerrClipMapImageSource.

virtual F32 IClipMapImageSource::texelOffset (  )  const [pure virtual]

This is used to deal with geometry that wants texels to be at vertices vs.

geometry that wants texels to be in the center of the quad/triangle. Return 0 for centering, and 0.5 for vertex based.

Implemented in AtlasClipMapImageSource, and TerrClipMapImageSource.