Commit fa8a8ab22743984c882e32444ca31010da8c5e3c
1 parent
bdbcb780
Remove alpha-blending-cpu example
It's in dali-test now Change-Id: Ie1758f9e694d8b79350059f222b8076913b2e64a
Showing
5 changed files
with
1 additions
and
168 deletions
examples-reel/dali-examples-reel.cpp
| ... | ... | @@ -41,7 +41,6 @@ int DALI_EXPORT_API main(int argc, char** argv) |
| 41 | 41 | demo.AddExample(Example("animated-images.example", DALI_DEMO_STR_TITLE_ANIMATED_IMAGES)); |
| 42 | 42 | demo.AddExample(Example("animated-shapes.example", DALI_DEMO_STR_TITLE_ANIMATED_SHAPES)); |
| 43 | 43 | demo.AddExample(Example("animated-vector-images.example", DALI_DEMO_STR_TITLE_ANIMATED_VECTOR_IMAGES)); |
| 44 | - demo.AddExample(Example("alpha-blending-cpu.example", DALI_DEMO_STR_TITLE_ALPHA_BLENDING_CPU)); | |
| 45 | 44 | demo.AddExample(Example("arc-visual.example", DALI_DEMO_STR_TITLE_ARC_VISUAL)); |
| 46 | 45 | demo.AddExample(Example("bloom-view.example", DALI_DEMO_STR_TITLE_BLOOM_VIEW)); |
| 47 | 46 | demo.AddExample(Example("builder.example", DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI)); | ... | ... |
examples/alpha-blending-cpu/alpha-blending-cpu-example.cpp deleted
| 1 | -/* | |
| 2 | - * Copyright (c) 2020 Samsung Electronics Co., Ltd. | |
| 3 | - * | |
| 4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 5 | - * you may not use this file except in compliance with the License. | |
| 6 | - * You may obtain a copy of the License at | |
| 7 | - * | |
| 8 | - * http://www.apache.org/licenses/LICENSE-2.0 | |
| 9 | - * | |
| 10 | - * Unless required by applicable law or agreed to in writing, software | |
| 11 | - * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 | - * See the License for the specific language governing permissions and | |
| 14 | - * limitations under the License. | |
| 15 | - * | |
| 16 | - */ | |
| 17 | - | |
| 18 | -#include <dali-toolkit/dali-toolkit.h> | |
| 19 | -#include <cstring> | |
| 20 | - | |
| 21 | -using namespace Dali; | |
| 22 | - | |
| 23 | -namespace | |
| 24 | -{ | |
| 25 | -const char* const IMAGE_PATH_1(DEMO_IMAGE_DIR "people-small-7b.jpg"); // 100x100 | |
| 26 | -const char* const IMAGE_PATH_2(DEMO_IMAGE_DIR "people-medium-7.jpg"); | |
| 27 | -const char* const IMAGE_PATH_3(DEMO_IMAGE_DIR "people-medium-7-rgb565.png"); // is compressed | |
| 28 | -const char* const IMAGE_PATH_4(DEMO_IMAGE_DIR "people-medium-7-masked.png"); // has alpha channel | |
| 29 | -const char* const MASK_IMAGE_PATH_1(DEMO_IMAGE_DIR "store_mask_profile_n.png"); // 300x300 | |
| 30 | -const char* const MASK_IMAGE_PATH_2(DEMO_IMAGE_DIR "store_mask_profile_f.png"); | |
| 31 | -} // namespace | |
| 32 | - | |
| 33 | -class ImageViewAlphaBlendApp : public ConnectionTracker | |
| 34 | -{ | |
| 35 | -public: | |
| 36 | - ImageViewAlphaBlendApp(Application& application) | |
| 37 | - : mApplication(application), | |
| 38 | - mImageCombinationIndex(0) | |
| 39 | - { | |
| 40 | - // Connect to the Application's Init signal | |
| 41 | - mApplication.InitSignal().Connect(this, &ImageViewAlphaBlendApp::Create); | |
| 42 | - } | |
| 43 | - | |
| 44 | - ~ImageViewAlphaBlendApp() | |
| 45 | - { | |
| 46 | - // Nothing to do here; | |
| 47 | - } | |
| 48 | - | |
| 49 | -private: | |
| 50 | - // The Init signal is received once (only) during the Application lifetime | |
| 51 | - void Create(Application& application) | |
| 52 | - { | |
| 53 | - // This creates an image view with one of 3 images, and one of 2 masks. | |
| 54 | - // Clicking the screen will cycle through each combination of mask and image. | |
| 55 | - | |
| 56 | - // Get a handle to the window | |
| 57 | - Window window = application.GetWindow(); | |
| 58 | - window.KeyEventSignal().Connect(this, &ImageViewAlphaBlendApp::OnKeyEvent); | |
| 59 | - window.SetBackgroundColor(Color::WHITE); | |
| 60 | - | |
| 61 | - mImageView = Toolkit::ImageView::New(); | |
| 62 | - | |
| 63 | - mImageView.SetProperty(Actor::Property::SIZE, Vector2(200, 200)); | |
| 64 | - mImageView.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); | |
| 65 | - window.Add(mImageView); | |
| 66 | - | |
| 67 | - mImageLabel = Toolkit::TextLabel::New(); | |
| 68 | - mImageLabel.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER); | |
| 69 | - mImageLabel.SetProperty(Actor::Property::ANCHOR_POINT, ParentOrigin::BOTTOM_CENTER); | |
| 70 | - mImageLabel.SetProperty(Actor::Property::POSITION, Vector3(0.0f, -50.0f, 0.0f)); | |
| 71 | - mImageLabel.SetProperty(Toolkit::TextLabel::Property::TEXT_COLOR, Color::BLACK); | |
| 72 | - window.Add(mImageLabel); | |
| 73 | - | |
| 74 | - mMaskLabel = Toolkit::TextLabel::New(); | |
| 75 | - mMaskLabel.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER); | |
| 76 | - mMaskLabel.SetProperty(Actor::Property::ANCHOR_POINT, ParentOrigin::BOTTOM_CENTER); | |
| 77 | - mMaskLabel.SetProperty(Actor::Property::POSITION, Vector3(0.0f, 0.0f, 0.0f)); | |
| 78 | - mMaskLabel.SetProperty(Toolkit::TextLabel::Property::TEXT_COLOR, Color::BLACK); | |
| 79 | - window.Add(mMaskLabel); | |
| 80 | - | |
| 81 | - LoadImages(); | |
| 82 | - | |
| 83 | - window.TouchedSignal().Connect(this, &ImageViewAlphaBlendApp::OnTouched); | |
| 84 | - } | |
| 85 | - | |
| 86 | - void OnTouched(const TouchEvent& touch) | |
| 87 | - { | |
| 88 | - static bool touched = false; | |
| 89 | - if(touch.GetState(0) == PointState::DOWN) | |
| 90 | - { | |
| 91 | - touched = true; | |
| 92 | - } | |
| 93 | - | |
| 94 | - if(touch.GetState(0) == PointState::UP && touched) | |
| 95 | - { | |
| 96 | - mImageCombinationIndex++; | |
| 97 | - touched = false; | |
| 98 | - LoadImages(); | |
| 99 | - } | |
| 100 | - } | |
| 101 | - | |
| 102 | - void LoadImages() | |
| 103 | - { | |
| 104 | - const char* images[4] = {IMAGE_PATH_1, IMAGE_PATH_2, IMAGE_PATH_3, IMAGE_PATH_4}; | |
| 105 | - const char* masks[2] = {MASK_IMAGE_PATH_1, MASK_IMAGE_PATH_2}; | |
| 106 | - | |
| 107 | - const char* mask = masks[mImageCombinationIndex % 2]; // Cycle through masks | |
| 108 | - const char* image = images[(mImageCombinationIndex / 2) % 4]; // then images | |
| 109 | - | |
| 110 | - Property::Map map; | |
| 111 | - map.Add(Toolkit::Visual::Property::TYPE, Toolkit::Visual::Type::IMAGE); | |
| 112 | - map.Add(Toolkit::ImageVisual::Property::URL, image); | |
| 113 | - map.Add(Toolkit::ImageVisual::Property::ALPHA_MASK_URL, mask); | |
| 114 | - | |
| 115 | - if(mImageCombinationIndex % 2 == 0) | |
| 116 | - { | |
| 117 | - map.Add(Toolkit::ImageVisual::Property::MASK_CONTENT_SCALE, 1.f); | |
| 118 | - map.Add(Toolkit::ImageVisual::Property::CROP_TO_MASK, false); | |
| 119 | - } | |
| 120 | - else | |
| 121 | - { | |
| 122 | - map.Add(Toolkit::ImageVisual::Property::MASK_CONTENT_SCALE, 1.6f); | |
| 123 | - map.Add(Toolkit::ImageVisual::Property::CROP_TO_MASK, true); | |
| 124 | - } | |
| 125 | - | |
| 126 | - mImageView.SetProperty(Toolkit::ImageView::Property::IMAGE, map); | |
| 127 | - | |
| 128 | - mImageLabel.SetProperty(Toolkit::TextLabel::Property::TEXT, strrchr(image, '/')); | |
| 129 | - mMaskLabel.SetProperty(Toolkit::TextLabel::Property::TEXT, strrchr(mask, '/')); | |
| 130 | - } | |
| 131 | - | |
| 132 | - void OnKeyEvent(const KeyEvent& event) | |
| 133 | - { | |
| 134 | - if(event.GetState() == KeyEvent::DOWN) | |
| 135 | - { | |
| 136 | - if(IsKey(event, Dali::DALI_KEY_ESCAPE) || IsKey(event, Dali::DALI_KEY_BACK)) | |
| 137 | - { | |
| 138 | - mApplication.Quit(); | |
| 139 | - } | |
| 140 | - } | |
| 141 | - } | |
| 142 | - | |
| 143 | -private: | |
| 144 | - Application& mApplication; | |
| 145 | - Toolkit::ImageView mImageView; | |
| 146 | - Toolkit::TextLabel mImageLabel; | |
| 147 | - Toolkit::TextLabel mMaskLabel; | |
| 148 | - | |
| 149 | - int mImageCombinationIndex; | |
| 150 | -}; | |
| 151 | - | |
| 152 | -int DALI_EXPORT_API main(int argc, char** argv) | |
| 153 | -{ | |
| 154 | - Application application = Application::New(&argc, &argv); | |
| 155 | - ImageViewAlphaBlendApp test(application); | |
| 156 | - application.MainLoop(); | |
| 157 | - return 0; | |
| 158 | -} |
resources/po/en_GB.po
| ... | ... | @@ -4,9 +4,6 @@ msgstr "Animated Images" |
| 4 | 4 | msgid "DALI_DEMO_STR_TITLE_ANIMATED_SHAPES" |
| 5 | 5 | msgstr "Animated Shapes" |
| 6 | 6 | |
| 7 | -msgid "DALI_DEMO_STR_TITLE_ALPHA_BLENDING_CPU" | |
| 8 | -msgstr "CPU Alpha Blending" | |
| 9 | - | |
| 10 | 7 | msgid "DALI_DEMO_STR_TITLE_ARC_VISUAL" |
| 11 | 8 | msgstr "Arc Visual" |
| 12 | 9 | ... | ... |
resources/po/en_US.po
| ... | ... | @@ -4,9 +4,6 @@ msgstr "Animated Images" |
| 4 | 4 | msgid "DALI_DEMO_STR_TITLE_ANIMATED_SHAPES" |
| 5 | 5 | msgstr "Animated Shapes" |
| 6 | 6 | |
| 7 | -msgid "DALI_DEMO_STR_TITLE_ALPHA_BLENDING_CPU" | |
| 8 | -msgstr "CPU Alpha Blending" | |
| 9 | - | |
| 10 | 7 | msgid "DALI_DEMO_STR_TITLE_ARC_VISUAL" |
| 11 | 8 | msgstr "Arc Visual" |
| 12 | 9 | ... | ... |
shared/dali-demo-strings.h
| 1 | 1 | /* |
| 2 | - * Copyright (c) 2020 Samsung Electronics Co., Ltd. | |
| 2 | + * Copyright (c) 2021 Samsung Electronics Co., Ltd. | |
| 3 | 3 | * |
| 4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | 5 | * you may not use this file except in compliance with the License. |
| ... | ... | @@ -37,7 +37,6 @@ extern "C" |
| 37 | 37 | #define DALI_DEMO_STR_TITLE_ANIMATED_IMAGES dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_ANIMATED_IMAGES") |
| 38 | 38 | #define DALI_DEMO_STR_TITLE_ANIMATED_SHAPES dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_ANIMATED_SHAPES") |
| 39 | 39 | #define DALI_DEMO_STR_TITLE_ANIMATED_VECTOR_IMAGES dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_ANIMATED_VECTOR_IMAGES") |
| 40 | -#define DALI_DEMO_STR_TITLE_ALPHA_BLENDING_CPU dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_ALPHA_BLENDING_CPU") | |
| 41 | 40 | #define DALI_DEMO_STR_TITLE_ARC_VISUAL dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_ARC_VISUAL") |
| 42 | 41 | #define DALI_DEMO_STR_TITLE_BASIC_LIGHT dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_BASIC_LIGHT") |
| 43 | 42 | #define DALI_DEMO_STR_TITLE_BENCHMARK dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_BENCHMARK") |
| ... | ... | @@ -143,7 +142,6 @@ extern "C" |
| 143 | 142 | #define DALI_DEMO_STR_TITLE_ANIMATED_IMAGES "Animated Images" |
| 144 | 143 | #define DALI_DEMO_STR_TITLE_ANIMATED_SHAPES "Animated Shapes" |
| 145 | 144 | #define DALI_DEMO_STR_TITLE_ANIMATED_VECTOR_IMAGES "Animated Vector Images" |
| 146 | -#define DALI_DEMO_STR_TITLE_ALPHA_BLENDING_CPU "CPU Alpha Blending" | |
| 147 | 145 | #define DALI_DEMO_STR_TITLE_ARC_VISUAL "Arc Visual" |
| 148 | 146 | #define DALI_DEMO_STR_TITLE_BASIC_LIGHT "Basic Light" |
| 149 | 147 | #define DALI_DEMO_STR_TITLE_BENCHMARK "ImageView Benchmark" | ... | ... |