X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fimage-loader%2Fatlas-packer.h;h=2d6c95b6440fd3c778228513fa794a5f663bf4a4;hp=bab993f3b66b4329594acec6a8ea82cba25b88d2;hb=6b496cacd2a596235a246c912a6b507a72d67ad4;hpb=3eb60a0aef6b188727b79bdee2e35c575c432a90 diff --git a/dali-toolkit/internal/image-loader/atlas-packer.h b/dali-toolkit/internal/image-loader/atlas-packer.h index bab993f..2d6c95b 100644 --- a/dali-toolkit/internal/image-loader/atlas-packer.h +++ b/dali-toolkit/internal/image-loader/atlas-packer.h @@ -18,7 +18,9 @@ */ #include +#include #include +#include namespace Dali { @@ -99,6 +101,14 @@ public: */ unsigned int GetAvailableArea() const; + /** + * Pack a group of blocks with different sizes, calculate the required packing size and the position of each block. + * @param[in] blockSizes The size list of the blocks . + * @param[out] packPositions The packing position of each block. + * @return The required size to accommodate all the blocks. + */ + static Uint16Pair GroupPack( const Dali::Vector& blockSizes, Dali::Vector& packPositions ); + private: /* @@ -146,11 +156,30 @@ private: */ void DeleteNode( Node* node ); + /** + * Pack a block into the atlas. If there is no enough room, grow the partition tree. + * + * @param[in] blockWidth The width of the block to pack. + * @param[in] blockHeight The height of the block to pack. + * @param[out] packPositionX The x coordinate of the position to pack the block. + * @param[out] packPositionY The y coordinate of the position to pack the block. + */ + void GrowPack( SizeType blockWidth, SizeType blockHeight, + SizeType& packPositionX, SizeType& packPositionY ); + + /** + * Add extra node into the partition tree to accommodate the given block. + * + * @param[in] blockWidth The width of the block to pack. + * @param[in] blockHeight The height of the block to pack. + */ + void GrowNode( SizeType blockWidth, SizeType blockHeight ); + // Undefined - AtlasPacker( const AtlasPacker& imageAtlas); + AtlasPacker( const AtlasPacker& atlasPacker); // Undefined - AtlasPacker& operator=( const AtlasPacker& imageAtlas ); + AtlasPacker& operator=( const AtlasPacker& atlasPacker ); private: