--- /dev/null
+# Image View with YUV plane loading Test Example
+
+## Overview
+
+Test application that YUV format jpg images load with 3-planes and combine the result at GPU time.
+
+Basically, jpg image loaded by single buffer.
+But if we want to reduce buffer's memory, we can turn on below environments and load YUV images
+as each planes.
+
+```shell
+$ export DALI_LOAD_IMAGE_YUV_PLANES=1
+$ export DALI_ENABLE_DECODE_JPEG_TO_YUV_444=0 # Do not use YUV plane loading for YUV444 format
+$ export DALI_ENABLE_DECODE_JPEG_TO_YUV_420=1 # Let we use YUV plane loading for YUV420 format
+```
+It will be helpful when we want to reduce GPU memory for YUV format images.
+
+We can also test that YUV loading successed when `DevelImageVisual::Property::FAST_TRACK_UPLOADING` is true.
+
+For this demo application, we turn on every YUV format load as 3-planes.
+
+@TODO : Need to collect more kinds of YUV!
+ Required resources : GRAY, YUV_440, YUV_411, YUV_441
+
+
+Press `R` key to test Attach / Detach.
+
+Press `T` key to test Detach and Attach immediatly. (Test wether the YUV result cached or not.)
+
+
+
+## Developer Note
+
+If you want to see that we upload images 3 planes,
+
+Please build `dali-core`, `dali-adaptor`, `dali-toolkit` and `dali-demo` as `Debug` option, include `-DENABLE_TRACE=ON` options.
+
+```shell
+$ cd ~/dali-core/build/tizen/
+$ cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_TRACE=ON
+$ make install -j9
+... And so on to dali-adaptor, dali-toolkit, dali-demo.
+```
+
+After build finished, set environment values like below
+
+```shell
+$ export DALI_PRINT_LOG_LEVEL=0
+$ export DALI_TRACE_ENABLE_PRINT_LOG=1
+$ export DALI_TRACE_IMAGE_PERFORMANCE_MARKER=1
+```
+Check that `b:3` print well both `DALI_IMAGE_LOADING_TASK` and `DALI_IMAGE_FAST_TRACK_UPLOADING_TASK` case.
+
+`b:` means the number of bitmaps what we loaded.
+
+```shell
+$ ./image-view-yuv.example
+...
+$ DEBUG: DALI: trace-manager-impl-generic.cpp: LogContext(84) > BEGIN: DALI_IMAGE_LOADING_TASK [u:.../gallery-small-1.jpg]
+$ DEBUG: DALI: trace-manager-impl-generic.cpp: LogContext(88) > END: DALI_IMAGE_LOADING_TASK [d:0.499ms m:0 i:0 b:3 s:128x128 p:1 u:.../gallery-small-1.jpg]
+$ DEBUG: DALI: trace-manager-impl-generic.cpp: LogContext(84) > BEGIN: DALI_IMAGE_FAST_TRACK_UPLOADING_TASK [u:.../gallery-small-1.jpg]
+$ DEBUG: DALI: trace-manager-impl-generic.cpp: LogContext(88) > END: DALI_IMAGE_FAST_TRACK_UPLOADING_TASK [d:0.267ms b:3 s:128x128 p:1 u:.../gallery-small-1.jpg]
+```
+
+If you want to check YUV image cached or not, set `LOG_TEXTURE_MANAGER` environment value as `3`, and see `RequestLoadInternal` logs.
+
+```shell
+$ export LOG_TEXTURE_MANAGER=3
+$ ./image-view-yuv.example
+...
+$ INFO: DALI: texture-manager-impl.cpp: RequestLoadInternal(563) > TextureManager::RequestLoad( url=/home/hpichu/work/dali-env/opt/share/com.samsung.dali-demo/res/images/gallery-small-1.jpg size=0x0 observer=0x5583e2c820f8 ) New texture, cacheIndex:0, textureId=0, maskTextureId=-1, frameindex=0 orientCorrect=0 premultiply=1 # Request new loading
+...
+$ INFO: DALI: texture-manager-impl.cpp: RequestLoadInternal(552) > TextureManager::RequestLoad( url=/home/hpichu/work/dali-env/opt/share/com.samsung.dali-demo/res/images/gallery-small-1.jpg size=0x0 observer=0x5583e2c820f8 ) Using cached texture id@0, textureId=0, maskTextureId=-1, prevTextureId=-1, frameindex=0, orientCorrect=0, premultiplied=1, refCount=2 # Use cached texture
+
+```
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2025 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/visuals/image-visual-properties-devel.h>
+#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
+#include <string.h>
+
+using namespace Dali;
+using namespace Dali::Toolkit;
+
+namespace
+{
+struct YuvImageInfo
+{
+ const char* formatName;
+ const char* fileName;
+};
+
+static const YuvImageInfo IMAGE_INFOS[] =
+ {
+ {"YUV444", DEMO_IMAGE_DIR "gallery-small-1.jpg"},
+ {"YUV420", DEMO_IMAGE_DIR "gallery-small-1-yuv420.jpg"},
+ {"YUV422", DEMO_IMAGE_DIR "woodEffect.jpg"},
+ ///< TODO : Need to collect more kinds of YUV!
+ /// Required resources : GRAY, YUV_440, YUV_411, YUV_441
+};
+static const int NUM_IMAGE_INFOS = (sizeof(IMAGE_INFOS) / sizeof(IMAGE_INFOS[0]));
+
+} // unnamed namespace
+
+// This example shows how to display YUV images with ImageView.
+//
+class ImageYuvController : public ConnectionTracker
+{
+public:
+ ImageYuvController(Application& application)
+ : mApplication(application),
+ mLastPoint(1.f)
+ {
+ // Connect to the Application's Init signal
+ mApplication.InitSignal().Connect(this, &ImageYuvController::Create);
+ }
+
+ ~ImageYuvController()
+ {
+ }
+
+ // The Init signal is received once (only) during the Application lifetime
+ void Create(Application& application)
+ {
+ // Get a handle to the window
+ mWindow = application.GetWindow();
+
+ mWindow.KeyEventSignal().Connect(this, &ImageYuvController::OnKeyEvent);
+ mWindow.SetBackgroundColor(Color::WHITE);
+ mWindow.GetRootLayer().TouchedSignal().Connect(this, &ImageYuvController::OnTouch);
+
+ mTableView = Toolkit::TableView::New(NUM_IMAGE_INFOS, 3);
+ mTableView.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
+ mTableView.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT);
+ mTableView.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ mTableView.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ mWindow.Add(mTableView);
+
+ for(unsigned int index = 0u; index < NUM_IMAGE_INFOS; ++index)
+ {
+ TextLabel label = TextLabel::New();
+ label.SetProperty(TextLabel::Property::MULTI_LINE, true);
+ label.SetProperty(TextLabel::Property::TEXT, IMAGE_INFOS[index].formatName);
+
+ mTableView.SetFitHeight(index);
+ mTableView.AddChild(label, Toolkit::TableView::CellPosition(index, 0));
+
+ ImageView image = ImageView::New(IMAGE_INFOS[index].fileName);
+ {
+ Property::Map map;
+ map.Add(Visual::Property::TYPE, Visual::IMAGE);
+ map.Add(ImageVisual::Property::URL, IMAGE_INFOS[index].fileName);
+ map.Add(ImageVisual::Property::ORIENTATION_CORRECTION, false); ///< Ensure to make we load YUV plane
+
+ image.SetProperty(ImageView::Property::IMAGE, map);
+ }
+ image.SetProperty(Actor::Property::SIZE, Vector2(128.0f, 128.0f));
+ mTableView.AddChild(image, Toolkit::TableView::CellPosition(index, 1));
+
+ ImageView roundedFastTrackImage = ImageView::New();
+ roundedFastTrackImage.SetProperty(Actor::Property::SIZE, Vector2(128.0f, 128.0f));
+ {
+ Property::Map map;
+ map.Add(Visual::Property::TYPE, Visual::IMAGE);
+ map.Add(ImageVisual::Property::URL, IMAGE_INFOS[index].fileName);
+ map.Add(DevelVisual::Property::CORNER_RADIUS, 0.5f);
+ map.Add(DevelVisual::Property::CORNER_RADIUS_POLICY, Visual::Transform::Policy::RELATIVE);
+ map.Add(ImageVisual::Property::ORIENTATION_CORRECTION, false); ///< Ensure to make we load YUV plane
+ map.Add(DevelImageVisual::Property::FAST_TRACK_UPLOADING, true);
+
+ roundedFastTrackImage.SetProperty(ImageView::Property::IMAGE, map);
+ }
+ mTableView.AddChild(roundedFastTrackImage, Toolkit::TableView::CellPosition(index, 2));
+ }
+
+ {
+ TextLabel label = TextLabel::New();
+ label.SetProperty(TextLabel::Property::TEXT, "Press \'R\' key to Attach / Detach images\nPress \'T\' key to Detach and Attach images immediatly\n");
+ label.SetProperty(TextLabel::Property::MULTI_LINE, true);
+ label.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER);
+ label.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER);
+ mWindow.Add(label);
+ }
+ }
+
+ void OnKeyEvent(const KeyEvent& event)
+ {
+ if(event.GetState() == KeyEvent::DOWN)
+ {
+ if(IsKey(event, Dali::DALI_KEY_ESCAPE) || IsKey(event, Dali::DALI_KEY_BACK))
+ {
+ mApplication.Quit();
+ }
+ else if(event.GetKeyName() == "r" || event.GetKeyName() == "R")
+ {
+ if(mTableView.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE))
+ {
+ mTableView.Unparent();
+ }
+ else
+ {
+ mWindow.Add(mTableView);
+ }
+ }
+ else if(event.GetKeyName() == "t" || event.GetKeyName() == "T")
+ {
+ if(mTableView.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE))
+ {
+ mTableView.Unparent();
+ mWindow.Add(mTableView);
+ }
+ else
+ {
+ mWindow.Add(mTableView);
+ }
+ }
+ }
+ }
+
+ bool OnTouch(Actor actor, const TouchEvent& event)
+ {
+ if(1u == event.GetPointCount())
+ {
+ const PointState::Type state = event.GetState(0);
+
+ const float screenPoint = event.GetScreenPosition(0).y;
+
+ if(PointState::DOWN == state)
+ {
+ mLastPoint = screenPoint;
+ }
+ else if(PointState::MOTION == state)
+ {
+ if(mTableView)
+ {
+ mTableView.TranslateBy(Vector3(0.0f, screenPoint - mLastPoint, 0.0f));
+ mLastPoint = screenPoint;
+ }
+ }
+ }
+
+ return true;
+ }
+
+private:
+ Application& mApplication;
+ Window mWindow;
+ TableView mTableView;
+ float mLastPoint;
+};
+
+int DALI_EXPORT_API main(int argc, char** argv)
+{
+ // Set YUV format load + rendering environment, before application class create.
+ setenv("DALI_LOAD_IMAGE_YUV_PLANES", "1", 1);
+
+ // Turn on each format load as YUV or not.
+ setenv("DALI_ENABLE_DECODE_JPEG_TO_YUV_444", "1", 1);
+ setenv("DALI_ENABLE_DECODE_JPEG_TO_YUV_422", "1", 1);
+ setenv("DALI_ENABLE_DECODE_JPEG_TO_YUV_420", "1", 1);
+ // TJSAMP_GRAY already supported
+ setenv("DALI_ENABLE_DECODE_JPEG_TO_YUV_440", "1", 1);
+ setenv("DALI_ENABLE_DECODE_JPEG_TO_YUV_411", "1", 1);
+ setenv("DALI_ENABLE_DECODE_JPEG_TO_YUV_441", "1", 1);
+
+ Application application = Application::New(&argc, &argv);
+ ImageYuvController test(application);
+ application.MainLoop();
+ return 0;
+}