Purge underscored header file barriers
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / image-loader / atlas-packer.h
index bab993f..b356124 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_ATLAS_PACKER_H__
-#define __DALI_TOOLKIT_ATLAS_PACKER_H__
+#ifndef DALI_TOOLKIT_ATLAS_PACKER_H
+#define DALI_TOOLKIT_ATLAS_PACKER_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,7 +18,9 @@
  */
 
 #include <stdint.h>
+#include <dali/public-api/common/dali-vector.h>
 #include <dali/public-api/math/rect.h>
+#include <dali/public-api/math/uint-16-pair.h>
 
 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<Uint16Pair>& blockSizes, Dali::Vector<Uint16Pair>& 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:
 
@@ -166,4 +195,4 @@ private:
 
 } // namespace Dali
 
-#endif /* __DALI_TOOLKIT_ATLAS_PACKER_H__ */
+#endif // DALI_TOOLKIT_ATLAS_PACKER_H