Add demo app with external texture 58/316758/3
authorEunki, Hong <eunkiki.hong@samsung.com>
Wed, 18 Dec 2024 02:16:50 +0000 (11:16 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Wed, 18 Dec 2024 10:23:35 +0000 (19:23 +0900)
Add demo application for external texture and masking

Change-Id: I262c3e19663ee74da4503704d40014d81d6365b8
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
com.samsung.dali-demo.xml
examples-reel/dali-examples-reel.cpp
examples/image-view-external-texture/README.md [new file with mode: 0644]
examples/image-view-external-texture/image-view-external-texture-example.cpp [new file with mode: 0644]
examples/image-view-external-texture/image-view-external-texture.png [new file with mode: 0644]
resources/po/en_GB.po
resources/po/en_US.po
resources/po/ko.po
shared/dali-demo-strings.h

index bdb7821f0c792ac1d8e5d06fe9f9dbe54c5a1079..a52460cd35a4c57ea07c695e45e43b236a69a7e2 100644 (file)
        <ui-application appid="image-view-encoded-image-buffer.example" exec="/usr/apps/com.samsung.dali-demo/bin/image-view-encoded-image-buffer.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
                <label>Image View Encoded Image Buffer</label>
        </ui-application>
+       <ui-application appid="image-view-external-texture.example" exec="/usr/apps/com.samsung.dali-demo/bin/image-view-external-texture.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
+               <label>Image View External Texture</label>
+       </ui-application>
        <ui-application appid="image-view-url.example" exec="/usr/apps/com.samsung.dali-demo/bin/image-view-url.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
                <label>Image View URL</label>
        </ui-application>
index 9f487190bacf82b4d5e00a11f38664bc9556e852..d701af0a234d6367851bc0cbd3ce3c82b9d8c061 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -72,6 +72,7 @@ int DALI_EXPORT_API main(int argc, char** argv)
   demo.AddExample(Example("image-view.example", DALI_DEMO_STR_TITLE_IMAGE_VIEW));
   demo.AddExample(Example("image-view-alpha-blending.example", DALI_DEMO_STR_TITLE_IMAGE_VIEW_ALPHA_BLENDING));
   demo.AddExample(Example("image-view-encoded-image-buffer.example", DALI_DEMO_STR_TITLE_IMAGE_VIEW_ENCODED_IMAGE_BUFFER));
+  demo.AddExample(Example("image-view-external-texture.example", DALI_DEMO_STR_TITLE_IMAGE_VIEW_EXTERNAL_TEXTURE));
   demo.AddExample(Example("image-view-pixel-area.example", DALI_DEMO_STR_TITLE_IMAGE_VIEW_PIXEL_AREA));
   demo.AddExample(Example("image-view-svg.example", DALI_DEMO_STR_TITLE_IMAGE_VIEW_SVG));
   demo.AddExample(Example("image-view-url.example", DALI_DEMO_STR_TITLE_IMAGE_VIEW_URL));
diff --git a/examples/image-view-external-texture/README.md b/examples/image-view-external-texture/README.md
new file mode 100644 (file)
index 0000000..0d83014
--- /dev/null
@@ -0,0 +1,15 @@
+# Image View External Texture Test Example
+
+This is a various test example for ExternalTexture and EncodedImageBuffer.
+
+There are 3 types of images in the scene ; Regular Image / Animated Image (webp) / Sequencial Image.
+
+Also, there are 3 types of image url ; Regular URL / ExternalTexture generated ImageUrl / EncodedImageBuffer generated ImageUrl.
+
+ - First row buttons change the masking image url. (Include invalid url to check error handling.)
+ - Second row buttons change the image type.
+ - Third row buttons change the masking image type.
+
+We can check whether some pair of case didn't work properly or not.
+
+![](./image-view-external-texture.png)
\ No newline at end of file
diff --git a/examples/image-view-external-texture/image-view-external-texture-example.cpp b/examples/image-view-external-texture/image-view-external-texture-example.cpp
new file mode 100644 (file)
index 0000000..65d781b
--- /dev/null
@@ -0,0 +1,462 @@
+/*
+ * Copyright (c) 2024 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/table-view/table-view.h>
+#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
+#include <dali-toolkit/devel-api/visuals/animated-image-visual-actions-devel.h>
+#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
+#include <dali-toolkit/devel-api/visuals/visual-actions-devel.h>
+#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
+#include <dali/dali.h>
+#include <dali/devel-api/adaptor-framework/image-loading.h>
+#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
+#include <dali/devel-api/adaptor-framework/window-devel.h>
+#include <dali/integration-api/debug.h>
+#include <string>
+
+#include "shared/view.h"
+
+using namespace Dali;
+using namespace Dali::Toolkit;
+
+namespace
+{
+const char* BACKGROUND_IMAGE(DEMO_IMAGE_DIR "background-gradient.jpg");
+const char* TOOLBAR_IMAGE(DEMO_IMAGE_DIR "top-bar.png");
+const char* APPLICATION_TITLE("Image view w. External Textures");
+
+const char* IMAGE_PATH[] = {
+  DEMO_IMAGE_DIR "gallery-small-23.jpg",
+  DEMO_IMAGE_DIR "gallery-small-14.jpg",
+  DEMO_IMAGE_DIR "gallery-small-17.jpg",
+  DEMO_IMAGE_DIR "wood.png"};
+const unsigned int NUMBER_OF_RESOURCES = sizeof(IMAGE_PATH) / sizeof(char*);
+static_assert(NUMBER_OF_RESOURCES > 1);
+
+const char* ANIMATED_IMAGE_PATH = DEMO_IMAGE_DIR "dog-anim.webp";
+
+const char* MASK_IMAGE_PATH[] = {
+  DEMO_IMAGE_DIR "mask.png",
+  DEMO_IMAGE_DIR "application-icon-2.png",
+  DEMO_IMAGE_DIR "cluster-image-shadow.png",
+  "invalid.png"};
+const unsigned int NUMBER_OF_MASK_RESOURCES = sizeof(MASK_IMAGE_PATH) / sizeof(char*);
+
+std::string EXAMPLE_INSTRUCTIONS =
+  "Instructions: Change button cycles through different kinds of image url, and mask image url.";
+
+enum UrlType
+{
+  REGULAR_IMAGE,
+  EXTERNAL_TEXTURE,
+  ENCODED_IMAGE_BUFFER,
+  NUMBER_OF_URL_TYPE,
+};
+
+enum ImageVisualType
+{
+  NORMAL,
+  ANIMATED_IMAGE,
+  IMAGE_ARRAY,
+  NUMBER_OF_VISUAL_TYPE,
+};
+
+enum CellPlacement
+{
+  TOP_BUTTON,
+  MID_BUTTON,
+  LOWER_BUTTON,
+  IMAGE,
+  NUMBER_OF_ROWS
+};
+
+const char* BUTTON_LABEL_SUFFIX[NUMBER_OF_URL_TYPE] = {
+  "Normal",
+  "External",
+  "Encoded",
+};
+
+void ChangeUrlTypeToNextUrlType(UrlType& urlType)
+{
+  switch(urlType)
+  {
+    case UrlType::REGULAR_IMAGE:
+    {
+      urlType = UrlType::EXTERNAL_TEXTURE;
+      break;
+    }
+    case UrlType::EXTERNAL_TEXTURE:
+    {
+      urlType = UrlType::ENCODED_IMAGE_BUFFER;
+      break;
+    }
+    case UrlType::ENCODED_IMAGE_BUFFER:
+    default:
+    {
+      urlType = UrlType::REGULAR_IMAGE;
+      break;
+    }
+  }
+}
+
+ImageVisualType GetVisualTypeFromButton(Toolkit::Button button)
+{
+  std::string  buttonName = button.GetProperty<std::string>(Dali::Actor::Property::NAME);
+  unsigned int index      = 0;
+
+  if(buttonName != "")
+  {
+    index = std::stoul(buttonName);
+  }
+
+  return static_cast<ImageVisualType>(index);
+}
+
+EncodedImageBuffer ConvertFileToEncodedImageBuffer(const char* url)
+{
+  EncodedImageBuffer buffer;
+  FILE*              fp;
+  fp = fopen(url, "rb");
+  if(fp != NULL)
+  {
+    fseek(fp, 0, SEEK_END);
+    size_t                size = ftell(fp);
+    Dali::Vector<uint8_t> data;
+    data.Resize(size);
+    fseek(fp, 0, SEEK_SET);
+    size_t realSize = fread(data.Begin(), sizeof(uint8_t), size, fp);
+    fclose(fp);
+    data.Resize(realSize);
+    buffer = EncodedImageBuffer::New(data);
+  }
+  return buffer;
+}
+
+std::vector<ImageUrl> gImageUrlHolder;
+
+std::string ConvertFileToImageUrlString(const char* url, UrlType type)
+{
+  ImageUrl imageUrl;
+
+  bool converted = false;
+
+  switch(type)
+  {
+    case REGULAR_IMAGE:
+    default:
+    {
+      return std::string(url);
+    }
+    case EXTERNAL_TEXTURE:
+    {
+      Devel::PixelBuffer pixelBuffer = LoadImageFromFile(url);
+      if(pixelBuffer)
+      {
+        PixelData pixelData = Devel::PixelBuffer::Convert(pixelBuffer);
+
+        imageUrl = Dali::Toolkit::Image::GenerateUrl(pixelData);
+      }
+      converted = true;
+      break;
+    }
+    case ENCODED_IMAGE_BUFFER:
+    {
+      EncodedImageBuffer rawBuffer = ConvertFileToEncodedImageBuffer(url);
+
+      if(rawBuffer)
+      {
+        imageUrl  = Dali::Toolkit::Image::GenerateUrl(rawBuffer);
+        converted = true;
+      }
+      break;
+    }
+  }
+
+  if(converted && imageUrl)
+  {
+    // Keep reference count for image url.
+    gImageUrlHolder.push_back(imageUrl);
+    return imageUrl.GetUrl();
+  }
+  else
+  {
+    switch(type)
+    {
+      default:
+      {
+        return "";
+      }
+      case EXTERNAL_TEXTURE:
+      {
+        return "dali://invalid";
+      }
+      case ENCODED_IMAGE_BUFFER:
+      {
+        return "enbuf://invalid";
+      }
+    }
+  }
+}
+
+} // namespace
+
+class ImageViewController : public ConnectionTracker
+{
+public:
+  ImageViewController(Application& application)
+  : mApplication(application),
+    mCurrentPositionToggle(0, 0),
+    mCurrentPositionImage(0, 0)
+  {
+    // Connect to the Application's Init signal
+    mApplication.InitSignal().Connect(this, &ImageViewController::Create);
+  }
+
+  ~ImageViewController()
+  {
+    // Nothing to do here
+  }
+
+  void Create(Application& application)
+  {
+    // The Init signal is received once (only) during the Application lifetime
+
+    // Creates a default view with a default tool bar.
+    // The view is added to the window.
+    mContentLayer = DemoHelper::CreateView(application,
+                                           mView,
+                                           mToolBar,
+                                           BACKGROUND_IMAGE,
+                                           TOOLBAR_IMAGE,
+                                           APPLICATION_TITLE);
+
+    // Create a table view to show a pair of buttons above each image.
+    mTable = Toolkit::TableView::New(CellPlacement::NUMBER_OF_ROWS, NUMBER_OF_VISUAL_TYPE);
+    mTable.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+    mTable.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+    mTable.SetResizePolicy(ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS);
+    Vector3 offset(0.9f, 0.70f, 0.0f);
+    mTable.SetProperty(Actor::Property::SIZE_MODE_FACTOR, offset);
+    mTable.SetFitHeight(CellPlacement::TOP_BUTTON);
+    mTable.SetFitHeight(CellPlacement::MID_BUTTON);
+    mTable.SetFitHeight(CellPlacement::LOWER_BUTTON);
+    mContentLayer.Add(mTable);
+
+    Toolkit::TextLabel instructions = Toolkit::TextLabel::New(EXAMPLE_INSTRUCTIONS);
+    instructions.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
+    instructions.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER);
+    instructions.SetProperty(Actor::Property::POSITION_Y, -50.0f);
+    instructions.SetProperty(Toolkit::TextLabel::Property::ENABLE_AUTO_SCROLL, true);
+    instructions.SetProperty(Toolkit::TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 10);
+    mContentLayer.Add(instructions);
+
+    for(unsigned int x = 0; x < NUMBER_OF_VISUAL_TYPE; x++)
+    {
+      std::string s = std::to_string(x);
+
+      // Set changeable counter and toggle for each ImageView
+      mImageViewMaskUrlImageIndex[x] = 0;
+      mImageViewUrlType[x]           = UrlType::REGULAR_IMAGE;
+      mImageViewMaskUrlType[x]       = UrlType::REGULAR_IMAGE;
+
+      Toolkit::PushButton button = Toolkit::PushButton::New();
+      button.SetProperty(Toolkit::Button::Property::LABEL, "Mask image change");
+      button.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER);
+      button.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER);
+      button.ClickedSignal().Connect(this, &ImageViewController::ChangeMaskImageUrl);
+      button.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
+      button.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT);
+      button.SetProperty(Dali::Actor::Property::NAME, s);
+      mTable.AddChild(button, Toolkit::TableView::CellPosition(CellPlacement::TOP_BUTTON, x));
+
+      Toolkit::PushButton button2 = Toolkit::PushButton::New();
+      button2.SetProperty(Toolkit::Button::Property::LABEL, std::string("Image-") + std::string(BUTTON_LABEL_SUFFIX[UrlType::REGULAR_IMAGE]));
+      button2.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER);
+      button2.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER);
+      button2.ClickedSignal().Connect(this, &ImageViewController::ChangeImageUrlType);
+      button2.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
+      button2.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT);
+      button2.SetProperty(Dali::Actor::Property::NAME, s);
+      mTable.AddChild(button2, Toolkit::TableView::CellPosition(CellPlacement::MID_BUTTON, x));
+
+      Toolkit::PushButton button3 = Toolkit::PushButton::New();
+      button3.SetProperty(Toolkit::Button::Property::LABEL, std::string("Mask-") + std::string(BUTTON_LABEL_SUFFIX[UrlType::REGULAR_IMAGE]));
+      button3.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER);
+      button3.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER);
+      button3.ClickedSignal().Connect(this, &ImageViewController::ChangeMaskImageUrlType);
+      button3.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
+      button3.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT);
+      button3.SetProperty(Dali::Actor::Property::NAME, s);
+      mTable.AddChild(button3, Toolkit::TableView::CellPosition(CellPlacement::LOWER_BUTTON, x));
+
+      mImageViews[x] = Toolkit::ImageView::New();
+      mImageViews[x].SetProperty(Toolkit::ImageView::Property::IMAGE, CreateImageVisualPropertyMap(static_cast<ImageVisualType>(x)));
+      mImageViews[x].SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+      mImageViews[x].SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+      mImageViews[x].SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+      mTable.AddChild(mImageViews[x], Toolkit::TableView::CellPosition(CellPlacement::IMAGE, x));
+    }
+
+    application.GetWindow().KeyEventSignal().Connect(this, &ImageViewController::OnKeyEvent);
+  }
+
+private:
+  Property::Map CreateImageVisualPropertyMap(ImageVisualType visualType)
+  {
+    Property::Map imagePropertyMap;
+    uint32_t      buttonIndex = static_cast<uint32_t>(visualType);
+
+    switch(visualType)
+    {
+      case ImageVisualType::NORMAL:
+      default:
+      {
+        imagePropertyMap.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE);
+        imagePropertyMap.Insert(Toolkit::ImageVisual::Property::URL, ConvertFileToImageUrlString(IMAGE_PATH[0], mImageViewUrlType[buttonIndex]));
+        break;
+      }
+      case ImageVisualType::ANIMATED_IMAGE:
+      {
+        imagePropertyMap.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::ANIMATED_IMAGE);
+        imagePropertyMap.Insert(Toolkit::ImageVisual::Property::URL, ConvertFileToImageUrlString(ANIMATED_IMAGE_PATH, mImageViewUrlType[buttonIndex]));
+        imagePropertyMap.Insert(Toolkit::DevelImageVisual::Property::LOOP_COUNT, 3);
+        imagePropertyMap.Insert(Toolkit::DevelImageVisual::Property::STOP_BEHAVIOR, Toolkit::DevelImageVisual::StopBehavior::FIRST_FRAME);
+        break;
+      }
+      case ImageVisualType::IMAGE_ARRAY:
+      {
+        imagePropertyMap.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::ANIMATED_IMAGE);
+        Property::Array array;
+        for(uint32_t i = 0; i < NUMBER_OF_RESOURCES; ++i)
+        {
+          array.PushBack(ConvertFileToImageUrlString(IMAGE_PATH[i], mImageViewUrlType[buttonIndex]));
+        }
+        imagePropertyMap.Insert(Toolkit::ImageVisual::Property::URL, array);
+        imagePropertyMap.Insert(Toolkit::ImageVisual::Property::FRAME_DELAY, 300.0f);
+        imagePropertyMap.Insert(Toolkit::DevelImageVisual::Property::LOOP_COUNT, 3);
+        imagePropertyMap.Insert(Toolkit::DevelImageVisual::Property::STOP_BEHAVIOR, Toolkit::DevelImageVisual::StopBehavior::FIRST_FRAME);
+        break;
+      }
+    }
+
+    if(mImageViewMaskUrlImageIndex[buttonIndex] < NUMBER_OF_MASK_RESOURCES)
+    {
+      imagePropertyMap.Insert(Toolkit::ImageVisual::Property::ALPHA_MASK_URL, ConvertFileToImageUrlString(MASK_IMAGE_PATH[mImageViewMaskUrlImageIndex[buttonIndex]], mImageViewMaskUrlType[buttonIndex]));
+      imagePropertyMap.Insert(Toolkit::ImageVisual::Property::CROP_TO_MASK, false);
+    }
+    return imagePropertyMap;
+  }
+
+  bool ChangeMaskImageUrl(Toolkit::Button button)
+  {
+    ImageVisualType visualType  = GetVisualTypeFromButton(button);
+    uint32_t        buttonIndex = static_cast<uint32_t>(visualType);
+
+    ++mImageViewMaskUrlImageIndex[buttonIndex];
+    if(mImageViewMaskUrlImageIndex[buttonIndex] >= NUMBER_OF_MASK_RESOURCES + 1)
+    {
+      mImageViewMaskUrlImageIndex[buttonIndex] = 0;
+    }
+
+    DALI_LOG_RELEASE_INFO("Change mask image url for [%d]'s image, mask url : %s\n", buttonIndex, mImageViewMaskUrlImageIndex[buttonIndex] < NUMBER_OF_MASK_RESOURCES ? MASK_IMAGE_PATH[mImageViewMaskUrlImageIndex[buttonIndex]] : "(none)");
+
+    Toolkit::ImageView imageView = mImageViews[buttonIndex];
+    imageView.SetProperty(Toolkit::ImageView::Property::IMAGE, CreateImageVisualPropertyMap(visualType));
+
+    gImageUrlHolder.clear();
+
+    return true;
+  }
+
+  bool ChangeImageUrlType(Toolkit::Button button)
+  {
+    ImageVisualType visualType  = GetVisualTypeFromButton(button);
+    uint32_t        buttonIndex = static_cast<uint32_t>(visualType);
+
+    ChangeUrlTypeToNextUrlType(mImageViewUrlType[buttonIndex]);
+
+    button.SetProperty(Toolkit::Button::Property::LABEL, std::string("Image-") + std::string(BUTTON_LABEL_SUFFIX[mImageViewUrlType[buttonIndex]]));
+
+    DALI_LOG_RELEASE_INFO("Change image url type for [%d]'s image, url type : %s\n", buttonIndex, BUTTON_LABEL_SUFFIX[mImageViewUrlType[buttonIndex]]);
+
+    Toolkit::ImageView imageView = mImageViews[buttonIndex];
+    imageView.SetProperty(Toolkit::ImageView::Property::IMAGE, CreateImageVisualPropertyMap(visualType));
+
+    gImageUrlHolder.clear();
+
+    return true;
+  }
+
+  bool ChangeMaskImageUrlType(Toolkit::Button button)
+  {
+    ImageVisualType visualType  = GetVisualTypeFromButton(button);
+    uint32_t        buttonIndex = static_cast<uint32_t>(visualType);
+
+    ChangeUrlTypeToNextUrlType(mImageViewMaskUrlType[buttonIndex]);
+
+    button.SetProperty(Toolkit::Button::Property::LABEL, std::string("Mask-") + std::string(BUTTON_LABEL_SUFFIX[mImageViewMaskUrlType[buttonIndex]]));
+
+    DALI_LOG_RELEASE_INFO("Change mask image url type for [%d]'s image, mask url type : %s\n", buttonIndex, BUTTON_LABEL_SUFFIX[mImageViewMaskUrlType[buttonIndex]]);
+
+    Toolkit::ImageView imageView = mImageViews[buttonIndex];
+    imageView.SetProperty(Toolkit::ImageView::Property::IMAGE, CreateImageVisualPropertyMap(visualType));
+
+    gImageUrlHolder.clear();
+
+    return true;
+  }
+
+  /**
+   * Main key event handler
+   */
+  void OnKeyEvent(const KeyEvent& event)
+  {
+    if(event.GetState() == KeyEvent::DOWN)
+    {
+      if(IsKey(event, DALI_KEY_ESCAPE) || IsKey(event, DALI_KEY_BACK))
+      {
+        mApplication.Quit();
+      }
+    }
+  }
+
+private:
+  Application& mApplication;
+
+  Toolkit::Control mView;         ///< The View instance.
+  Toolkit::ToolBar mToolBar;      ///< The View's Toolbar.
+  Layer            mContentLayer; ///< Content layer
+
+  Toolkit::TableView mTable;
+  Toolkit::ImageView mImageViews[NUMBER_OF_VISUAL_TYPE];
+
+  uint32_t mImageViewMaskUrlImageIndex[NUMBER_OF_VISUAL_TYPE];
+  UrlType  mImageViewUrlType[NUMBER_OF_VISUAL_TYPE];
+  UrlType  mImageViewMaskUrlType[NUMBER_OF_VISUAL_TYPE];
+
+  Toolkit::TableView::CellPosition mCurrentPositionToggle;
+  Toolkit::TableView::CellPosition mCurrentPositionImage;
+};
+
+int DALI_EXPORT_API main(int argc, char** argv)
+{
+  Application         application = Application::New(&argc, &argv, DEMO_THEME_PATH);
+  ImageViewController test(application);
+  application.MainLoop();
+  return 0;
+}
diff --git a/examples/image-view-external-texture/image-view-external-texture.png b/examples/image-view-external-texture/image-view-external-texture.png
new file mode 100644 (file)
index 0000000..df1f600
Binary files /dev/null and b/examples/image-view-external-texture/image-view-external-texture.png differ
index e47ed79e6679c50c721df4af15460ebd4ce838f7..541d6b7a0094a2ac07ffcd3880114228861848e5 100755 (executable)
@@ -127,6 +127,9 @@ msgstr "Image View Alpha Blending"
 msgid "DALI_DEMO_STR_TITLE_IMAGE_VIEW_ENCODED_IMAGE_BUFFER"
 msgstr "Image View Encoded Image Buffer"
 
+msgid "DALI_DEMO_STR_TITLE_IMAGE_VIEW_EXTERNAL_TEXTURE"
+msgstr "Image View External Texture"
+
 msgid "DALI_DEMO_STR_TITLE_IMAGE_VIEW_PIXEL_AREA"
 msgstr "Image View Pixel Area"
 
index ae175b628b40d4edda9c9efe6dfe71091c91cf07..d43fdf5769faf52eb1e3b6ac651f17b019379e03 100755 (executable)
@@ -133,6 +133,9 @@ msgstr "Image View Alpha Blending"
 msgid "DALI_DEMO_STR_TITLE_IMAGE_VIEW_ENCODED_IMAGE_BUFFER"
 msgstr "Image View Encoded Image Buffer"
 
+msgid "DALI_DEMO_STR_TITLE_IMAGE_VIEW_EXTERNAL_TEXTURE"
+msgstr "Image View External Texture"
+
 msgid "DALI_DEMO_STR_TITLE_IMAGE_VIEW_PIXEL_AREA"
 msgstr "Image View Pixel Area"
 
index bdc0e30e23ea3d90cd17ceae18d33af7f0d2361c..ecaf5afbaf0885d8af5971689025581f48da0d23 100755 (executable)
@@ -73,6 +73,9 @@ msgstr "이미지 뷰 알파 블렌딩"
 msgid "DALI_DEMO_STR_TITLE_IMAGE_VIEW_ENCODED_IMAGE_BUFFER"
 msgstr "이미지 뷰 인코딩 버퍼"
 
+msgid "DALI_DEMO_STR_TITLE_IMAGE_VIEW_EXTERNAL_TEXTURE"
+msgstr "이미지 뷰 외부 텍스쳐"
+
 msgid "DALI_DEMO_STR_TITLE_IMAGE_VIEW_PIXEL_AREA"
 msgstr "이미지 뷰 픽셀 영역"
 
index 160ad0b06ce50cb77952e5a0928d2e01044ac0b3..82e03ebe63c8acf9ce1e9cbe38fa196a6c261453 100644 (file)
@@ -82,6 +82,7 @@ extern "C"
 #define DALI_DEMO_STR_TITLE_IMAGE_VIEW dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_IMAGE_VIEW")
 #define DALI_DEMO_STR_TITLE_IMAGE_VIEW_ALPHA_BLENDING dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_IMAGE_VIEW_ALPHA_BLENDING")
 #define DALI_DEMO_STR_TITLE_IMAGE_VIEW_ENCODED_IMAGE_BUFFER dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_IMAGE_VIEW_ENCODED_IMAGE_BUFFER")
+#define DALI_DEMO_STR_TITLE_IMAGE_VIEW_EXTERNAL_TEXTURE dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_IMAGE_VIEW_EXTERNAL_TEXTURE")
 #define DALI_DEMO_STR_TITLE_IMAGE_VIEW_PIXEL_AREA dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_IMAGE_VIEW_PIXEL_AREA")
 #define DALI_DEMO_STR_TITLE_IMAGE_VIEW_SVG dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_IMAGE_VIEW_SVG")
 #define DALI_DEMO_STR_TITLE_IMAGE_VIEW_URL dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_IMAGE_VIEW_URL")
@@ -207,6 +208,7 @@ extern "C"
 #define DALI_DEMO_STR_TITLE_IMAGE_VIEW "Image View"
 #define DALI_DEMO_STR_TITLE_IMAGE_VIEW_ALPHA_BLENDING "Image View Alpha Blending"
 #define DALI_DEMO_STR_TITLE_IMAGE_VIEW_ENCODED_IMAGE_BUFFER "Image View Encoded Image Buffer"
+#define DALI_DEMO_STR_TITLE_IMAGE_VIEW_EXTERNAL_TEXTURE "Image View External Texture"
 #define DALI_DEMO_STR_TITLE_IMAGE_VIEW_PIXEL_AREA "Image View Pixel Area"
 #define DALI_DEMO_STR_TITLE_IMAGE_VIEW_SVG "Image View SVG"
 #define DALI_DEMO_STR_TITLE_IMAGE_VIEW_URL "Image View URL"