// EXTERNAL INCLUDES
#include <stdint.h>
#include <dali/public-api/common/dali-vector.h>
-#include <dali/public-api/geometry/mesh-data.h>
-#include <dali/public-api/images/atlas.h>
+#include <dali/devel-api/geometry/mesh-data.h>
+#include <dali/devel-api/images/atlas.h>
#include <dali/public-api/images/buffer-image.h>
namespace Dali
typedef SizeType ImageId;
static const bool MESH_OPTIMIZE = true;
+ struct AtlasSize
+ {
+ SizeType mWidth; // width of the atlas in pixels
+ SizeType mHeight; // height of the atlas in pixels
+ SizeType mBlockWidth; // width of a block in pixels
+ SizeType mBlockHeight; // height of a block in pixels
+ };
+
+ /**
+ * Metrics structures to describe Atlas Manager state
+ *
+ */
+ struct AtlasMetricsEntry
+ {
+ AtlasSize mSize; // size of atlas and blocks
+ SizeType mBlocksUsed; // number of blocks used in the atlas
+ SizeType mTotalBlocks; // total blocks used by atlas
+ Pixel::Format mPixelFormat; // pixel format of the atlas
+ };
+
+ struct Metrics
+ {
+ SizeType mAtlasCount; // number of atlases
+ SizeType mTextureMemoryUsed; // texture memory used by atlases
+ Dali::Vector< AtlasMetricsEntry > mAtlasMetrics; // container of atlas information
+ };
+
/**
* Create an AtlasManager handle; this can be initialised with AtlasManager::New()
* Calling member functions with an uninitialised handle is not allowed.
/**
* @brief Create a blank atlas of specific dimensions and pixel format with a certain block size
*
- * @param width desired atlas width in pixels
- * @param height desired atlas height in pixels
- * @param blockWidth block width to use in atlas in pixels
- * @param blockHeight block height to use in atlas in pixels
- * @param pixelformat format of a pixel in atlas
+ * @param[in] size desired atlas dimensions
+ * @param[in] pixelformat format of a pixel in atlas
*
* @return atlas Id
*/
- AtlasId CreateAtlas( SizeType width,
- SizeType height,
- SizeType blockWidth,
- SizeType blockHeight,
- Pixel::Format pixelformat = Pixel::RGBA8888 );
+ AtlasId CreateAtlas( const AtlasSize& size, Pixel::Format pixelformat = Pixel::RGBA8888 );
/**
* @brief Set the policy on failure to add an image to an atlas
/**
* @brief Get the BufferImage containing an atlas
*
- * @param atlas AtlasId returned when atlas was created
+ * @param[in] atlas AtlasId returned when atlas was created
+ *
* @return Atlas Handle
*/
Dali::Atlas GetAtlasContainer( AtlasId atlas ) const;
/**
* @brief Get the Id of the atlas containing an image
*
- * @param id ImageId
+ * @param[in] id ImageId
+ *
* @return Atlas Id
*/
AtlasId GetAtlas( ImageId id );
-
/**
- * @brief Get the size of the blocks used in an atlas
+ * @brief Get the current size of an atlas
*
- * @param atlas AtlasId
- * @return width and height of the blocks used
+ * @param[in] atlas AtlasId
+ *
+ * @return AtlasSize structure for the atlas
*/
- Vector2 GetBlockSize( AtlasId atlas );
+ const AtlasSize& GetAtlasSize( AtlasId atlas );
/**
* @brief Get the number of blocks available in an atlas
*
- * @param atlas AtlasId
+ * @param[in] atlas AtlasId
+ *
* @return Number of blocks free in this atlas
*/
SizeType GetFreeBlocks( AtlasId atlas );
/**
* @brief Sets the pixel area of any new atlas and also the individual block size
*
- * @param size pixel area of atlas
+ * @param[in] size Atlas size structure
+ *
* @param blockSize pixel area in atlas for a block
*/
- void SetAtlasSize( const Vector2& size,
- const Vector2& blockSize );
+ void SetNewAtlasSize( const AtlasSize& size );
/**
* @brief Get the number of atlases created
/**
* @brief Get the pixel format used by an atlas
*
- * @param atlas AtlasId
+ * @param[in] atlas AtlasId
+ *
* @return Pixel format used by this atlas
*/
Pixel::Format GetPixelFormat( AtlasId atlas );
+ /**
+ * @brief Fill in a metrics structure showing current status of this Atlas Manager
+ *
+ * @param[in] metrics metrics structure to be filled
+ */
+ void GetMetrics( Metrics& metrics );
+
private:
explicit DALI_INTERNAL AtlasManager(Internal::AtlasManager *impl);