[Tizen] Add codes for Dali Windows Backend
[platform/core/uifw/dali-core.git] / dali / internal / common / image-sampler.h
index 2491b78..836253e 100644 (file)
@@ -32,29 +32,35 @@ namespace Internal
  */
 namespace ImageSampler
 {
+   /**
+    * Bitshift values
+    */
+   enum
+   {
+     MINIFY_BIT_SHIFT  = 0,
+     MAGNIFY_BIT_SHIFT = 4,
+     UWRAP_BIT_SHIFT   = 8,
+     VWRAP_BIT_SHIFT   = 12
+   };
 
-  /**
-   * Determine if the minify component of the bitfield is assigned.
-   *
-   * @param[in] bitfield The packed sampler bitfield pattern.
-   * @return Return if the minify component is assigned or not.
-   */
-  bool IsMinifyAssigned( unsigned int bitfield );
-
-  /**
-   * Determine if the magnify component of the bitfield is assigned.
-   *
-   * @param[in] bitfield The packed sampler bitfield pattern.
-   * @return Return if the magnify component is assigned or not.
-   */
-  bool IsMagnifyAssigned( unsigned int bitfield );
+   /**
+    * Mask values
+    */
+   enum
+   {
+     MASK_MINIFY_FILTER  = 0x000F,
+     MASK_MAGNIFY_FILTER = 0x00F0,
+     MASK_UWRAP_MODE     = 0x0F00,
+     MASK_VWRAP_MODE     = 0xF000,
+   };
 
-  /**
-   * @brief Return a sampler bitfield with default settings.
-   *
-   * @return Return the default sampler bit pattern.
-   */
-  unsigned int DefaultOptions();
+   /**
+    * Precalculate default sampler bitfield
+    */
+   enum
+   {
+     DEFAULT_BITFIELD = (Dali::FilterMode::DEFAULT<<MINIFY_BIT_SHIFT) | (Dali::FilterMode::DEFAULT<<MAGNIFY_BIT_SHIFT) | (Dali::WrapMode::DEFAULT<<UWRAP_BIT_SHIFT) | (Dali::WrapMode::DEFAULT<<VWRAP_BIT_SHIFT)
+   };
 
   /**
    * @brief Pack the filter mode into a bitfield.
@@ -63,7 +69,7 @@ namespace ImageSampler
    * @param[in] magnify The magnification filter.
    * @return Return the packed bitfield.
    */
-   unsigned int PackBitfield( FilterMode::Type minify, FilterMode::Type magnify );
+   unsigned int PackBitfield( FilterMode::Type minify, FilterMode::Type magnify, WrapMode::Type uWrap = WrapMode::DEFAULT, WrapMode::Type vWrap = WrapMode::DEFAULT );
 
    /**
    * @brief Return the minification filter from a packed bitfield.
@@ -79,6 +85,20 @@ namespace ImageSampler
    */
    FilterMode::Type GetMagnifyFilterMode( unsigned int bitfield );
 
+   /**
+    * @brief Return the wrap mode in x direction from a packed bitfield.
+    *
+    * @return Return the wrap mode.
+    */
+   WrapMode::Type GetUWrapMode( unsigned int bitfield );
+
+   /**
+    * @brief Return the wrap mode in y direction from a packed bitfield.
+    *
+    * @return Return the wrap mode.
+    */
+   WrapMode::Type GetVWrapMode( unsigned int bitfield );
+
 } // namespace ImageSampler
 
 } // namespace Internal