diff --git a/src/examples/LoadPng.cpp b/src/examples/PicturePng.cpp similarity index 69% rename from src/examples/LoadPng.cpp rename to src/examples/PicturePng.cpp index 0168d85f..4d85a3db 100644 --- a/src/examples/LoadPng.cpp +++ b/src/examples/PicturePng.cpp @@ -1,4 +1,27 @@ +/* + * Copyright (c) 2020-2021 Samsung Electronics Co., Ltd. All rights reserved. + + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + #include "Common.h" + /************************************************************************/ /* Drawing Commands */ /************************************************************************/ @@ -7,12 +30,13 @@ void tvgDrawCmds(tvg::Canvas* canvas) { if (!canvas) return; - for (int i = 0; i < 40; ++i) { - auto png = tvg::Picture::gen(); - if (png->load(EXAMPLE_DIR"/samsung.png") != tvg::Result::Success) return; - png->translate(i* 5, i * 10); - png->rotate(10 * i); - if (canvas->push(move(png)) != tvg::Result::Success) return; + for (int i = 0; i < 5; ++i) { + auto picture = tvg::Picture::gen(); + if (picture->load(EXAMPLE_DIR"/logo.png") != tvg::Result::Success) return; + picture->translate(i* 150, i * 150); + picture->rotate(30 * i); + picture->scale(0.25); + if (canvas->push(move(picture)) != tvg::Result::Success) return; } } diff --git a/src/examples/PixelImage.cpp b/src/examples/PictureRaw.cpp similarity index 100% rename from src/examples/PixelImage.cpp rename to src/examples/PictureRaw.cpp diff --git a/src/examples/images/logo.png b/src/examples/images/logo.png new file mode 100644 index 00000000..1fefd0f2 Binary files /dev/null and b/src/examples/images/logo.png differ diff --git a/src/examples/images/samsung.png b/src/examples/images/samsung.png deleted file mode 100644 index 814659eb..00000000 Binary files a/src/examples/images/samsung.png and /dev/null differ diff --git a/src/examples/meson.build b/src/examples/meson.build index c1eb16bb..a1dc12b6 100644 --- a/src/examples/meson.build +++ b/src/examples/meson.build @@ -13,13 +13,13 @@ source_file = [ 'GradientStroke.cpp', 'GradientTransform.cpp', 'LinearGradient.cpp', - 'LoadPng.cpp', 'MultiCanvas.cpp', 'MultiShapes.cpp', 'Opacity.cpp', 'PathCopy.cpp', 'Path.cpp', - 'PixelImage.cpp', + 'PicturePng.cpp', + 'PictureRaw.cpp', 'RadialGradient.cpp', 'Scene.cpp', 'SceneTransform.cpp',