Making DALi public API typesafe using guaranteed types; uint8_t, uint32_t
[platform/core/uifw/dali-core.git] / dali / public-api / rendering / frame-buffer.h
index 8eb5e0e..30c5e6d 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_FRAMEBUFFER_H
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/object/base-handle.h>
 #include <dali/public-api/rendering/texture.h>
@@ -31,10 +34,10 @@ class FrameBuffer;
 }
 
 /**
- * @brief FrameBuffer is a collection of textures that can be used as the destination for rendering
+ * @brief FrameBuffer is a collection of textures that can be used as the destination for rendering.
  * @SINCE_1_1.43
  */
-class DALI_IMPORT_API FrameBuffer : public BaseHandle
+class DALI_CORE_API FrameBuffer : public BaseHandle
 {
 public:
 
@@ -47,6 +50,10 @@ public:
    */
   struct Attachment
   {
+    /**
+     * @brief Enumeration for the bit-mask value.
+     * @SINCE_1_1.45
+     */
     enum Mask
     {
       NONE          = 0,               ///< No attachments are created initially                            @SINCE_1_1.45
@@ -60,29 +67,29 @@ public:
   };
 
   /**
-   * @brief Creates a new FrameBuffer object
+   * @brief Creates a new FrameBuffer object.
    *
    * @SINCE_1_1.43
    * @param[in] width The width of the FrameBuffer
    * @param[in] height The height of the FrameBuffer
-   * @param[in] attachments The attachments comprising the format of the FrameBuffer (the type is int to allow multiple bitmasks to be ORd).
+   * @param[in] attachments The attachments comprising the format of the FrameBuffer (the type is int to allow multiple bitmasks to be ORd)
    * @return A handle to a newly allocated FrameBuffer
    */
-  static FrameBuffer New( unsigned int width, unsigned int height, unsigned int attachments );
+  static FrameBuffer New( uint32_t width, uint32_t height, uint32_t attachments );
 
   /**
-   * @brief Default constructor, creates an empty handle
+   * @brief Default constructor, creates an empty handle.
    */
   FrameBuffer();
 
   /**
-   * @brief Destructor
+   * @brief Destructor.
    * @SINCE_1_1.43
    */
   ~FrameBuffer();
 
   /**
-   * @brief Copy constructor, creates a new handle to the same object
+   * @brief Copy constructor, creates a new handle to the same object.
    *
    * @SINCE_1_1.43
    * @param[in] handle Handle to an object
@@ -90,17 +97,16 @@ public:
   FrameBuffer( const FrameBuffer& handle );
 
   /**
-   * @brief Downcast to a FrameBuffer.
-   *
+   * @brief Downcasts to a FrameBuffer.
+   * If not, the returned handle is left uninitialized.
    * @SINCE_1_1.43
-   * If not the returned handle is left uninitialized.
    * @param[in] handle Handle to an object
    * @return FrameBuffer handle or an uninitialized handle
    */
   static FrameBuffer DownCast( BaseHandle handle );
 
   /**
-   * @brief Assignment operator, changes this handle to point at the same object
+   * @brief Assignment operator, changes this handle to point at the same object.
    *
    * @SINCE_1_1.43
    * @param[in] handle Handle to an object
@@ -115,7 +121,7 @@ public:
    * @SINCE_1_1.43
    * @param[in] texture The texture that will be used as output when rendering
    * @note The texture has to have the same size than the FrameBuffer
-   * otherwise it won't be attached
+   * otherwise it won't be attached.
    */
   void AttachColorTexture( Texture& texture );
 
@@ -128,12 +134,12 @@ public:
    * @param[in] mipmapLevel The mipmap of the texture to be attached
    * @param[in] layer Indicates which layer of a cube map or array texture to attach. Unused for 2D textures
    * @note The specified texture mipmap has to have the same size than the FrameBuffer
-   * otherwise it won't be attached
+   * otherwise it won't be attached.
    */
-  void AttachColorTexture( Texture& texture, unsigned int mipmapLevel, unsigned int layer );
+  void AttachColorTexture( Texture& texture, uint32_t mipmapLevel, uint32_t layer );
 
   /**
-   * @brief Get the color texture used as output in the FrameBuffer
+   * @brief Gets the color texture used as output in the FrameBuffer.
    *
    * @SINCE_1_1.43
    * @returns A handle to the texture used as color output, or an uninitialized handle