├── tests
├── CMakeLists.txt
├── manual
│ ├── manual.pro
│ ├── CMakeLists.txt
│ ├── featcheck
│ │ ├── howtofind.txt
│ │ ├── CMakeLists.txt
│ │ └── featcheck.pro
│ ├── testApp
│ │ ├── main.cpp
│ │ ├── stroke.json
│ │ ├── trim_path1.json
│ │ ├── rect_anchor_moved_static2.json
│ │ ├── path_and_ellipse.json
│ │ ├── shape_circle.json
│ │ ├── trim_path_parallel2.json
│ │ ├── shape_static.json
│ │ ├── shape_complex2.json
│ │ ├── rect_skew.json
│ │ ├── testApp.pro
│ │ ├── rect_skew_axis.json
│ │ ├── rect_rotate_shape.json
│ │ ├── rect_rotate.json
│ │ ├── rect_gfill_linear.json
│ │ ├── easing_rect_translate.json
│ │ ├── rect_gfill_radial.json
│ │ ├── gradient_fill.json
│ │ ├── rect_anchor_std_anim.json
│ │ ├── shape_bezier_simple.json
│ │ ├── repeater1.json
│ │ ├── rect_scale_anchors_on_layer.json
│ │ ├── rect_scale_anchors_on_rect.json
│ │ ├── shape_complex.json
│ │ ├── rect_scale.json
│ │ ├── linked_layers.json
│ │ ├── trim_path2_offset.json
│ │ ├── trim_path2_sequential.json
│ │ └── rect_move_bezier.json
│ └── html
│ │ ├── index.html
│ │ └── content.json
├── auto
│ ├── CMakeLists.txt
│ ├── qml
│ │ ├── qml.qrc
│ │ ├── tst_qml.cpp
│ │ ├── CMakeLists.txt
│ │ └── data
│ │ │ └── rec_pos_col_opa.json
│ └── lottie
│ │ ├── CMakeLists.txt
│ │ ├── vectorimage
│ │ └── data
│ │ │ ├── vectorimage.qml
│ │ │ └── vectorimage_noassumetrustedsource.qml
│ │ └── shape
│ │ ├── shapelayer
│ │ ├── data
│ │ │ ├── shape_active_60to120.json
│ │ │ ├── shape_matte_alphaclip.json
│ │ │ ├── shape_matte_lumaclip.json
│ │ │ ├── shape_matte_alphainvclip.json
│ │ │ └── shape_matte_lumainvclip.json
│ │ └── CMakeLists.txt
│ │ ├── transform
│ │ ├── data
│ │ │ ├── transform_static.json
│ │ │ └── transform_animated.json
│ │ └── CMakeLists.txt
│ │ ├── CMakeLists.txt
│ │ ├── fill
│ │ ├── CMakeLists.txt
│ │ └── data
│ │ │ ├── fill_hidden.json
│ │ │ ├── fill_static_red_100.json
│ │ │ └── fill_animated_red100_green0.json
│ │ ├── path
│ │ ├── CMakeLists.txt
│ │ └── data
│ │ │ ├── freeform_triangle_static.json
│ │ │ ├── freeform_direction.json
│ │ │ ├── freeform_hidden.json
│ │ │ ├── freeform_curve_static.json
│ │ │ ├── freeform_roto_static.json
│ │ │ ├── freeform_triangle_animated.json
│ │ │ ├── freeform_curve_animated.json
│ │ │ └── freeform_roto_animated.json
│ │ ├── rect
│ │ ├── CMakeLists.txt
│ │ └── data
│ │ │ ├── rect_hidden.json
│ │ │ ├── rect_direction.json
│ │ │ ├── rect_static_30x30_5050_rad0.json
│ │ │ └── rect_animated_30x30_1515_rad0_to_50x50_7575_rad25.json
│ │ ├── stroke
│ │ ├── CMakeLists.txt
│ │ └── data
│ │ │ ├── stroke_hidden.json
│ │ │ └── stroke_static_blue_2.json
│ │ ├── ellipse
│ │ ├── CMakeLists.txt
│ │ └── data
│ │ │ ├── ellipse_direction.json
│ │ │ ├── ellipse_hidden.json
│ │ │ ├── ellipse_static_100x80.json
│ │ │ └── ellipse_animated_100x80at00to200x40at50100.json
│ │ ├── repeater
│ │ ├── CMakeLists.txt
│ │ └── data
│ │ │ ├── repeater_hidden.json
│ │ │ ├── repeater_static.json
│ │ │ └── repeater_animated.json
│ │ ├── trimpath
│ │ ├── CMakeLists.txt
│ │ └── data
│ │ │ ├── trimpath_hidden.json
│ │ │ ├── trimpath_static_20to80.json
│ │ │ └── trimpath_animated_2080_0_to_0060_3x30.json
│ │ ├── shapetransform
│ │ ├── CMakeLists.txt
│ │ └── data
│ │ │ ├── shapetransform_static.json
│ │ │ └── shapetransform_animated.json
│ │ └── repeatertransform
│ │ ├── CMakeLists.txt
│ │ └── data
│ │ ├── repeater_transform_static.json
│ │ └── repeater_transform_animated.json
├── baseline
│ ├── data
│ │ ├── docsamples
│ │ │ ├── blep.png
│ │ │ ├── sound.mp3
│ │ │ ├── text_shape.png
│ │ │ ├── thumbs-up.png
│ │ │ ├── layers-solid.json
│ │ │ └── image.json
│ │ ├── Ignore
│ │ ├── REUSE.toml
│ │ ├── qt_attribution.json
│ │ └── original
│ │ │ ├── skew_yaxis.json
│ │ │ ├── skew_bothaxes.json
│ │ │ ├── skew_xaxis.json
│ │ │ ├── split_positions.json
│ │ │ ├── trim_path1.json
│ │ │ ├── rect_anchor_moved_static2.json
│ │ │ ├── trim_path_parallel2.json
│ │ │ ├── shape_circle.json
│ │ │ ├── path_and_ellipse.json
│ │ │ ├── shape_static.json
│ │ │ ├── shape_complex2.json
│ │ │ ├── rect_skew.json
│ │ │ ├── rect_skew_axis.json
│ │ │ ├── rect_rotate_shape.json
│ │ │ ├── rotate_anchor.json
│ │ │ ├── rect_rotate.json
│ │ │ ├── rect_gfill_linear.json
│ │ │ ├── easing_rect_translate.json
│ │ │ ├── rect_gfill_radial.json
│ │ │ ├── gradient_fill.json
│ │ │ ├── rect_anchor_std_anim.json
│ │ │ ├── shape_bezier_simple.json
│ │ │ ├── stroke.json
│ │ │ ├── repeater1.json
│ │ │ ├── rect_scale_anchors_on_rect.json
│ │ │ ├── rect_scale_anchors_on_layer.json
│ │ │ ├── shape_complex.json
│ │ │ ├── rect_scale.json
│ │ │ ├── linked_layers.json
│ │ │ ├── trim_path2_sequential.json
│ │ │ ├── trim_path2_offset.json
│ │ │ └── rect_move_bezier.json
│ ├── scenegrabber
│ │ ├── checkered.png
│ │ └── CMakeLists.txt
│ ├── CMakeLists.txt
│ └── lottie
│ │ └── CMakeLists.txt
└── libfuzzer
│ └── qml
│ └── qlottieanimation
│ └── parse
│ ├── CMakeLists.txt
│ └── main.cpp
├── .tag
├── examples
├── lottie
│ ├── qtlottieviewer
│ │ ├── qtquickcontrols2.conf
│ │ ├── doc
│ │ │ ├── images
│ │ │ │ └── qtlottieviewerexample.png
│ │ │ └── src
│ │ │ │ └── qtlottieviewerexample.qdoc
│ │ ├── REUSE.toml
│ │ ├── qt_attribution.json
│ │ ├── main.cpp
│ │ └── CMakeLists.txt
│ ├── lottietoqml
│ │ ├── doc
│ │ │ └── images
│ │ │ │ ├── lottietoqmlexample.png
│ │ │ │ └── lottietoqmlexample-closeup.png
│ │ └── main.cpp
│ └── CMakeLists.txt
└── CMakeLists.txt
├── src
├── plugins
│ ├── vectorimageformats
│ │ ├── lottie
│ │ │ ├── lottie.json
│ │ │ └── CMakeLists.txt
│ │ └── CMakeLists.txt
│ └── CMakeLists.txt
├── qml
│ ├── CMakeLists.txt
│ └── doc
│ │ └── src
│ │ ├── external-resources.qdoc
│ │ └── qtlottievectorimagehelpers.qdoc
├── vectorimagehelpers
│ ├── CMakeLists.txt
│ ├── qquicklayeritem_p.h
│ └── qquicklayeritem.cpp
├── lottiegenerator
│ └── CMakeLists.txt
├── CMakeLists.txt
└── lottie
│ ├── qbeziereasing_p.h
│ ├── qlottieprecomplayer_p.h
│ ├── qbeziereasing.cpp
│ ├── qlottieshapelayer_p.h
│ ├── qlottiegroup_p.h
│ ├── qlottiefilleffect_p.h
│ ├── qlottieimage_p.h
│ ├── qlottieroot_p.h
│ ├── qlottierepeatertransform_p.h
│ ├── qlottiefill_p.h
│ ├── qlottieshape_p.h
│ ├── qlottierepeater_p.h
│ ├── qlottieround_p.h
│ ├── qlottieellipse_p.h
│ ├── CMakeLists.txt
│ ├── qlottierepeater.cpp
│ ├── qlottierect_p.h
│ ├── qlottieshapetransform_p.h
│ ├── qlottiestroke_p.h
│ ├── qlottieflatlayers_p.h
│ ├── qlottietrimpath_p.h
│ └── qlottiepolystar_p.h
├── .gitreview
├── tools
├── CMakeLists.txt
└── lottietoqml
│ ├── main.qml
│ └── CMakeLists.txt
├── dependencies.yaml
├── .cmake.conf
├── LICENSES
├── LicenseRef-Qt-Commercial.txt
├── Qt-GPL-exception-1.0.txt
├── MIT.txt
├── BSD-3-Clause.txt
└── LicenseRef-Lottie-Simple-License-9.13.21.txt
├── coin
├── module_config.yaml
└── axivion
│ └── ci_config_linux.json
└── CMakeLists.txt
/tests/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | qt_build_tests()
2 |
--------------------------------------------------------------------------------
/.tag:
--------------------------------------------------------------------------------
1 | 1ba771a5018b681fd3db47044b8051fc7170ca6a
2 |
--------------------------------------------------------------------------------
/tests/manual/manual.pro:
--------------------------------------------------------------------------------
1 | TEMPLATE = subdirs
2 | SUBDIRS += testApp
3 |
--------------------------------------------------------------------------------
/examples/lottie/qtlottieviewer/qtquickcontrols2.conf:
--------------------------------------------------------------------------------
1 | [Controls]
2 | Style=Basic
3 |
--------------------------------------------------------------------------------
/tests/auto/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_subdirectory(lottie)
2 | add_subdirectory(qml)
3 |
--------------------------------------------------------------------------------
/tests/manual/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_subdirectory(featcheck)
2 | add_subdirectory(testApp)
3 |
--------------------------------------------------------------------------------
/src/plugins/vectorimageformats/lottie/lottie.json:
--------------------------------------------------------------------------------
1 | {
2 | "Keys": [ "lottie+json" ]
3 | }
4 |
--------------------------------------------------------------------------------
/.gitreview:
--------------------------------------------------------------------------------
1 | [gerrit]
2 | host=codereview.qt-project.org
3 | project=qt/qtlottie
4 | defaultbranch=dev
5 |
--------------------------------------------------------------------------------
/tests/baseline/data/docsamples/blep.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qt/qtlottie/dev/tests/baseline/data/docsamples/blep.png
--------------------------------------------------------------------------------
/tests/baseline/data/docsamples/sound.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qt/qtlottie/dev/tests/baseline/data/docsamples/sound.mp3
--------------------------------------------------------------------------------
/tests/baseline/scenegrabber/checkered.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qt/qtlottie/dev/tests/baseline/scenegrabber/checkered.png
--------------------------------------------------------------------------------
/tests/baseline/data/Ignore:
--------------------------------------------------------------------------------
1 | # List of .json files that should NOT be rendered
2 |
3 | # Not a Lottie file
4 | qt_attribution.json
5 |
--------------------------------------------------------------------------------
/tests/baseline/data/docsamples/text_shape.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qt/qtlottie/dev/tests/baseline/data/docsamples/text_shape.png
--------------------------------------------------------------------------------
/tests/baseline/data/docsamples/thumbs-up.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qt/qtlottie/dev/tests/baseline/data/docsamples/thumbs-up.png
--------------------------------------------------------------------------------
/tools/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2025 The Qt Company Ltd.
2 | # SPDX-License-Identifier: BSD-3-Clause
3 |
4 | add_subdirectory(lottietoqml)
5 |
--------------------------------------------------------------------------------
/src/plugins/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2025 The Qt Company Ltd.
2 | # SPDX-License-Identifier: BSD-3-Clause
3 |
4 | add_subdirectory(vectorimageformats)
5 |
--------------------------------------------------------------------------------
/examples/lottie/lottietoqml/doc/images/lottietoqmlexample.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qt/qtlottie/dev/examples/lottie/lottietoqml/doc/images/lottietoqmlexample.png
--------------------------------------------------------------------------------
/src/plugins/vectorimageformats/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2025 The Qt Company Ltd.
2 | # SPDX-License-Identifier: BSD-3-Clause
3 |
4 | add_subdirectory(lottie)
5 |
--------------------------------------------------------------------------------
/examples/lottie/qtlottieviewer/doc/images/qtlottieviewerexample.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qt/qtlottie/dev/examples/lottie/qtlottieviewer/doc/images/qtlottieviewerexample.png
--------------------------------------------------------------------------------
/examples/lottie/lottietoqml/doc/images/lottietoqmlexample-closeup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qt/qtlottie/dev/examples/lottie/lottietoqml/doc/images/lottietoqmlexample-closeup.png
--------------------------------------------------------------------------------
/tests/auto/qml/qml.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | data/rec_pos_col_opa.json
4 | data/tst_main.qml
5 |
6 |
7 |
--------------------------------------------------------------------------------
/tests/auto/qml/tst_qml.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2018 The Qt Company Ltd.
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3 |
4 | #include
5 |
6 | QUICK_TEST_MAIN(qml);
7 |
--------------------------------------------------------------------------------
/dependencies.yaml:
--------------------------------------------------------------------------------
1 | dependencies:
2 | ../qtbase:
3 | ref: df1292e2b96aab02ad6df778d8336e7958ad5d1c
4 | required: true
5 | ../qtdeclarative:
6 | ref: 7ef1d06ce70fa360613dca0b5ff03365ebbc9883
7 | required: true
8 |
--------------------------------------------------------------------------------
/src/qml/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2022 The Qt Company Ltd.
2 | # SPDX-License-Identifier: BSD-3-Clause
3 |
4 | qt_internal_extend_target(Lottie
5 | SOURCES
6 | qlottieanimation.cpp qlottieanimation_p.h
7 | )
8 |
--------------------------------------------------------------------------------
/examples/lottie/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2025 The Qt Company Ltd.
2 | # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3 |
4 | qt_internal_add_example(qtlottieviewer)
5 | qt_internal_add_example(lottietoqml)
6 |
--------------------------------------------------------------------------------
/tests/auto/lottie/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_subdirectory(shape)
2 |
3 | if(TARGET Qt::QuickPrivate
4 | AND TARGET Qt::QuickShapesPrivate
5 | AND TARGET Qt::QuickVectorImageGeneratorPrivate)
6 | add_subdirectory(vectorimage)
7 | endif()
8 |
--------------------------------------------------------------------------------
/.cmake.conf:
--------------------------------------------------------------------------------
1 | set(QT_REPO_MODULE_VERSION "6.12.0")
2 | set(QT_REPO_MODULE_PRERELEASE_VERSION_SEGMENT "alpha1")
3 | set(QT_EXTRA_INTERNAL_TARGET_DEFINES
4 | "QT_NO_FOREACH=1"
5 | "QT_NO_QASCONST=1"
6 | "QT_NO_URL_CAST_FROM_STRING=1"
7 | )
8 |
--------------------------------------------------------------------------------
/examples/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2025 The Qt Company Ltd.
2 | # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3 |
4 | qt_examples_build_begin(EXTERNAL_BUILD)
5 |
6 | add_subdirectory(lottie)
7 |
8 | qt_examples_build_end()
9 |
--------------------------------------------------------------------------------
/examples/lottie/qtlottieviewer/REUSE.toml:
--------------------------------------------------------------------------------
1 | version = 1
2 |
3 | [[annotations]]
4 | path = ["logo.json"]
5 | precedence = "closest"
6 | comment = "example lottie file, github.com/lottie/lottie-spec"
7 | SPDX-FileCopyrightText = "Copyright © 2017 Airbnb"
8 | SPDX-License-Identifier = "MIT"
9 |
--------------------------------------------------------------------------------
/tests/baseline/data/REUSE.toml:
--------------------------------------------------------------------------------
1 | version = 1
2 |
3 | [[annotations]]
4 | path = ["docsamples/**"]
5 | precedence = "closest"
6 | comment = "example lottie files, from github.com/LottieFiles/lottie-docs"
7 | SPDX-FileCopyrightText = "Copyright © 2022 Design Barn Inc."
8 | SPDX-License-Identifier = "CC-BY-4.0"
9 |
--------------------------------------------------------------------------------
/tests/manual/featcheck/howtofind.txt:
--------------------------------------------------------------------------------
1 |
2 | 1. Build featcheck
3 | 2. Add build directory to path
4 | 3. Switch to the directory containing json files (in subdirectories)
5 | 4. Enter command
6 | find * -name *.json -printf '\n\n%p:\n\n' -exec featcheck {} \; &>log
7 | 5. The results are now found in the log file
8 |
--------------------------------------------------------------------------------
/tests/manual/featcheck/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.16)
2 |
3 | set(CMAKE_INCLUDE_CURRENT_DIR ON)
4 |
5 | qt_internal_add_manual_test(featcheck
6 | GUI
7 | SOURCES
8 | main.cpp
9 | )
10 |
11 | target_link_libraries(featcheck PRIVATE
12 | Qt::Core
13 | Qt::Gui
14 | Qt::LottiePrivate
15 | )
16 |
--------------------------------------------------------------------------------
/tests/auto/lottie/vectorimage/data/vectorimage.qml:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2025 The Qt Company Ltd.
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3 |
4 | import QtQuick
5 | import QtQuick.Shapes
6 | import QtQuick.VectorImage
7 |
8 | VectorImage {
9 | width: 440
10 | height: 220
11 | source: fileName
12 | assumeTrustedSource: true
13 | }
14 |
--------------------------------------------------------------------------------
/tests/auto/lottie/vectorimage/data/vectorimage_noassumetrustedsource.qml:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2025 The Qt Company Ltd.
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3 |
4 | import QtQuick
5 | import QtQuick.Shapes
6 | import QtQuick.VectorImage
7 |
8 | VectorImage {
9 | width: 440
10 | height: 220
11 | source: fileName
12 | assumeTrustedSource: false
13 | }
14 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/shapelayer/data/shape_active_60to120.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":100,"h":100,"nm":"EmptyShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[50,50,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[],"ip":60,"op":120,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/src/vectorimagehelpers/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2025 The Qt Company Ltd.
2 | # SPDX-License-Identifier: BSD-3-Clause
3 |
4 | qt_internal_add_qml_module(LottieVectorImageHelpers
5 | URI "Qt.labs.lottieqt.VectorImageHelpers"
6 | VERSION "${PROJECT_VERSION}"
7 | CLASS_NAME QLottieVectorImageHelpersPlugin
8 | SOURCES
9 | qquicklayeritem_p.h qquicklayeritem.cpp
10 | LIBRARIES
11 | Qt::QuickPrivate
12 | )
13 |
--------------------------------------------------------------------------------
/tests/baseline/data/docsamples/layers-solid.json:
--------------------------------------------------------------------------------
1 | {
2 | "fr": 60,
3 | "ip": 0,
4 | "op": 60,
5 | "w": 512,
6 | "h": 512,
7 | "ddd": 0,
8 | "layers": [
9 | {
10 | "ty": 1,
11 | "ip": 0,
12 | "op": 60,
13 | "st": 0,
14 | "ks": {},
15 | "sc": "#ff0000",
16 | "sh": 512,
17 | "sw": 512
18 | }
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/transform/data/transform_static.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":100,"h":100,"nm":"AnimatedTransformShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[50,50,0],"ix":2},"a":{"a":0,"k":[50,50,0],"ix":1},"s":{"a":0,"k":[50,50,100],"ix":6}},"ao":0,"shapes":[],"ip":-179,"op":184,"st":-179,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/examples/lottie/qtlottieviewer/qt_attribution.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "Id": "lottielogo",
4 | "Name": "Lottie Logo",
5 | "QDocModule": "qtlottieanimation",
6 | "QtUsage": "Used in the qtlottieviewer Example",
7 | "QtParts": [ "examples" ],
8 | "Files": [ "logo.json" ],
9 | "LicenseId": "MIT",
10 | "License": "MIT License",
11 | "Copyright": "Copyright (C) 2017 Airbnb"
12 | }
13 | ]
14 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2022 The Qt Company Ltd.
2 | # SPDX-License-Identifier: BSD-3-Clause
3 |
4 | add_subdirectory(shapelayer)
5 | add_subdirectory(rect)
6 | add_subdirectory(ellipse)
7 | add_subdirectory(fill)
8 | add_subdirectory(stroke)
9 | add_subdirectory(path)
10 | add_subdirectory(trimpath)
11 | add_subdirectory(transform)
12 | add_subdirectory(shapetransform)
13 | add_subdirectory(repeater)
14 | add_subdirectory(repeatertransform)
15 |
--------------------------------------------------------------------------------
/tests/auto/qml/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2022 The Qt Company Ltd.
2 | # SPDX-License-Identifier: BSD-3-Clause
3 |
4 | qt_internal_add_test(tst_lottie_qml
5 | GUI
6 | QMLTEST
7 | SOURCES
8 | tst_qml.cpp
9 | LIBRARIES
10 | Qt::Quick
11 | TESTDATA
12 | data/tst_main.qml
13 | )
14 |
15 | qt_internal_add_resource(tst_lottie_qml "qml"
16 | PREFIX
17 | "/"
18 | FILES
19 | data/rec_pos_col_opa.json
20 | )
21 |
--------------------------------------------------------------------------------
/src/lottiegenerator/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2025 The Qt Company Ltd.
2 | # SPDX-License-Identifier: BSD-3-Clause
3 |
4 | qt_internal_add_module(LottieVectorImageGeneratorPrivate
5 | INTERNAL_MODULE
6 | SOURCES
7 | qlottievisitor_p.h qlottievisitor.cpp
8 | LIBRARIES
9 | Qt::Core
10 | Qt::QuickPrivate
11 | Qt::QuickShapesPrivate
12 | Qt::QuickVectorImageGeneratorPrivate
13 | Qt::LottiePrivate
14 | Qt::LottieVectorImageHelpers
15 | )
16 |
--------------------------------------------------------------------------------
/LICENSES/LicenseRef-Qt-Commercial.txt:
--------------------------------------------------------------------------------
1 | Licensees holding valid commercial Qt licenses may use this software in
2 | accordance with the the terms contained in a written agreement between
3 | you and The Qt Company. Alternatively, the terms and conditions that were
4 | accepted by the licensee when buying and/or downloading the
5 | software do apply.
6 |
7 | For the latest licensing terms and conditions, see https://www.qt.io/terms-conditions.
8 | For further information use the contact form at https://www.qt.io/contact-us.
9 |
--------------------------------------------------------------------------------
/coin/module_config.yaml:
--------------------------------------------------------------------------------
1 | version: 2
2 | accept_configuration:
3 | condition: property
4 | property: features
5 | not_contains_value: Disable
6 |
7 | instructions:
8 | Build:
9 | - type: EnvironmentVariable
10 | variableName: VERIFY_SOURCE_SBOM
11 | variableValue: "ON"
12 | - !include "{{qt/qtbase}}/coin_module_build_template_v2.yaml"
13 |
14 | Test:
15 | - !include "{{qt/qtbase}}/coin_module_test_template_v3.yaml"
16 | - !include "{{qt/qtbase}}/coin_module_test_docs.yaml"
17 |
--------------------------------------------------------------------------------
/src/qml/doc/src/external-resources.qdoc:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2019 The Qt Company Ltd.
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3 |
4 | /*!
5 | \externalpage https://lottiefiles.com/plugins/after-effects
6 | \title Lottie
7 | */
8 |
9 | /*!
10 | \externalpage https://github.com/airbnb/lottie-web
11 | \title Lottie Source
12 | */
13 |
14 | /*!
15 | \externalpage https://lottie.github.io/lottie-spec/1.0/
16 | \title Lottie Specification
17 | */
18 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/shapelayer/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2022 The Qt Company Ltd.
2 | # SPDX-License-Identifier: BSD-3-Clause
3 |
4 | # Collect test data
5 | file(GLOB_RECURSE test_data_glob
6 | RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
7 | data/*)
8 | list(APPEND test_data ${test_data_glob})
9 |
10 | qt_internal_add_test(tst_shapelayer
11 | SOURCES
12 | tst_lottieshapelayer.cpp
13 | LIBRARIES
14 | Qt::Gui
15 | Qt::Test
16 | Qt::LottiePrivate
17 | TESTDATA ${test_data}
18 | )
19 |
--------------------------------------------------------------------------------
/tests/baseline/data/qt_attribution.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "Id": "lottiedocs-examples",
4 | "Name": "Example Lottie files from github.com/LottieFiles/lottie-docs",
5 | "QDocModule": "qtlottieanimation",
6 | "QtUsage": "Used for baseline testing",
7 | "QtParts": [ "tests" ],
8 | "Path": "docsamples",
9 | "LicenseId": "CC-BY-4.0",
10 | "License": "Creative Commons Attribution 4.0 International",
11 | "Copyright": "Copyright © 2022 Design Barn Inc."
12 | }
13 | ]
14 |
--------------------------------------------------------------------------------
/tools/lottietoqml/main.qml:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2025 The Qt Company Ltd.
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3 |
4 | import QtQuick
5 | import QtQuick.Shapes
6 | import QtQuick.Controls
7 | import QtQuick.Layouts
8 |
9 | Window {
10 | id: mainWindow
11 | width: 1280
12 | height: 960
13 | visible: true
14 | color: "white"
15 |
16 | Item {
17 | id: svg
18 | objectName: "svg_item"
19 | anchors.centerIn: parent
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/fill/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2022 The Qt Company Ltd.
2 | # SPDX-License-Identifier: BSD-3-Clause
3 |
4 | # Collect test data
5 | file(GLOB_RECURSE test_data_glob
6 | RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
7 | data/*)
8 | list(APPEND test_data ${test_data_glob})
9 |
10 | qt_internal_add_test(tst_fill
11 | SOURCES
12 | tst_lottiefill.cpp
13 | LIBRARIES
14 | Qt::Gui
15 | Qt::GuiPrivate
16 | Qt::Test
17 | Qt::LottiePrivate
18 | TESTDATA ${test_data}
19 | )
20 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/path/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2022 The Qt Company Ltd.
2 | # SPDX-License-Identifier: BSD-3-Clause
3 |
4 | # Collect test data
5 | file(GLOB_RECURSE test_data_glob
6 | RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
7 | data/*)
8 | list(APPEND test_data ${test_data_glob})
9 |
10 | qt_internal_add_test(tst_path
11 | SOURCES
12 | tst_lottiepath.cpp
13 | LIBRARIES
14 | Qt::Gui
15 | Qt::GuiPrivate
16 | Qt::Test
17 | Qt::LottiePrivate
18 | TESTDATA ${test_data}
19 | )
20 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/rect/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2022 The Qt Company Ltd.
2 | # SPDX-License-Identifier: BSD-3-Clause
3 |
4 | # Collect test data
5 | file(GLOB_RECURSE test_data_glob
6 | RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
7 | data/*)
8 | list(APPEND test_data ${test_data_glob})
9 |
10 | qt_internal_add_test(tst_rect
11 | SOURCES
12 | tst_lottierect.cpp
13 | LIBRARIES
14 | Qt::Gui
15 | Qt::GuiPrivate
16 | Qt::Test
17 | Qt::LottiePrivate
18 | TESTDATA ${test_data}
19 | )
20 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/stroke/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2022 The Qt Company Ltd.
2 | # SPDX-License-Identifier: BSD-3-Clause
3 |
4 | # Collect test data
5 | file(GLOB_RECURSE test_data_glob
6 | RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
7 | data/*)
8 | list(APPEND test_data ${test_data_glob})
9 |
10 | qt_internal_add_test(tst_stroke
11 | SOURCES
12 | tst_lottiestroke.cpp
13 | LIBRARIES
14 | Qt::Gui
15 | Qt::GuiPrivate
16 | Qt::Test
17 | Qt::LottiePrivate
18 | TESTDATA ${test_data}
19 | )
20 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/ellipse/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2022 The Qt Company Ltd.
2 | # SPDX-License-Identifier: BSD-3-Clause
3 |
4 | # Collect test data
5 | file(GLOB_RECURSE test_data_glob
6 | RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
7 | data/*)
8 | list(APPEND test_data ${test_data_glob})
9 |
10 | qt_internal_add_test(tst_ellipse
11 | SOURCES
12 | tst_lottieellipse.cpp
13 | LIBRARIES
14 | Qt::Gui
15 | Qt::GuiPrivate
16 | Qt::Test
17 | Qt::LottiePrivate
18 | TESTDATA ${test_data}
19 | )
20 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/repeater/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2022 The Qt Company Ltd.
2 | # SPDX-License-Identifier: BSD-3-Clause
3 |
4 | # Collect test data
5 | file(GLOB_RECURSE test_data_glob
6 | RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
7 | data/*)
8 | list(APPEND test_data ${test_data_glob})
9 |
10 | qt_internal_add_test(tst_repeater
11 | SOURCES
12 | tst_lottierepeater.cpp
13 | LIBRARIES
14 | Qt::Gui
15 | Qt::GuiPrivate
16 | Qt::Test
17 | Qt::LottiePrivate
18 | TESTDATA ${test_data}
19 | )
20 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/trimpath/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2022 The Qt Company Ltd.
2 | # SPDX-License-Identifier: BSD-3-Clause
3 |
4 | # Collect test data
5 | file(GLOB_RECURSE test_data_glob
6 | RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
7 | data/*)
8 | list(APPEND test_data ${test_data_glob})
9 |
10 | qt_internal_add_test(tst_trimpath
11 | SOURCES
12 | tst_lottietrimpath.cpp
13 | LIBRARIES
14 | Qt::Gui
15 | Qt::GuiPrivate
16 | Qt::Test
17 | Qt::LottiePrivate
18 | TESTDATA ${test_data}
19 | )
20 |
--------------------------------------------------------------------------------
/src/plugins/vectorimageformats/lottie/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2025 The Qt Company Ltd.
2 | # SPDX-License-Identifier: BSD-3-Clause
3 |
4 | qt_internal_add_plugin(QLottieVectorImagePlugin
5 | OUTPUT_NAME qlottievectorimage
6 | PLUGIN_TYPE vectorimageformats
7 | SOURCES
8 | main.cpp
9 | LIBRARIES
10 | Qt::Gui
11 | Qt::GuiPrivate
12 | Qt::Quick
13 | Qt::QuickPrivate
14 | Qt::QuickVectorImageGeneratorPrivate
15 | Qt::LottieVectorImageGeneratorPrivate
16 | Qt::LottiePrivate
17 | )
18 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/fill/data/fill_hidden.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":320,"h":320,"nm":"StaticFillShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[160,160,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":true}],"ip":0,"op":180,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/fill/data/fill_static_red_100.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":320,"h":320,"nm":"StaticFillShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[160,160,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false}],"ip":0,"op":180,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/shapetransform/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2022 The Qt Company Ltd.
2 | # SPDX-License-Identifier: BSD-3-Clause
3 |
4 | # Collect test data
5 | file(GLOB_RECURSE test_data_glob
6 | RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
7 | data/*)
8 | list(APPEND test_data ${test_data_glob})
9 |
10 | qt_internal_add_test(tst_shapetransform
11 | SOURCES
12 | tst_lottieshapetransform.cpp
13 | LIBRARIES
14 | Qt::Gui
15 | Qt::GuiPrivate
16 | Qt::Test
17 | Qt::LottiePrivate
18 | TESTDATA ${test_data}
19 | )
20 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/transform/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2022 The Qt Company Ltd.
2 | # SPDX-License-Identifier: BSD-3-Clause
3 |
4 | # Collect test data
5 | file(GLOB_RECURSE test_data_glob
6 | RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
7 | data/*)
8 | list(APPEND test_data ${test_data_glob})
9 |
10 | qt_internal_add_test(tst_lottie_transform
11 | SOURCES
12 | tst_lottiebasictransform.cpp
13 | LIBRARIES
14 | Qt::Gui
15 | Qt::GuiPrivate
16 | Qt::Test
17 | Qt::LottiePrivate
18 | TESTDATA ${test_data}
19 | )
20 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/ellipse/data/ellipse_direction.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":320,"h":320,"nm":"StaticEllipseShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[160,160,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"d":3,"ty":"el","s":{"a":0,"k":[100,80],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":true}],"ip":0,"op":180,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/ellipse/data/ellipse_hidden.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":320,"h":320,"nm":"StaticEllipseShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[160,160,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"d":2,"ty":"el","s":{"a":0,"k":[100,80],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":true}],"ip":0,"op":180,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/repeatertransform/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2022 The Qt Company Ltd.
2 | # SPDX-License-Identifier: BSD-3-Clause
3 |
4 | # Collect test data
5 | file(GLOB_RECURSE test_data_glob
6 | RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
7 | data/*)
8 | list(APPEND test_data ${test_data_glob})
9 |
10 | qt_internal_add_test(tst_repeatertransform
11 | SOURCES
12 | tst_lottierepeatertransform.cpp
13 | LIBRARIES
14 | Qt::Gui
15 | Qt::GuiPrivate
16 | Qt::Test
17 | Qt::LottiePrivate
18 | TESTDATA ${test_data}
19 | )
20 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/ellipse/data/ellipse_static_100x80.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":320,"h":320,"nm":"StaticRoundShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[150,150,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"d":1,"ty":"el","s":{"a":0,"k":[100,80],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false}],"ip":0,"op":180,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/rect/data/rect_hidden.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":100,"h":100,"nm":"HiddenRectShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[0,0,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"rc","d":1,"s":{"a":0,"k":[30,30],"ix":2},"p":{"a":0,"k":[50,50],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":true}],"ip":0,"op":180,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/rect/data/rect_direction.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":100,"h":100,"nm":"StaticRectShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[0,0,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"rc","d":3,"s":{"a":0,"k":[30,30],"ix":2},"p":{"a":0,"k":[50,50],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false}],"ip":60,"op":120,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/rect/data/rect_static_30x30_5050_rad0.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":100,"h":100,"nm":"StaticRectShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[0,0,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"rc","d":1,"s":{"a":0,"k":[30,30],"ix":2},"p":{"a":0,"k":[50,50],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false}],"ip":0,"op":180,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/stroke/data/stroke_hidden.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":100,"h":100,"nm":"StaticStrokeShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[0,0,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"st","c":{"a":0,"k":[0,0,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":true}],"ip":0,"op":180,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/stroke/data/stroke_static_blue_2.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":100,"h":100,"nm":"StaticStrokeShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[0,0,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"st","c":{"a":0,"k":[0,0,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false}],"ip":0,"op":180,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/baseline/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2024 The Qt Company Ltd.
2 | # SPDX-License-Identifier: BSD-3-Clause
3 |
4 | if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
5 | cmake_minimum_required(VERSION 3.16)
6 | project(qtlottie_baseline_test LANGUAGES CXX)
7 | find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
8 | endif()
9 |
10 | # Special case: test includes the QBaselineTest module sources from qtbase directly
11 | if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../../../qtbase/tests/baseline/shared" AND QT_FEATURE_process)
12 | add_subdirectory(scenegrabber)
13 | add_subdirectory(lottie)
14 | endif()
15 |
--------------------------------------------------------------------------------
/examples/lottie/qtlottieviewer/main.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2025 The Qt Company Ltd.
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3 |
4 | #include
5 | #include
6 |
7 | int main(int argc, char *argv[])
8 | {
9 | QGuiApplication app(argc, argv);
10 |
11 | QQmlApplicationEngine engine;
12 | QObject::connect(
13 | &engine,
14 | &QQmlApplicationEngine::objectCreationFailed,
15 | &app,
16 | []() { QCoreApplication::exit(-1); },
17 | Qt::QueuedConnection);
18 | engine.loadFromModule("qtlottieviewer", "Main");
19 |
20 | return app.exec();
21 | }
22 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/path/data/freeform_triangle_static.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":100,"h":100,"nm":"StaticFreeformTriangleShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[0,0,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0]],"v":[[49.984,30.024],[34.996,50.013],[64.995,49.999]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false}],"ip":0,"op":180,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/examples/lottie/lottietoqml/main.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2025 The Qt Company Ltd.
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3 |
4 | #include
5 | #include
6 |
7 | int main(int argc, char *argv[])
8 | {
9 | QGuiApplication app(argc, argv);
10 |
11 | QQmlApplicationEngine engine;
12 | QObject::connect(
13 | &engine,
14 | &QQmlApplicationEngine::objectCreationFailed,
15 | &app,
16 | []() { QCoreApplication::exit(-1); },
17 | Qt::QueuedConnection);
18 | engine.loadFromModule("lottietoqmlexample", "Main");
19 |
20 | return app.exec();
21 | }
22 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/path/data/freeform_direction.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":100,"h":100,"nm":"StaticFreeformCurveShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[0,0,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-5.149,25.76],[5.999,-12.033],[0,0]],"o":[[5.008,-25.055],[-17.2,34.503],[0,0]],"v":[[85,50.07],[45.001,50.072],[15.001,50.066]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":true}],"ip":0,"op":180,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/path/data/freeform_hidden.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":100,"h":100,"nm":"StaticFreeformCurveShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[0,0,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[-17.2,34.503],[5.008,-25.055]],"o":[[0,0],[5.999,-12.033],[-5.149,25.76]],"v":[[15.001,50.066],[45.001,50.072],[85,50.07]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":true}],"ip":0,"op":180,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/path/data/freeform_curve_static.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":100,"h":100,"nm":"StaticFreeformCurveShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[0,0,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[-17.2,34.503],[5.008,-25.055]],"o":[[0,0],[5.999,-12.033],[-5.149,25.76]],"v":[[15.001,50.066],[45.001,50.072],[85,50.07]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false}],"ip":0,"op":180,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/shapelayer/data/shape_matte_alphaclip.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":100,"h":100,"nm":"EmptyMaskClipShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","td":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[50,50,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[],"ip":60,"op":120,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Shape Layer 2","tt":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[50,50,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[],"ip":-4,"op":180,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/shapelayer/data/shape_matte_lumaclip.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":100,"h":100,"nm":"EmptyMaskClipShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","td":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[50,50,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[],"ip":60,"op":120,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Shape Layer 2","tt":3,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[50,50,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[],"ip":-4,"op":180,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/shapelayer/data/shape_matte_alphainvclip.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":100,"h":100,"nm":"EmptyMaskClipShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","td":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[50,50,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[],"ip":60,"op":120,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Shape Layer 2","tt":2,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[50,50,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[],"ip":-4,"op":180,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/shapelayer/data/shape_matte_lumainvclip.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":100,"h":100,"nm":"EmptyMaskClipShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","td":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[50,50,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[],"ip":60,"op":120,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Shape Layer 2","tt":4,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[50,50,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[],"ip":-4,"op":180,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/path/data/freeform_roto_static.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":100,"h":100,"nm":"StaticFreeformRotoShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[0,0.031,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-4.727,-4.705],[-4.718,4.714],[4.709,4.687],[4.727,-4.723]],"o":[[4.727,4.705],[4.701,-4.696],[-4.736,-4.714],[-4.718,4.714]],"v":[[40.008,60],[60.016,59.953],[60.007,40.02],[39.96,39.991]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false}],"ip":0,"op":180,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/shapetransform/data/shapetransform_static.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":100,"h":100,"nm":"StaticShapeTransformShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[0,0.125,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"tr","p":{"a":0,"k":[50,50],"ix":2},"a":{"a":0,"k":[50,50],"ix":1},"s":{"a":0,"k":[50,50],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":0,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":180,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/repeater/data/repeater_hidden.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":100,"h":100,"nm":"StaticRepeaterShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[0,0,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"rp","c":{"a":0,"k":3,"ix":1},"o":{"a":0,"k":0,"ix":2},"m":1,"ix":1,"tr":{"ty":"tr","p":{"a":0,"k":[100,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":4},"so":{"a":0,"k":100,"ix":5},"eo":{"a":0,"k":100,"ix":6},"nm":"Transform"},"nm":"Repeater 1","mn":"ADBE Vector Filter - Repeater","hd":true}],"ip":-50,"op":184,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/repeater/data/repeater_static.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":100,"h":100,"nm":"StaticRepeaterShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[0,0,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"rp","c":{"a":0,"k":3,"ix":1},"o":{"a":0,"k":0,"ix":2},"m":1,"ix":1,"tr":{"ty":"tr","p":{"a":0,"k":[100,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":4},"so":{"a":0,"k":100,"ix":5},"eo":{"a":0,"k":100,"ix":6},"nm":"Transform"},"nm":"Repeater 1","mn":"ADBE Vector Filter - Repeater","hd":false}],"ip":-50,"op":184,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/trimpath/data/trimpath_hidden.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":100,"h":100,"nm":"StaticQTrimPathShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[50,50,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[-29.992,10.008],[30.008,10]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"tm","s":{"a":0,"k":20,"ix":1},"e":{"a":0,"k":80,"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":true}],"ip":-179,"op":1,"st":-179,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/src/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(QT_SBOM_DEFAULT_QT_LICENSE_ID_LIBRARIES "QT_COMMERCIAL_OR_GPL3")
2 |
3 | qt_internal_add_qml_module(Lottie
4 | URI "Qt.labs.lottieqt"
5 | VERSION "${PROJECT_VERSION}"
6 | DEPENDENCIES
7 | QtQuick
8 | LIBRARIES
9 | Qt::Core
10 | Qt::Gui
11 | Qt::GuiPrivate
12 | Qt::Qml
13 | Qt::Quick
14 | )
15 |
16 | qt_internal_add_docs(Lottie
17 | qml/doc/qtlottieanimation.qdocconf
18 | )
19 |
20 | add_subdirectory(lottie)
21 | add_subdirectory(qml)
22 |
23 | add_subdirectory(vectorimagehelpers)
24 |
25 | if(TARGET Qt::QuickPrivate
26 | AND TARGET Qt::QuickShapesPrivate
27 | AND TARGET Qt::QuickVectorImageGeneratorPrivate)
28 | add_subdirectory(lottiegenerator)
29 | endif()
30 | add_subdirectory(plugins)
31 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/trimpath/data/trimpath_static_20to80.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":100,"h":100,"nm":"StaticQTrimPathShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[50,50,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[-29.992,10.008],[30.008,10]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"tm","s":{"a":0,"k":20,"ix":1},"e":{"a":0,"k":80,"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":-179,"op":1,"st":-179,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/repeatertransform/data/repeater_transform_static.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":100,"h":100,"nm":"StaticRepeaterTransformShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[0,0,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"rp","c":{"a":0,"k":3,"ix":1},"o":{"a":0,"k":0,"ix":2},"m":1,"ix":1,"tr":{"ty":"tr","p":{"a":0,"k":[50,50],"ix":2},"a":{"a":0,"k":[50,50],"ix":1},"s":{"a":0,"k":[50,50],"ix":3},"r":{"a":0,"k":0,"ix":4},"so":{"a":0,"k":100,"ix":5},"eo":{"a":0,"k":100,"ix":6},"nm":"Transform"},"nm":"Repeater 1","mn":"ADBE Vector Filter - Repeater","hd":false}],"ip":-50,"op":184,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/fill/data/fill_animated_red100_green0.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":320,"h":320,"nm":"AnimatedFillShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[160,160,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"fl","c":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[1,0,0,1],"e":[0,1,0,1]},{"t":179}],"ix":4},"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[100],"e":[0]},{"t":179}],"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false}],"ip":0,"op":180,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/manual/testApp/main.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2018 The Qt Company Ltd.
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3 |
4 | #include
5 | #include
6 |
7 | int main(int argc, char *argv[])
8 | {
9 | if (qEnvironmentVariableIsEmpty("QTGLESSTREAM_DISPLAY")) {
10 | qputenv("QT_QPA_EGLFS_PHYSICAL_WIDTH", QByteArray("213"));
11 | qputenv("QT_QPA_EGLFS_PHYSICAL_HEIGHT", QByteArray("120"));
12 |
13 | #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
14 | QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
15 | #endif
16 | }
17 |
18 | QGuiApplication app(argc, argv);
19 |
20 | QQmlApplicationEngine engine;
21 | engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
22 | if (engine.rootObjects().isEmpty())
23 | return -1;
24 |
25 | return app.exec();
26 | }
27 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/path/data/freeform_triangle_animated.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":100,"h":100,"nm":"AnimatedFreeformTriangleShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[0,0,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":0,"s":[{"i":[[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0]],"v":[[49.984,30.024],[34.996,50.013],[64.995,49.999]],"c":true}],"e":[{"i":[[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0]],"v":[[49.734,79.274],[34.996,59.951],[64.995,60.124]],"c":true}]},{"t":179}],"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false}],"ip":0,"op":180,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/manual/testApp/stroke.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":175.000007127896,"w":400,"h":224,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[200,112,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"d":1,"ty":"el","s":{"a":0,"k":[100,100],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[0,0,0,1],"e":[1,1,1,1]},{"t":64.0000026067734}],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/baseline/data/original/skew_yaxis.json:
--------------------------------------------------------------------------------
1 | {"ddd":0,"h":512,"w":512,"meta":{"g":"@lottiefiles/toolkit-js 0.57.2-beta.0"},"layers":[{"ty":4,"sr":1,"st":0,"op":20.666666666666668,"ip":0,"ln":"13","hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"p":{"a":0,"k":[460,440]},"r":{"a":0,"k":0},"o":{"a":0,"k":100}},"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"p":{"a":0,"k":[0,0]},"r":{"a":0,"k":0},"s":{"a":0,"k":[218.73,158.525]}},{"ty":"st","lc":1,"lj":1,"ml":4,"o":{"a":0,"k":100},"w":{"a":0,"k":2},"c":{"a":0,"k":[0,1,1]}},{"ty":"fl","c":{"a":0,"k":[0,0.0119,1]},"r":1,"o":{"a":0,"k":100}},{"ty":"tr","a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[0],"t":0},{"s":[45],"t":10.333333333333334}]},"p":{"a":0,"k":[-282.635,-176.737]},"r":{"a":0,"k":0},"sa":{"a":0,"k":90},"o":{"a":0,"k":100}}]}],"ind":1}],"v":"5.7.0","fr":29,"op":20.666666666666668,"ip":0,"assets":[]}
2 |
--------------------------------------------------------------------------------
/src/qml/doc/src/qtlottievectorimagehelpers.qdoc:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2025 The Qt Company Ltd.
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3 |
4 | /*!
5 | \qmlmodule Qt.labs.lottieqt.VectorImageHelpers
6 | \title Qt Lottie Vector Image Helpers QML Types
7 | \ingroup qmlmodules
8 | \brief Provides QML types used by VectorImage and related tools.
9 | \since 6.10
10 |
11 | This module contains types used in scenes generated by
12 | \l{VectorImage}, \l{lottietoqml} and related tools. The types are
13 | made to replicate specialized behavior defined by the vector
14 | graphics file formats it loads and are not intended to be
15 | generally useful.
16 |
17 | To use the types in this module, import the module with the
18 | following line:
19 |
20 | \qml
21 | import Qt.labs.lottieqt.VectorImageHelpers
22 | \endqml
23 |
24 | \section1 QML Types
25 | */
26 |
--------------------------------------------------------------------------------
/tests/baseline/data/original/skew_bothaxes.json:
--------------------------------------------------------------------------------
1 | {"ddd":0,"h":512,"w":512,"meta":{"g":"@lottiefiles/toolkit-js 0.57.2-beta.0"},"layers":[{"ty":4,"sr":1,"st":0,"op":20.666666666666668,"ip":0,"ln":"13","hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"p":{"a":0,"k":[560,440]},"r":{"a":0,"k":0},"o":{"a":0,"k":100}},"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"p":{"a":0,"k":[0,0]},"r":{"a":0,"k":0},"s":{"a":0,"k":[218.73,158.525]}},{"ty":"st","lc":1,"lj":1,"ml":4,"o":{"a":0,"k":100},"w":{"a":0,"k":2},"c":{"a":0,"k":[0,1,1]}},{"ty":"fl","c":{"a":0,"k":[0,0.0119,1]},"r":1,"o":{"a":0,"k":100}},{"ty":"tr","a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[0],"t":0},{"s":[45],"t":10.333333333333334}]},"p":{"a":0,"k":[-282.635,-176.737]},"r":{"a":0,"k":0},"sa":{"a":0,"k":45},"o":{"a":0,"k":100}}]}],"ind":1}],"v":"5.7.0","fr":29,"op":20.666666666666668,"ip":0,"assets":[]}
2 |
--------------------------------------------------------------------------------
/tests/baseline/data/original/skew_xaxis.json:
--------------------------------------------------------------------------------
1 | {"ddd":0,"h":512,"w":512,"meta":{"g":"@lottiefiles/toolkit-js 0.57.2-beta.0"},"layers":[{"ty":4,"sr":1,"st":0,"op":20.666666666666668,"ip":0,"ln":"13","hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"p":{"a":0,"k":[560,440]},"r":{"a":0,"k":0},"o":{"a":0,"k":100}},"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"p":{"a":0,"k":[0,0]},"r":{"a":0,"k":0},"s":{"a":0,"k":[218.73,158.525]}},{"ty":"st","lc":1,"lj":1,"ml":4,"o":{"a":0,"k":100},"w":{"a":0,"k":2},"c":{"a":0,"k":[0,1,1]}},{"ty":"fl","c":{"a":0,"k":[0,0.0119,1]},"r":1,"o":{"a":0,"k":100}},{"ty":"tr","a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[0],"t":0},{"s":[45],"t":10.333333333333334}]},"p":{"a":0,"k":[-282.635,-176.737]},"r":{"a":0,"k":0},"sa":{"a":0,"k":32400},"o":{"a":0,"k":100}}]}],"ind":1}],"v":"5.7.0","fr":29,"op":20.666666666666668,"ip":0,"assets":[]}
2 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/path/data/freeform_curve_animated.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":100,"h":100,"nm":"AnimatedFreeformCurveShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[0,0,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":0,"s":[{"i":[[0,0],[-17.2,34.503],[5.008,-25.055]],"o":[[0,0],[5.999,-12.033],[-5.149,25.76]],"v":[[15.001,50.066],[45.001,50.072],[85,50.07]],"c":false}],"e":[{"i":[[0,0],[-16.893,-45.111],[-20,-38.07]],"o":[[0,0],[14.999,40.053],[12.217,23.255]],"v":[[15.001,50.066],[45.001,50.072],[85,50.07]],"c":false}]},{"t":179}],"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false}],"ip":0,"op":180,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/libfuzzer/qml/qlottieanimation/parse/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2025 The Qt Company Ltd.
2 | # SPDX-License-Identifier: BSD-3-Clause
3 |
4 | cmake_minimum_required(VERSION 3.16)
5 | project(parse LANGUAGES CXX)
6 |
7 | set(CMAKE_INCLUDE_CURRENT_DIR ON)
8 |
9 | set(CMAKE_AUTOMOC ON)
10 | set(CMAKE_AUTORCC ON)
11 | set(CMAKE_AUTOUIC ON)
12 |
13 | find_package(Qt6 COMPONENTS Core Gui)
14 | find_package(Qt6 COMPONENTS LottiePrivate)
15 |
16 | qt_add_executable(parse
17 | main.cpp
18 | )
19 |
20 | target_link_libraries(parse PUBLIC
21 | Qt::Core
22 | Qt::Gui
23 | Qt::Quick
24 | Qt::LottiePrivate
25 | )
26 | if(DEFINED ENV{LIB_FUZZING_ENGINE})
27 | target_link_libraries(parse PRIVATE
28 | $ENV{LIB_FUZZING_ENGINE}
29 | )
30 | else()
31 | target_link_libraries(parse PRIVATE
32 | -fsanitize=fuzzer
33 | )
34 | endif()
35 |
36 | qt_import_plugins(parse
37 | INCLUDE Qt::QMinimalIntegrationPlugin
38 | )
39 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/ellipse/data/ellipse_animated_100x80at00to200x40at50100.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":320,"h":320,"nm":"AnimatedRoundShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[160,160,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"d":2,"ty":"el","s":{"a":1,"k":[{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"n":["0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167"],"t":0,"s":[100,80],"e":[200,40]},{"t":179}],"ix":2},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":0,"s":[0,0],"e":[50,100],"to":[8.33333301544189,16.6666660308838],"ti":[-8.33333301544189,-16.6666660308838]},{"t":179}],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false}],"ip":0,"op":180,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/manual/featcheck/featcheck.pro:
--------------------------------------------------------------------------------
1 | QT += lottie-private
2 | CONFIG += c++11 console
3 | CONFIG -= app_bundle
4 |
5 | # The following define makes your compiler emit warnings if you use
6 | # any feature of Qt which as been marked deprecated (the exact warnings
7 | # depend on your compiler). Please consult the documentation of the
8 | # deprecated API in order to know how to port your code away from it.
9 | DEFINES += QT_DEPRECATED_WARNINGS
10 |
11 | # You can also make your code fail to compile if you use deprecated APIs.
12 | # In order to do so, uncomment the following line.
13 | # You can also select to disable deprecated APIs only up to a certain version of Qt.
14 | #DEFINES += QT_DISABLE_DEPRECATED_UP_TO=0x060000 # disables all APIs deprecated in Qt 6.0.0 and earlier
15 |
16 | SOURCES += \
17 | main.cpp
18 |
19 | # Default rules for deployment.
20 | qnx: target.path = /tmp/$${TARGET}/bin
21 | else: unix:!android: target.path = /opt/$${TARGET}/bin
22 | !isEmpty(target.path): INSTALLS += target
23 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/repeater/data/repeater_animated.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":100,"h":100,"nm":"AnimatedRepeaterShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[0,0,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"rp","c":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[3],"e":[30]},{"t":179}],"ix":1},"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[0],"e":[15]},{"t":179}],"ix":2},"m":1,"ix":1,"tr":{"ty":"tr","p":{"a":0,"k":[100,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":4},"so":{"a":0,"k":100,"ix":5},"eo":{"a":0,"k":100,"ix":6},"nm":"Transform"},"nm":"Repeater 1","mn":"ADBE Vector Filter - Repeater","hd":false}],"ip":-20,"op":184,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/src/lottie/qbeziereasing_p.h:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2018 The Qt Company Ltd.
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3 |
4 | #ifndef QBEZIEREASING_P_H
5 | #define QBEZIEREASING_P_H
6 |
7 | //
8 | // W A R N I N G
9 | // -------------
10 | //
11 | // This file is not part of the Qt API. It exists purely as an
12 | // implementation detail. This header file may change from version to
13 | // version without notice, or even be removed.
14 | //
15 | // We mean it.
16 | //
17 |
18 | #include
19 |
20 | #include
21 |
22 | QT_BEGIN_NAMESPACE
23 |
24 | class Q_LOTTIE_EXPORT QBezierEasing
25 | {
26 | public:
27 | void addCubicBezierSegment(const QPointF &c1, const QPointF &c2, const QPointF &endPoint);
28 | qreal valueForProgress(qreal progress) const;
29 |
30 | QBezier bezier() const { return mBezier; }
31 |
32 | private:
33 | qreal tForX(qreal x) const;
34 | QBezier mBezier;
35 | };
36 |
37 | QT_END_NAMESPACE
38 |
39 | #endif // QBEZIEREASING_P_H
40 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/path/data/freeform_roto_animated.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":100,"h":100,"nm":"AnimatedFreeformRotoShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[0,0.031,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":0,"s":[{"i":[[-4.727,-4.705],[-4.718,4.714],[4.709,4.687],[4.727,-4.723]],"o":[[4.727,4.705],[4.701,-4.696],[-4.736,-4.714],[-4.718,4.714]],"v":[[40.008,60],[60.016,59.953],[60.007,40.02],[39.96,39.991]],"c":true}],"e":[{"i":[[-3.342,-3.311],[-4.718,4.714],[4.72,4.676],[3.338,-3.335]],"o":[[4.738,4.694],[4.701,-4.696],[-3.352,-3.321],[-3.328,3.325]],"v":[[40.008,60],[60.016,59.953],[60.007,40.02],[49.96,49.991]],"c":true}]},{"t":179}],"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false}],"ip":0,"op":180,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/rect/data/rect_animated_30x30_1515_rad0_to_50x50_7575_rad25.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":100,"h":100,"nm":"AnimatedRectShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[0,0,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"rc","d":1,"s":{"a":1,"k":[{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"n":["0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167"],"t":0,"s":[30,30],"e":[50,50]},{"t":179}],"ix":2},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":0,"s":[15,15],"e":[75,75],"to":[10,10],"ti":[-10,-10]},{"t":179}],"ix":3},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[0],"e":[25]},{"t":179}],"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false}],"ip":0,"op":180,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/LICENSES/Qt-GPL-exception-1.0.txt:
--------------------------------------------------------------------------------
1 | The Qt Company GPL Exception 1.0
2 |
3 | Exception 1:
4 |
5 | As a special exception you may create a larger work which contains the
6 | output of this application and distribute that work under terms of your
7 | choice, so long as the work is not otherwise derived from or based on
8 | this application and so long as the work does not in itself generate
9 | output that contains the output from this application in its original
10 | or modified form.
11 |
12 | Exception 2:
13 |
14 | As a special exception, you have permission to combine this application
15 | with Plugins licensed under the terms of your choice, to produce an
16 | executable, and to copy and distribute the resulting executable under
17 | the terms of your choice. However, the executable must be accompanied
18 | by a prominent notice offering all users of the executable the entire
19 | source code to this application, excluding the source code of the
20 | independent modules, but including any changes you have made to this
21 | application, under the terms of this license.
22 |
23 |
--------------------------------------------------------------------------------
/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2022 The Qt Company Ltd.
2 | # SPDX-License-Identifier: BSD-3-Clause
3 |
4 | cmake_minimum_required(VERSION 3.16)
5 |
6 | include(.cmake.conf)
7 | project(QtLottie
8 | VERSION "${QT_REPO_MODULE_VERSION}"
9 | DESCRIPTION "Qt Lottie Libraries"
10 | HOMEPAGE_URL "https://qt.io/"
11 | LANGUAGES CXX C
12 | )
13 |
14 | find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals)
15 |
16 | # This should be called as early as possible, just after find_package(BuildInternals) where it is
17 | # defined.
18 | qt_internal_project_setup()
19 |
20 | find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS Core)
21 | find_package(Qt6 ${PROJECT_VERSION} QUIET CONFIG OPTIONAL_COMPONENTS Gui Qml Quick QuickTest QuickTestUtilsPrivate
22 | QuickVectorImageGeneratorPrivate QuickControls2)
23 |
24 | if(NOT TARGET Qt6::Gui)
25 | message(NOTICE "Skipping the build as Qt6::Gui cannot be found.")
26 | return()
27 | endif()
28 |
29 | include("${CMAKE_CURRENT_LIST_DIR}/tools/lottietoqml/Qt6LottieToQmlMacros.cmake")
30 |
31 | qt_build_repo()
32 |
--------------------------------------------------------------------------------
/tests/baseline/scenegrabber/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2024 The Qt Company Ltd.
2 | # SPDX-License-Identifier: BSD-3-Clause
3 |
4 | #####################################################################
5 | ## qmlscenegrabber Binary:
6 | #####################################################################
7 |
8 | if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
9 | cmake_minimum_required(VERSION 3.16)
10 | project(qtlottie_qmlscenegrabber LANGUAGES CXX)
11 | find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
12 | endif()
13 |
14 | qt_internal_add_executable(qtlottie_qmlscenegrabber
15 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.." # special case
16 | SOURCES
17 | main.cpp
18 | LIBRARIES
19 | Qt::Gui
20 | Qt::Quick
21 | )
22 |
23 | qt_policy(SET QTP0001 NEW)
24 | qt_add_qml_module(qtlottie_qmlscenegrabber
25 | URI QtLottieAnimation
26 | QML_FILES
27 | "Main.qml"
28 | )
29 |
30 | qt_add_resources(qtlottie_qmlscenegrabber "qtlottie_qmlscenegrabber"
31 | PREFIX
32 | "/"
33 | FILES
34 | checkered.png
35 | )
36 |
--------------------------------------------------------------------------------
/tests/baseline/data/original/split_positions.json:
--------------------------------------------------------------------------------
1 | {"nm":"Comp 1","ddd":0,"h":1080,"w":1920,"meta":{"g":"@lottiefiles/toolkit-js 0.66.4"},"layers":[{"ty":4,"nm":"Shape Layer 1","sr":1,"st":0,"op":20,"ip":0,"ln":"13","hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100,10000]},"p":{"s":true,"x":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[964],"t":0},{"s":[300],"t":19}]},"y":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[540],"t":0},{"s":[200],"t":19}]},"z":{"a":0,"k":0}},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"shapes":[{"ty":"gr","nm":"Rectangle 1","it":[{"ty":"rc","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0]},"r":{"a":0,"k":0},"s":{"a":0,"k":[136.903,100]}},{"ty":"st","nm":"Stroke 1","lc":1,"lj":1,"ml":4,"o":{"a":0,"k":100},"w":{"a":0,"k":2},"c":{"a":0,"k":[0,1,1]}},{"ty":"fl","nm":"Fill 1","c":{"a":0,"k":[1,0,0.2153]},"r":1,"o":{"a":0,"k":100}},{"ty":"tr","a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"p":{"a":0,"k":[0,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}}]}],"ind":1}],"v":"5.7.0","fr":29.97,"op":19.979999999999997,"ip":0,"assets":[]}
2 |
--------------------------------------------------------------------------------
/LICENSES/MIT.txt:
--------------------------------------------------------------------------------
1 |
2 |
3 | MIT License
4 |
5 | Copyright (c)
6 |
7 | 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:
8 |
9 | The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
10 |
11 | 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.
12 |
--------------------------------------------------------------------------------
/src/lottie/qlottieprecomplayer_p.h:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2025 The Qt Company Ltd.
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3 |
4 | #ifndef QLOTTIEPRECOMPLAYER_P_H
5 | #define QLOTTIEPRECOMPLAYER_P_H
6 |
7 | //
8 | // W A R N I N G
9 | // -------------
10 | //
11 | // This file is not part of the Qt API. It exists purely as an
12 | // implementation detail. This header file may change from version to
13 | // version without notice, or even be removed.
14 | //
15 | // We mean it.
16 | //
17 |
18 | #include
19 |
20 | QT_BEGIN_NAMESPACE
21 |
22 | class QLottieRenderer;
23 |
24 | class Q_LOTTIE_EXPORT QLottiePrecompLayer : public QLottieLayer
25 | {
26 | public:
27 | QLottiePrecompLayer() = default;
28 | explicit QLottiePrecompLayer(const QLottiePrecompLayer &other);
29 | QLottiePrecompLayer(const QMap &assets);
30 |
31 | QLottieBase *clone() const override;
32 |
33 | void render(QLottieRenderer &renderer) const override;
34 | int parse(const QJsonObject &definition) override;
35 |
36 | private:
37 | QMap m_assets;
38 | };
39 |
40 | QT_END_NAMESPACE
41 |
42 | #endif // QLOTTIEPRECOMPLAYER_P_H
43 |
--------------------------------------------------------------------------------
/tests/baseline/data/original/trim_path1.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":60,"w":550,"h":309,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[50,50,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"rc","d":1,"s":{"a":0,"k":[100,100],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[0],"e":[100]},{"t":50.0000020365418}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":2,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false},{"ty":"st","c":{"a":0,"k":[0,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":16,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/baseline/lottie/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2024 The Qt Company Ltd.
2 | # SPDX-License-Identifier: BSD-3-Clause
3 |
4 | #####################################################################
5 | ## tst_baseline_qtlottie Test:
6 | #####################################################################
7 |
8 | if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
9 | cmake_minimum_required(VERSION 3.16)
10 | project(tst_baseline_qtlottie LANGUAGES CXX)
11 | find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
12 | endif()
13 |
14 | # Collect test data
15 | list(APPEND test_data "../data")
16 |
17 | set(BASELINE_DIR "../../../../qtbase/tests/baseline/shared")
18 | qt_internal_add_test(tst_baseline_qtlottie
19 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
20 | SOURCES
21 | ${BASELINE_DIR}/baselineprotocol.cpp
22 | ${BASELINE_DIR}/baselineprotocol.h
23 | ${BASELINE_DIR}/lookup3.cpp
24 | ${BASELINE_DIR}/qbaselinetest.cpp
25 | ${BASELINE_DIR}/qbaselinetest.h
26 | tst_baseline_qtlottie.cpp
27 | INCLUDE_DIRECTORIES
28 | ${BASELINE_DIR}
29 | LIBRARIES
30 | Qt::Gui
31 | Qt::Network
32 | TESTDATA ${test_data}
33 | )
34 |
--------------------------------------------------------------------------------
/tests/manual/testApp/trim_path1.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":175.000007127896,"w":550,"h":309,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[50,50,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"rc","d":1,"s":{"a":0,"k":[100,100],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[0],"e":[100]},{"t":50.0000020365418}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":2,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":16,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/src/lottie/qbeziereasing.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2018 The Qt Company Ltd.
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3 |
4 | #include
5 |
6 | QT_BEGIN_NAMESPACE
7 |
8 | void QBezierEasing::addCubicBezierSegment(const QPointF &c1, const QPointF &c2, const QPointF &endPoint)
9 | {
10 | mBezier = QBezier::fromPoints(QPointF(0.0, 0.0), c1, c2, endPoint);
11 | }
12 |
13 | qreal QBezierEasing::valueForProgress(qreal progress) const
14 | {
15 | return mBezier.pointAt(tForX(progress)).y();
16 | }
17 |
18 | qreal QBezierEasing::tForX(qreal x) const
19 | {
20 | if (x <= 0.0)
21 | return 0.0;
22 | else if (x >= 1.0)
23 | return 1.0;
24 |
25 | qreal t0 = 0.0;
26 | qreal t1 = 1.0;
27 |
28 | for (int i = 0; i < 10; i++) { // 10 iterations gives error smaller than 0.001
29 | qreal t = qreal(0.5) * (t0 + t1);
30 | qreal a, b, c, d;
31 | QBezier::coefficients(t, a, b, c, d);
32 | qreal xt = a * mBezier.x1 + b * mBezier.x2 + c * mBezier.x3 + d * mBezier.x4;
33 | if (xt < x)
34 | t0 = t;
35 | else
36 | t1 = t;
37 | }
38 |
39 | return t0;
40 | }
41 |
42 | QT_END_NAMESPACE
43 |
--------------------------------------------------------------------------------
/coin/axivion/ci_config_linux.json:
--------------------------------------------------------------------------------
1 | {
2 | "Project": {
3 | "BuildSystemIntegration": {
4 | "child_order": [
5 | "GCCSetup",
6 | "CMake",
7 | "LinkLibraries"
8 | ]
9 | },
10 | "CMake": {
11 | "_active": true,
12 | "_copy_from": "CMakeIntegration",
13 | "build_environment": {},
14 | "build_options": "-j4",
15 | "generate_options": "--fresh",
16 | "generator": "Ninja"
17 | },
18 | "GCCSetup": {
19 | "_active": true,
20 | "_copy_from": "Command",
21 | "build_command": "gccsetup --cc gcc --cxx g++ --config ../../../axivion/"
22 | },
23 | "LinkLibraries": {
24 | "_active": true,
25 | "_copy_from": "AxivionLinker",
26 | "input_files": [
27 | "build/lib/lib*.so*.ir",
28 | "build/qml/*/*/*/lib*.so*.ir"
29 | ],
30 | "ir": "build/$(env:TESTED_MODULE_COIN).ir"
31 | }
32 | },
33 | "_Format": "1.0",
34 | "_Version": "7.6.2",
35 | "_VersionNum": [
36 | 7,
37 | 6,
38 | 2,
39 | 12725
40 | ]
41 | }
42 |
--------------------------------------------------------------------------------
/src/lottie/qlottieshapelayer_p.h:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2018 The Qt Company Ltd.
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3 |
4 | #ifndef QLOTTIESHAPELAYER_P_H
5 | #define QLOTTIESHAPELAYER_P_H
6 |
7 | //
8 | // W A R N I N G
9 | // -------------
10 | //
11 | // This file is not part of the Qt API. It exists purely as an
12 | // implementation detail. This header file may change from version to
13 | // version without notice, or even be removed.
14 | //
15 | // We mean it.
16 | //
17 |
18 | #include
19 |
20 | QT_BEGIN_NAMESPACE
21 |
22 | class QJsonObject;
23 |
24 | class QLottieRenderer;
25 | class QLottieShape;
26 | class QLottieTrimPath;
27 |
28 | class Q_LOTTIE_EXPORT QLottieShapeLayer : public QLottieLayer
29 | {
30 | public:
31 | QLottieShapeLayer() = default;
32 | explicit QLottieShapeLayer(const QLottieShapeLayer &other);
33 |
34 | QLottieBase *clone() const override;
35 |
36 | void updateProperties(int frame) override;
37 | void render(QLottieRenderer &render) const override;
38 | int parse(const QJsonObject &definition) override;
39 |
40 | private:
41 | QLottieTrimPath *m_appliedTrim = nullptr;
42 | };
43 |
44 | QT_END_NAMESPACE
45 |
46 | #endif // QLOTTIESHAPELAYER_P_H
47 |
--------------------------------------------------------------------------------
/tests/manual/html/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
19 |
20 |
21 |
22 |
23 |
24 |
28 |
29 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/tests/manual/testApp/rect_anchor_moved_static2.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":241.000009816131,"w":356,"h":200,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[0,0,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[43.5,43.5],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[-43.5,-43.5],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/baseline/data/original/rect_anchor_moved_static2.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":241.000009816131,"w":356,"h":200,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[0,0,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[43.5,43.5],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"st","c":{"a":0,"k":[0,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[-43.5,-43.5],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/baseline/data/original/trim_path_parallel2.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":50,"w":400,"h":224,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[200,112,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0]],"v":[[-5,5.5],[-58,-33],[-118.5,6]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[50],"e":[0]},{"t":44.0000017921567}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[50],"e":[100]},{"t":44.0000017921567}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false},{"ty":"st","c":{"a":0,"k":[0,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":4,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/manual/testApp/path_and_ellipse.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":175.000007127896,"w":550,"h":309,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[460,150.5,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"d":1,"ty":"el","s":{"a":0,"k":[100,100],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0.027450980619,0.996078431606,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 2","mn":"ADBE Vector Graphic - Fill","hd":false},{"ind":2,"ty":"sh","ix":3,"ks":{"a":0,"k":{"i":[],"o":[],"v":[],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ind":3,"ty":"sh","ix":4,"ks":{"a":0,"k":{"i":[[96,1],[0,0],[17.091,27.482],[0,0]],"o":[[-96,-1],[0,0],[-17.091,-27.482],[0,0]],"v":[[-311,-13.5],[-258,54.5],[-245.909,9.982],[-236,-26.5]],"c":false},"ix":2},"nm":"Path 2","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/manual/testApp/shape_circle.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":175.000007127896,"w":356,"h":200,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[178,100,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[47.497,-0.511],[-43,0]],"o":[[-46.5,0.5],[50,0]],"v":[[0.5,0.5],[0,69.5]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/baseline/data/original/shape_circle.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":175.000007127896,"w":356,"h":200,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[178,100,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[47.497,-0.511],[-43,0]],"o":[[-46.5,0.5],[50,0]],"v":[[0.5,0.5],[0,69.5]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/manual/testApp/trim_path_parallel2.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":175.000007127896,"w":400,"h":224,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[200,112,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0]],"v":[[-5,5.5],[-58,-33],[-118.5,6]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[50],"e":[0]},{"t":44.0000017921567}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[50],"e":[100]},{"t":44.0000017921567}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":4,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/baseline/data/original/path_and_ellipse.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":175.000007127896,"w":550,"h":309,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[460,150.5,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"d":1,"ty":"el","s":{"a":0,"k":[100,100],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0.027450980619,0.996078431606,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 2","mn":"ADBE Vector Graphic - Fill","hd":false},{"ind":2,"ty":"sh","ix":3,"ks":{"a":0,"k":{"i":[],"o":[],"v":[],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ind":3,"ty":"sh","ix":4,"ks":{"a":0,"k":{"i":[[96,1],[0,0],[17.091,27.482],[0,0]],"o":[[-96,-1],[0,0],[-17.091,-27.482],[0,0]],"v":[[-311,-13.5],[-258,54.5],[-245.909,9.982],[-236,-26.5]],"c":false},"ix":2},"nm":"Path 2","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/src/lottie/qlottiegroup_p.h:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2018 The Qt Company Ltd.
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3 |
4 | #ifndef QLOTTIEGROUP_P_H
5 | #define QLOTTIEGROUP_P_H
6 |
7 | //
8 | // W A R N I N G
9 | // -------------
10 | //
11 | // This file is not part of the Qt API. It exists purely as an
12 | // implementation detail. This header file may change from version to
13 | // version without notice, or even be removed.
14 | //
15 | // We mean it.
16 | //
17 |
18 | #include
19 | #include
20 |
21 | #include
22 | #include
23 |
24 | QT_BEGIN_NAMESPACE
25 |
26 | class QLottieFill;
27 | class QLottieTrimPath;
28 |
29 | class Q_LOTTIE_EXPORT QLottieGroup : public QLottieShape
30 | {
31 | public:
32 | QLottieGroup(QLottieBase *parent = nullptr);
33 |
34 | QLottieBase *clone() const override;
35 |
36 | void updateProperties(int frame) override;
37 | void render(QLottieRenderer &renderer) const override;
38 | int parse(const QJsonObject &definition) override;
39 |
40 | bool acceptsTrim() const override;
41 | void applyTrim(const QLottieTrimPath &trimmer) override;
42 | };
43 |
44 | QT_END_NAMESPACE
45 |
46 | #endif // QLOTTIEGROUP_P_H
47 |
--------------------------------------------------------------------------------
/tests/libfuzzer/qml/qlottieanimation/parse/main.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2025 The Qt Company Ltd.
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3 |
4 | #include
5 | #include
6 | #include
7 |
8 | class QLottieAnimationFuzzer : public QLottieAnimation
9 | {
10 | Q_OBJECT
11 | public:
12 | QLottieAnimationFuzzer(QQuickItem *parent = nullptr)
13 | : QLottieAnimation(parent)
14 | {
15 | }
16 | void fuzzParse(const QByteArray &jsonSource) { QLottieAnimation::parse(jsonSource); }
17 | };
18 |
19 | // silence warnings
20 | static QtMessageHandler mh = qInstallMessageHandler([](QtMsgType, const QMessageLogContext &,
21 | const QString &) {});
22 |
23 | extern "C" int LLVMFuzzerTestOneInput(const char *Data, size_t Size) {
24 | static int argc = 3;
25 | static char arg1[] = "fuzzer";
26 | static char arg2[] = "-platform";
27 | static char arg3[] = "minimal";
28 | static char *argv[] = {arg1, arg2, arg3, nullptr};
29 | static QGuiApplication qga(argc, argv);
30 | QLottieAnimationFuzzer lottie;
31 | lottie.fuzzParse(QByteArray::fromRawData(Data, Size));
32 | return 0;
33 | }
34 |
35 | #include "main.moc"
36 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/transform/data/transform_animated.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":100,"h":100,"nm":"StaticTransformShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[100],"e":[25]},{"t":179}],"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[0],"e":[1110]},{"t":179}],"ix":10},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":0,"s":[50,50,0],"e":[75,75,0],"to":[4.16666650772095,4.16666650772095,0],"ti":[-4.16666650772095,-4.16666650772095,0]},{"t":179}],"ix":2},"a":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":0,"s":[50,50,0],"e":[25,25,0],"to":[-4.16666650772095,-4.16666650772095,0],"ti":[4.16666650772095,4.16666650772095,0]},{"t":179}],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"n":["0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167"],"t":0,"s":[50,50,100],"e":[100,100,100]},{"t":179}],"ix":6}},"ao":0,"shapes":[],"ip":-179,"op":184,"st":-179,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/manual/testApp/shape_static.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":175.000007127896,"w":356,"h":200,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[178,100,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[35.368,-37.448],[-9,37.5]],"o":[[0,0],[0,0],[-34,36],[9,-37.5]],"v":[[-16,-29],[-45,-21.5],[-100.5,14.5],[56,3]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/baseline/data/original/shape_static.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":175.000007127896,"w":356,"h":200,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[178,100,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[35.368,-37.448],[-9,37.5]],"o":[[0,0],[0,0],[-34,36],[9,-37.5]],"v":[[-16,-29],[-45,-21.5],[-100.5,14.5],[56,3]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/manual/testApp/shape_complex2.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":175.000007127896,"w":356,"h":200,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[178,100,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-13,-0.5],[0,0],[12.927,19.168],[0,0]],"o":[[47.465,1.826],[0,0],[-14.5,-21.5],[0,0]],"v":[[3.5,4],[17.5,39.5],[-28.5,29.5],[21,-23]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/baseline/data/original/shape_complex2.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":175.000007127896,"w":356,"h":200,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[178,100,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-13,-0.5],[0,0],[12.927,19.168],[0,0]],"o":[[47.465,1.826],[0,0],[-14.5,-21.5],[0,0]],"v":[[3.5,4],[17.5,39.5],[-28.5,29.5],[21,-23]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/manual/testApp/rect_skew.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":241.000009816131,"w":356,"h":200,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[106.5,71.5,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[43.5,43.5],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[0],"e":[41]},{"t":139.000005661586}],"ix":4},"sa":{"a":0,"k":191,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/manual/testApp/testApp.pro:
--------------------------------------------------------------------------------
1 | QT += quick
2 | CONFIG += c++11
3 |
4 | # The following define makes your compiler emit warnings if you use
5 | # any feature of Qt which as been marked deprecated (the exact warnings
6 | # depend on your compiler). Please consult the documentation of the
7 | # deprecated API in order to know how to port your code away from it.
8 | DEFINES += QT_DEPRECATED_WARNINGS
9 |
10 | # You can also make your code fail to compile if you use deprecated APIs.
11 | # In order to do so, uncomment the following line.
12 | # You can also select to disable deprecated APIs only up to a certain version of Qt.
13 | #DEFINES += QT_DISABLE_DEPRECATED_UP_TO=0x060000 # disables all APIs deprecated in Qt 6.0.0 and earlier
14 |
15 | SOURCES += \
16 | main.cpp \
17 |
18 | RESOURCES += qml.qrc
19 |
20 | # Additional import path used to resolve QML modules in Qt Creator's code model
21 | QML_IMPORT_PATH =
22 | # Additional import path used to resolve QML modules just for Qt Quick Designer
23 | QML_DESIGNER_IMPORT_PATH =
24 |
25 | # Default rules for deployment.
26 | qnx: target.path = /tmp/$${TARGET}/bin
27 | else: unix:!android: target.path = /opt/$${TARGET}/bin
28 | !isEmpty(target.path): INSTALLS += target
29 |
30 | qmldir.files = C:\users\kahautam\projects\lg\lottie-qt\src\imports\qmldir
31 | qmldir.path = /usr/lib/qml/Qt/labs/lottieqt
32 | INSTALLS += qmldir
33 |
34 | #HEADERS +=
35 |
--------------------------------------------------------------------------------
/src/lottie/qlottiefilleffect_p.h:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2018 The Qt Company Ltd.
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3 |
4 | #ifndef QLOTIEFILLEFFECT_P_H
5 | #define QLOTIEFILLEFFECT_P_H
6 |
7 | //
8 | // W A R N I N G
9 | // -------------
10 | //
11 | // This file is not part of the Qt API. It exists purely as an
12 | // implementation detail. This header file may change from version to
13 | // version without notice, or even be removed.
14 | //
15 | // We mean it.
16 | //
17 |
18 | #include
19 | #include
20 |
21 | #include
22 | #include
23 |
24 | QT_BEGIN_NAMESPACE
25 |
26 | class QJsonObject;
27 |
28 | class Q_LOTTIE_EXPORT QLottieFillEffect : public QLottieBase
29 | {
30 | public:
31 | QLottieFillEffect() = default;
32 | explicit QLottieFillEffect(const QLottieFillEffect &other);
33 |
34 | QLottieBase *clone() const override;
35 |
36 | void construct(const QJsonObject &definition);
37 |
38 | void updateProperties(int frame) override;
39 | void render(QLottieRenderer &renderer) const override;
40 |
41 | QColor color() const;
42 | qreal opacity() const;
43 |
44 | protected:
45 | QLottieProperty4D m_color;
46 | QLottieProperty m_opacity;
47 | };
48 |
49 | QT_END_NAMESPACE
50 |
51 | #endif // QLOTIEFILLEFFECT_P_H
52 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/trimpath/data/trimpath_animated_2080_0_to_0060_3x30.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":100,"h":100,"nm":"AnimatedQTrimPathShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[50,50,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[-29.992,10.008],[30.008,10]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ind":1,"ty":"sh","ix":2,"ks":{"a":0,"k":{"i":[[-12,25.75],[-14.75,-26.75]],"o":[[12,-25.75],[14.75,26.75]],"v":[[-31.25,-15.25],[28.5,-16]],"c":false},"ix":2},"nm":"Path 2","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[20],"e":[0]},{"t":179}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[80],"e":[60]},{"t":179}],"ix":2},"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[0],"e":[1110]},{"t":179}],"ix":3},"m":2,"ix":3,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":-179,"op":184,"st":-179,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/baseline/data/original/rect_skew.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":241.000009816131,"w":356,"h":200,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[106.5,71.5,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[43.5,43.5],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"st","c":{"a":0,"k":[0,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[0],"e":[41]},{"t":139.000005661586}],"ix":4},"sa":{"a":0,"k":191,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/manual/testApp/rect_skew_axis.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":241.000009816131,"w":356,"h":200,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[106.5,71.5,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[43.5,43.5],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":41,"ix":4},"sa":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[0],"e":[191]},{"t":139.000005661586}],"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/baseline/data/original/rect_skew_axis.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":241.000009816131,"w":356,"h":200,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[106.5,71.5,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[43.5,43.5],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"st","c":{"a":0,"k":[0,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":41,"ix":4},"sa":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[0],"e":[191]},{"t":139.000005661586}],"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/src/lottie/qlottieimage_p.h:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2018 The Qt Company Ltd.
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3 |
4 | #ifndef QLOTTIEIMAGE_P_H
5 | #define QLOTTIEIMAGE_P_H
6 |
7 | //
8 | // W A R N I N G
9 | // -------------
10 | //
11 | // This file is not part of the Qt API. It exists purely as an
12 | // implementation detail. This header file may change from version to
13 | // version without notice, or even be removed.
14 | //
15 | // We mean it.
16 | //
17 |
18 | #include
19 | #include
20 | #include
21 |
22 | #include
23 | #include
24 |
25 | QT_BEGIN_NAMESPACE
26 |
27 | class QJsonObject;
28 |
29 | class Q_LOTTIE_EXPORT QLottieImage : public QLottieBase
30 | {
31 | public:
32 | explicit QLottieImage(const QLottieImage &other);
33 | QLottieImage(QLottieBase *parent = nullptr);
34 |
35 | QLottieBase *clone() const override;
36 |
37 | int construct(const QJsonObject &definition);
38 |
39 | void render(QLottieRenderer &renderer) const override;
40 |
41 | QUrl url() const { return m_url; }
42 | QSizeF size() const { return m_size; }
43 | QImage image() const { return m_image; }
44 |
45 | protected:
46 | QUrl m_url;
47 | QSizeF m_size;
48 | QImage m_image;
49 | };
50 |
51 | QT_END_NAMESPACE
52 |
53 | #endif // QLOTTIEIMAGE_P_H
54 |
--------------------------------------------------------------------------------
/src/lottie/qlottieroot_p.h:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2025 The Qt Company Ltd.
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3 |
4 | #ifndef QLOTTIEROOT_P_H
5 | #define QLOTTIEROOT_P_H
6 |
7 | //
8 | // W A R N I N G
9 | // -------------
10 | //
11 | // This file is not part of the Qt API. It exists purely as an
12 | // implementation detail. This header file may change from version to
13 | // version without notice, or even be removed.
14 | //
15 | // We mean it.
16 | //
17 |
18 | #include
19 |
20 | QT_BEGIN_NAMESPACE
21 |
22 | class Q_LOTTIE_EXPORT QLottieRoot : public QLottieBase
23 | {
24 | public:
25 | QLottieRoot() = default;
26 | explicit QLottieRoot(const QLottieRoot &other);
27 |
28 | QLottieBase *clone() const override;
29 | QSize layerSize() const override;
30 |
31 | int parseSource(const QByteArray &jsonSource, const QUrl &fileSource);
32 |
33 | void setStructureDumping(bool enabled);
34 |
35 | int startFrame() const {
36 | return m_startFrame;
37 | }
38 |
39 | int endFrame() const {
40 | return m_endFrame;
41 | }
42 |
43 | int frameRate() const {
44 | return m_frameRate;
45 | }
46 |
47 | private:
48 | QSize m_size;
49 | int m_frameRate = 30;
50 | int m_startFrame = 0;
51 | int m_endFrame = 0;
52 | };
53 |
54 | QT_END_NAMESPACE
55 |
56 | #endif // QLOTTIEROOT_P_H
57 |
--------------------------------------------------------------------------------
/tools/lottietoqml/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2025 The Qt Company Ltd.
2 | # SPDX-License-Identifier: BSD-3-Clause
3 |
4 | #####################################################################
5 | ## lottietoqml Tool:
6 | #####################################################################
7 |
8 | find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS QuickVectorImageGeneratorPrivate)
9 | find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS QuickVectorImageGeneratorPrivate)
10 |
11 | qt_get_tool_target_name(target_name lottietoqml)
12 | qt_internal_add_tool(${target_name}
13 | TARGET_DESCRIPTION "Lottie to QML Converter"
14 | TOOLS_TARGET Lottie
15 | EXTRA_CMAKE_FILES
16 | "${CMAKE_CURRENT_SOURCE_DIR}/${QT_CMAKE_EXPORT_NAMESPACE}LottieToQmlMacros.cmake"
17 | EXTRA_CMAKE_INCLUDES
18 | "${QT_CMAKE_EXPORT_NAMESPACE}LottieToQmlMacros.cmake"
19 | SOURCES
20 | main.cpp
21 | LIBRARIES
22 | Qt::Core
23 | Qt::Gui
24 | Qt::Qml
25 | Qt::Quick
26 | Qt::QuickPrivate
27 | Qt::QuickVectorImageGeneratorPrivate
28 | Qt::LottieVectorImageGeneratorPrivate
29 | Qt::LottiePrivate
30 | )
31 |
32 | qt_internal_return_unless_building_tools()
33 |
34 | set(resource_files
35 | "main.qml"
36 | )
37 |
38 | qt_internal_add_resource(${target_name} "qml"
39 | PREFIX
40 | "/"
41 | FILES
42 | ${resource_files}
43 | )
44 |
--------------------------------------------------------------------------------
/src/vectorimagehelpers/qquicklayeritem_p.h:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2025 The Qt Company Ltd.
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3 |
4 | #ifndef QQUICKLAYERITEM_P_H
5 | #define QQUICKLAYERITEM_P_H
6 |
7 | //
8 | // W A R N I N G
9 | // -------------
10 | //
11 | // This file is not part of the Qt API. It exists purely as an
12 | // implementation detail. This header file may change from version to
13 | // version without notice, or even be removed.
14 | //
15 | // We mean it.
16 | //
17 |
18 | #include
19 | #include
20 | #include
21 |
22 | QT_BEGIN_NAMESPACE
23 |
24 | class Q_LOTTIEVECTORIMAGEHELPERS_EXPORT QQuickLayerItem : public QQuickItem
25 | {
26 | Q_OBJECT
27 | Q_PROPERTY(QMatrix4x4 transformMatrix READ transformMatrix NOTIFY transformMatrixChanged)
28 | QML_NAMED_ELEMENT(LayerItem)
29 | Q_DECLARE_PRIVATE(QQuickItem)
30 | QML_ADDED_IN_VERSION(6, 10)
31 |
32 | public:
33 | QQuickLayerItem(QQuickItem *parent = nullptr);
34 | QMatrix4x4 transformMatrix();
35 |
36 | protected:
37 | void itemChange(ItemChange change, const ItemChangeData &) override;
38 |
39 | private:
40 | bool m_transformDirty = true;
41 | QMatrix4x4 m_transform;
42 |
43 | signals:
44 | void transformMatrixChanged();
45 | };
46 |
47 | QT_END_NAMESPACE
48 |
49 | #endif // QQUICKLAYERITEM_P_H
50 |
51 |
--------------------------------------------------------------------------------
/tests/manual/testApp/rect_rotate_shape.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":175.000007127896,"w":550,"h":309,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[275,154.5,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[36,-32],[-36,-32],[-36,32],[36,32]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":4,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[87,59.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[360],"e":[720]},{"t":70.0000028511585}],"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/baseline/data/original/rect_rotate_shape.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":175.000007127896,"w":550,"h":309,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[275,154.5,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[36,-32],[-36,-32],[-36,32],[36,32]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":4,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[87,59.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[360],"e":[720]},{"t":70.0000028511585}],"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/baseline/data/original/rotate_anchor.json:
--------------------------------------------------------------------------------
1 | {"ddd":0,"h":800,"w":800,"meta":{"g":"@lottiefiles/toolkit-js 0.57.2-beta.0"},"layers":[{"ty":4,"sr":1,"st":0,"op":937.3333333333334,"ip":0,"ln":"15","hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"p":{"a":0,"k":[560,440]},"r":{"a":0,"k":0},"o":{"a":0,"k":100}},"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"p":{"a":0,"k":[0,0]},"r":{"a":0,"k":0},"s":{"a":0,"k":[150,200]}},{"ty":"st","lc":1,"lj":1,"ml":4,"o":{"a":0,"k":100},"w":{"a":0,"k":2},"c":{"a":0,"k":[1,1,1]}},{"ty":"fl","c":{"a":0,"k":[0,0.0119,1]},"r":1,"o":{"a":0,"k":100}},{"ty":"tr","a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"p":{"a":0,"k":[100,0]},"r":{"a":0,"k":0},"o":{"a":0,"k":100}}]}],"ind":1},{"ty":4,"sr":1,"st":0,"op":937.3333333333334,"ip":0,"ln":"13","hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"p":{"a":0,"k":[560,440]},"r":{"a":0,"k":0},"o":{"a":0,"k":100}},"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"p":{"a":0,"k":[-100,0]},"r":{"a":0,"k":0},"s":{"a":0,"k":[200,150]}},{"ty":"st","lc":1,"lj":1,"ml":4,"o":{"a":0,"k":100},"w":{"a":0,"k":2},"c":{"a":0,"k":[1,1,1]}},{"ty":"fl","c":{"a":0,"k":[1,0,0]},"r":1,"o":{"a":0,"k":100}},{"ty":"tr","a":{"a":0,"k":[100,0]},"s":{"a":0,"k":[100,100]},"p":{"a":0,"k":[0,0]},"r":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[0],"t":0},{"s":[90],"t":92.66666666666667}]},"o":{"a":0,"k":100}}]}],"ind":2}],"v":"5.7.0","fr":29,"op":100,"ip":0,"assets":[]}
--------------------------------------------------------------------------------
/LICENSES/BSD-3-Clause.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) .
2 |
3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4 |
5 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
7 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
8 |
9 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10 |
--------------------------------------------------------------------------------
/tests/manual/html/content.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":114.000004643315,"w":356,"h":200,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[0],"e":[63]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":45,"s":[63],"e":[0]},{"t":90.0000036657751}],"ix":10},"p":{"a":0,"k":[178,100,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[54.5,66.5],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":114.000004643315,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/manual/testApp/rect_rotate.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":60,"ip":0,"op":114.000004643315,"w":356,"h":200,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[0],"e":[63]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":45,"s":[63],"e":[0]},{"t":90.0000036657751}],"ix":10},"p":{"a":0,"k":[178,100,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[54.5,66.5],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":114.000004643315,"st":0,"bm":0}],"markers":[]}
2 |
3 |
--------------------------------------------------------------------------------
/tests/baseline/data/original/rect_rotate.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":60,"ip":0,"op":114.000004643315,"w":356,"h":200,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[0],"e":[63]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":45,"s":[63],"e":[0]},{"t":90.0000036657751}],"ix":10},"p":{"a":0,"k":[178,100,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[54.5,66.5],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"st","c":{"a":0,"k":[0,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":114.000004643315,"st":0,"bm":0}],"markers":[]}
2 |
3 |
--------------------------------------------------------------------------------
/tests/manual/testApp/rect_gfill_linear.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":241.000009816131,"w":356,"h":200,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[110.5,70.5,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,88.682,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[100,100],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[2,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[0],"e":[191]},{"t":139.000005661586}],"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":2,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"gf","o":{"a":0,"k":100,"ix":10},"r":1,"g":{"p":3,"k":{"a":0,"k":[0,1,0,0,0.5,0.5,0,0.5,1,0,0,1],"ix":9}},"s":{"a":0,"k":[-50,-50],"ix":5},"e":{"a":0,"k":[0,0],"ix":6},"t":1,"nm":"Gradient Fill 1","mn":"ADBE Vector Graphic - G-Fill","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/baseline/data/original/rect_gfill_linear.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":241.000009816131,"w":356,"h":200,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[110.5,70.5,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,88.682,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[100,100],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"st","c":{"a":0,"k":[0,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[2,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[0],"e":[191]},{"t":139.000005661586}],"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":2,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"gf","o":{"a":0,"k":100,"ix":10},"r":1,"g":{"p":3,"k":{"a":0,"k":[0,1,0,0,0.5,0.5,0,0.5,1,0,0,1],"ix":9}},"s":{"a":0,"k":[-50,-50],"ix":5},"e":{"a":0,"k":[0,0],"ix":6},"t":1,"nm":"Gradient Fill 1","mn":"ADBE Vector Graphic - G-Fill","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/manual/testApp/easing_rect_translate.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":175.000007127896,"w":400,"h":224,"nm":"rect translate","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[200,112,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[50,-31.75],[-50,-31.75],[-50,31.75],[50,31.75]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":1,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0.23529399797,1,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":1,"k":[{"i":{"x":0.939,"y":0},"o":{"x":0.958,"y":0.066},"n":"0p939_0_0p958_0p066","t":0,"s":[-37.5,-1.25],"e":[137.5,-1.25],"to":[29.1666660308838,0],"ti":[-29.1666660308838,0]},{"t":168.00000684278}],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/baseline/data/original/easing_rect_translate.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":175.000007127896,"w":400,"h":224,"nm":"rect translate","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[200,112,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[50,-31.75],[-50,-31.75],[-50,31.75],[50,31.75]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":1,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0.23529399797,1,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":1,"k":[{"i":{"x":0.939,"y":0},"o":{"x":0.958,"y":0.066},"n":"0p939_0_0p958_0p066","t":0,"s":[-37.5,-1.25],"e":[137.5,-1.25],"to":[29.1666660308838,0],"ti":[-29.1666660308838,0]},{"t":168.00000684278}],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/manual/testApp/rect_gfill_radial.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":241.000009816131,"w":356,"h":200,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[100,100,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[100,100],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[0],"e":[191]},{"t":139.000005661586}],"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":2,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"gf","o":{"a":0,"k":100,"ix":10},"r":1,"g":{"p":3,"k":{"a":0,"k":[0,1,0,0,0.5,0.5,0,0.5,1,0,0,1],"ix":9}},"s":{"a":0,"k":[-50,-50],"ix":5},"e":{"a":0,"k":[0,0],"ix":6},"t":2,"h":{"a":0,"k":100,"ix":7},"a":{"a":0,"k":0,"ix":8},"nm":"Gradient Fill 1","mn":"ADBE Vector Graphic - G-Fill","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/src/lottie/qlottierepeatertransform_p.h:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2018 The Qt Company Ltd.
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3 |
4 | #ifndef LOTTIEREPEATERTRANSFORM_P_H
5 | #define LOTTIEREPEATERTRANSFORM_P_H
6 |
7 | //
8 | // W A R N I N G
9 | // -------------
10 | //
11 | // This file is not part of the Qt API. It exists purely as an
12 | // implementation detail. This header file may change from version to
13 | // version without notice, or even be removed.
14 | //
15 | // We mean it.
16 | //
17 |
18 | #include
19 |
20 | QT_BEGIN_NAMESPACE
21 |
22 | class QJsonObject;
23 |
24 | class Q_LOTTIE_EXPORT QLottieRepeaterTransform : public QLottieBasicTransform
25 | {
26 | public:
27 | explicit QLottieRepeaterTransform(const QLottieRepeaterTransform &other);
28 | QLottieRepeaterTransform(QLottieBase *parent = nullptr);
29 |
30 | QLottieBase *clone() const override;
31 |
32 | int parse(const QJsonObject &definition) override;
33 |
34 | void updateProperties(int frame) override;
35 | void render(QLottieRenderer &renderer) const override;
36 |
37 | qreal startOpacity() const;
38 | qreal endOpacity() const;
39 |
40 | void setInstanceCount(int copies);
41 | qreal opacityAtInstance(int instance) const;
42 |
43 | protected:
44 | int m_copies = 0;
45 | QLottieProperty m_startOpacity;
46 | QLottieProperty m_endOpacity;
47 | QList m_opacities;
48 | };
49 |
50 | QT_END_NAMESPACE
51 |
52 | #endif // LottieREPEATERTRANSFORM_P_H
53 |
--------------------------------------------------------------------------------
/tests/baseline/data/original/rect_gfill_radial.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":241.000009816131,"w":356,"h":200,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[100,100,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[100,100],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"st","c":{"a":0,"k":[0,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[0],"e":[191]},{"t":139.000005661586}],"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":2,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"gf","o":{"a":0,"k":100,"ix":10},"r":1,"g":{"p":3,"k":{"a":0,"k":[0,1,0,0,0.5,0.5,0,0.5,1,0,0,1],"ix":9}},"s":{"a":0,"k":[-50,-50],"ix":5},"e":{"a":0,"k":[0,0],"ix":6},"t":2,"h":{"a":0,"k":100,"ix":7},"a":{"a":0,"k":0,"ix":8},"nm":"Gradient Fill 1","mn":"ADBE Vector Graphic - G-Fill","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/manual/testApp/gradient_fill.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":241.000009816131,"w":356,"h":200,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[106.5,71.5,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[103.689,91.954,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[43.5,43.5],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":41,"ix":4},"sa":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[0],"e":[191]},{"t":139.000005661586}],"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":2,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"gf","o":{"a":0,"k":100,"ix":10},"r":1,"g":{"p":3,"k":{"a":0,"k":[0,1,0,0,0.5,0.5,0,0.5,1,0,0,1],"ix":9}},"s":{"a":0,"k":[2,0],"ix":5},"e":{"a":0,"k":[15,6],"ix":6},"t":2,"h":{"a":0,"k":84,"ix":7},"a":{"a":0,"k":-7,"ix":8},"nm":"Gradient Fill 1","mn":"ADBE Vector Graphic - G-Fill","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/manual/testApp/rect_anchor_std_anim.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":175.000007127896,"w":356,"h":200,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[0,0,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[43.5,43.5],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":0,"s":[0,0],"e":[-43.5,-43.5],"to":[-7.25,-7.25],"ti":[0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":70,"s":[-43.5,-43.5],"e":[0,0],"to":[0,0],"ti":[-7.25,-7.25]},{"t":119.000004846969}],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":147.000005987433,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/baseline/data/original/gradient_fill.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":241.000009816131,"w":356,"h":200,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[106.5,71.5,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[103.689,91.954,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[43.5,43.5],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"st","c":{"a":0,"k":[0,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":41,"ix":4},"sa":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[0],"e":[191]},{"t":139.000005661586}],"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":2,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"gf","o":{"a":0,"k":100,"ix":10},"r":1,"g":{"p":3,"k":{"a":0,"k":[0,1,0,0,0.5,0.5,0,0.5,1,0,0,1],"ix":9}},"s":{"a":0,"k":[2,0],"ix":5},"e":{"a":0,"k":[15,6],"ix":6},"t":2,"h":{"a":0,"k":84,"ix":7},"a":{"a":0,"k":-7,"ix":8},"nm":"Gradient Fill 1","mn":"ADBE Vector Graphic - G-Fill","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/baseline/data/original/rect_anchor_std_anim.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":175.000007127896,"w":356,"h":200,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[0,0,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[43.5,43.5],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"st","c":{"a":0,"k":[0,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":0,"s":[0,0],"e":[-43.5,-43.5],"to":[-7.25,-7.25],"ti":[0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":70,"s":[-43.5,-43.5],"e":[0,0],"to":[0,0],"ti":[-7.25,-7.25]},{"t":119.000004846969}],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":147.000005987433,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/src/lottie/qlottiefill_p.h:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2018 The Qt Company Ltd.
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3 |
4 | #ifndef QLOTTIEFILL_P_H
5 | #define QLOTTIEFILL_P_H
6 |
7 | //
8 | // W A R N I N G
9 | // -------------
10 | //
11 | // This file is not part of the Qt API. It exists purely as an
12 | // implementation detail. This header file may change from version to
13 | // version without notice, or even be removed.
14 | //
15 | // We mean it.
16 | //
17 |
18 | #include
19 | #include
20 |
21 | #include
22 | #include
23 |
24 | QT_BEGIN_NAMESPACE
25 |
26 | class Q_LOTTIE_EXPORT QLottieFill : public QLottieShape
27 | {
28 | public:
29 | explicit QLottieFill(const QLottieFill &other);
30 | QLottieFill(QLottieBase *parent = nullptr);
31 |
32 | QLottieBase *clone() const override;
33 |
34 | void updateProperties(int frame) override;
35 |
36 | void render(QLottieRenderer &renderer) const override;
37 | int parse(const QJsonObject &definition) override;
38 |
39 | QColor color() const;
40 | qreal opacity() const;
41 | Qt::FillRule fillRule() const;
42 |
43 | QLottieProperty4D colorProperty() const { return m_color; }
44 | QLottieProperty opacityProperty() const { return m_opacity; }
45 |
46 | protected:
47 | QLottieProperty4D m_color;
48 | QLottieProperty m_opacity;
49 | Qt::FillRule m_fillRule = Qt::WindingFill;
50 | };
51 |
52 | QT_END_NAMESPACE
53 |
54 | #endif // QLOTTIEFILL_P_H
55 |
--------------------------------------------------------------------------------
/tests/manual/testApp/shape_bezier_simple.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":175.000007127896,"w":400,"h":224,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[200,112,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[-15,0]],"o":[[0,0],[58.502,0]],"v":[[1,0],[-0.5,61]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false}],"ip":0,"op":174.825007120768,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/baseline/data/original/shape_bezier_simple.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":175.000007127896,"w":400,"h":224,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[200,112,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[-15,0]],"o":[[0,0],[58.502,0]],"v":[[1,0],[-0.5,61]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"st","c":{"a":0,"k":[0,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false}],"ip":0,"op":174.825007120768,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/src/lottie/qlottieshape_p.h:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2018 The Qt Company Ltd.
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3 |
4 | #ifndef QLOTTIESHAPE_P_H
5 | #define QLOTTIESHAPE_P_H
6 |
7 | //
8 | // W A R N I N G
9 | // -------------
10 | //
11 | // This file is not part of the Qt API. It exists purely as an
12 | // implementation detail. This header file may change from version to
13 | // version without notice, or even be removed.
14 | //
15 | // We mean it.
16 | //
17 |
18 | #include
19 |
20 | #include
21 | #include
22 |
23 | QT_BEGIN_NAMESPACE
24 |
25 | class QLottieFill;
26 | class QLottieStroke;
27 | class QLottieTrimPath;
28 |
29 | class Q_LOTTIE_EXPORT QLottieShape : public QLottieBase
30 | {
31 | public:
32 | QLottieShape() = default;
33 | explicit QLottieShape(const QLottieShape &other);
34 |
35 | QLottieBase *clone() const override;
36 |
37 | static QLottieShape *construct(QJsonObject definition, QLottieBase *parent = nullptr);
38 |
39 | virtual const QPainterPath &path() const;
40 | virtual bool acceptsTrim() const;
41 | virtual void applyTrim(const QLottieTrimPath& trimmer);
42 | const QLottieTrimPath *currentTrim() const { return m_appliedTrim; };
43 |
44 | int direction() const;
45 | bool hasReversedDirection() const { return m_direction == 3; }
46 |
47 | protected:
48 | QPainterPath m_path;
49 | QLottieTrimPath *m_appliedTrim = nullptr;
50 | int m_direction = 0;
51 | };
52 |
53 | QT_END_NAMESPACE
54 |
55 | #endif // QLOTTIESHAPE_P_H
56 |
--------------------------------------------------------------------------------
/tests/baseline/data/original/stroke.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":70,"w":400,"h":224,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[250,132,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"d":1,"ty":"el","s":{"a":0,"k":[100,100],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[1,0.5,1],"ix":3},"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[10]},{"t":70,"s":[100]}],"ix":4},"w":{"a":0,"k":20,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0},{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[200,112,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"d":1,"ty":"el","s":{"a":0,"k":[100,100],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[0,0,0,1]},{"t":64.0000026067734,"s":[0,1,1,1]}],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
--------------------------------------------------------------------------------
/src/lottie/qlottierepeater_p.h:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2018 The Qt Company Ltd.
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3 |
4 | #ifndef QLOTTIEREPEATER_P_H
5 | #define QLOTTIEREPEATER_P_H
6 |
7 | //
8 | // W A R N I N G
9 | // -------------
10 | //
11 | // This file is not part of the Qt API. It exists purely as an
12 | // implementation detail. This header file may change from version to
13 | // version without notice, or even be removed.
14 | //
15 | // We mean it.
16 | //
17 |
18 | #include
19 | #include
20 | #include
21 | #include
22 |
23 | QT_BEGIN_NAMESPACE
24 |
25 | class QJsonObject;
26 |
27 | class Q_LOTTIE_EXPORT QLottieRepeater : public QLottieShape
28 | {
29 | public:
30 | QLottieRepeater() = default;
31 | explicit QLottieRepeater(const QLottieRepeater &other) = default;
32 | QLottieRepeater(const QJsonObject &definition, QLottieBase *parent = nullptr);
33 |
34 | QLottieBase *clone() const override;
35 |
36 | void construct(const QJsonObject &definition);
37 |
38 | void updateProperties(int frame) override;
39 | void render(QLottieRenderer &renderer) const override;
40 |
41 | int copies() const;
42 | qreal offset() const;
43 | const QLottieRepeaterTransform &transform() const;
44 |
45 | protected:
46 | QLottieProperty m_copies;
47 | QLottieProperty m_offset;
48 | QLottieRepeaterTransform m_transform;
49 | };
50 |
51 | QT_END_NAMESPACE
52 |
53 | #endif // QLOTTIEREPEATER_P_H
54 |
--------------------------------------------------------------------------------
/src/lottie/qlottieround_p.h:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2018 The Qt Company Ltd.
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3 |
4 | #ifndef QLOTTIEROUND_P_H
5 | #define QLOTTIEROUND_P_H
6 |
7 | //
8 | // W A R N I N G
9 | // -------------
10 | //
11 | // This file is not part of the Qt API. It exists purely as an
12 | // implementation detail. This header file may change from version to
13 | // version without notice, or even be removed.
14 | //
15 | // We mean it.
16 | //
17 |
18 | #include
19 | #include
20 | #include
21 | #include
22 |
23 | #include
24 | #include
25 | #include
26 | #include
27 | #include
28 |
29 | QT_BEGIN_NAMESPACE
30 |
31 | class QJsonObject;
32 |
33 | class Q_LOTTIE_EXPORT QLottieRound : public QLottieShape
34 | {
35 | public:
36 | explicit QLottieRound(const QLottieRound &other);
37 | QLottieRound(QLottieBase *parent = nullptr);
38 |
39 | QLottieBase *clone() const override;
40 |
41 | int parse(const QJsonObject &definition) override;
42 |
43 | void updateProperties(int frame) override;
44 | void render(QLottieRenderer &renderer) const override;
45 | bool acceptsTrim() const override;
46 |
47 | QPointF position() const;
48 | qreal radius() const;
49 |
50 | protected:
51 | QLottieSpatialProperty m_position;
52 | QLottieProperty m_radius;
53 | };
54 |
55 | QT_END_NAMESPACE
56 |
57 | #endif // QLOTTIEROUND_P_H
58 |
--------------------------------------------------------------------------------
/tests/auto/qml/data/rec_pos_col_opa.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":60,"op":180,"w":100,"h":100,"nm":"Test","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[50,50,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[40,40],"ix":2},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":60,"s":[0,0],"e":[25,-25],"to":[4.16666650772095,-4.16666650772095],"ti":[-4.16666650772095,4.16666650772095]},{"t":119}],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"st","c":{"a":0,"k":[1,0,0,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":60,"s":[1,0,0,1],"e":[0,0,1,1]},{"t":119}],"ix":4},"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":60,"s":[100],"e":[25]},{"t":119}],"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":60,"op":120,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/src/lottie/qlottieellipse_p.h:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2018 The Qt Company Ltd.
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3 |
4 | #ifndef QLOTTIEELLIPSE_P_H
5 | #define QLOTTIEELLIPSE_P_H
6 |
7 | //
8 | // W A R N I N G
9 | // -------------
10 | //
11 | // This file is not part of the Qt API. It exists purely as an
12 | // implementation detail. This header file may change from version to
13 | // version without notice, or even be removed.
14 | //
15 | // We mean it.
16 | //
17 |
18 | #include
19 | #include
20 | #include
21 | #include
22 | #include
23 |
24 | #include
25 | #include
26 | #include
27 | #include
28 | #include
29 |
30 | QT_BEGIN_NAMESPACE
31 |
32 | class QJsonObject;
33 |
34 | class Q_LOTTIE_EXPORT QLottieEllipse : public QLottieShape
35 | {
36 | public:
37 | explicit QLottieEllipse(const QLottieEllipse &other);
38 | QLottieEllipse(QLottieBase *parent = nullptr);
39 |
40 | QLottieBase *clone() const override;
41 |
42 | void updateProperties(int frame) override;
43 | void render(QLottieRenderer &renderer) const override;
44 | int parse(const QJsonObject &definition) override;
45 |
46 | bool acceptsTrim() const override;
47 |
48 | QPointF position() const;
49 | QSizeF size() const;
50 |
51 | protected:
52 | QLottieSpatialProperty m_position;
53 | QLottieProperty2D m_size;
54 | };
55 |
56 | QT_END_NAMESPACE
57 |
58 | #endif // QLOTTIEELLIPSE_P_H
59 |
--------------------------------------------------------------------------------
/tests/manual/testApp/repeater1.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":175.000007127896,"w":400,"h":224,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[64,76,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"d":1,"ty":"el","s":{"a":0,"k":[100,100],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0.615686297417,0.129411771894,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 2","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"rc","d":1,"s":{"a":0,"k":[100,100],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"gr","it":[{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":0,"cix":2,"ix":4,"mn":"ADBE Vector Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"rp","c":{"a":0,"k":3,"ix":1},"o":{"a":0,"k":0,"ix":2},"m":1,"ix":6,"tr":{"ty":"tr","p":{"a":0,"k":[100,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":4},"so":{"a":0,"k":100,"ix":5},"eo":{"a":0,"k":100,"ix":6},"nm":"Transform"},"nm":"Repeater 1","mn":"ADBE Vector Filter - Repeater","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/baseline/data/original/repeater1.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":175.000007127896,"w":400,"h":224,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[64,76,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"d":1,"ty":"el","s":{"a":0,"k":[100,100],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0.615686297417,0.129411771894,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 2","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"rc","d":1,"s":{"a":0,"k":[100,100],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"gr","it":[{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":0,"cix":2,"ix":4,"mn":"ADBE Vector Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"rp","c":{"a":0,"k":3,"ix":1},"o":{"a":0,"k":0,"ix":2},"m":1,"ix":6,"tr":{"ty":"tr","p":{"a":0,"k":[100,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":4},"so":{"a":0,"k":100,"ix":5},"eo":{"a":0,"k":100,"ix":6},"nm":"Transform"},"nm":"Repeater 1","mn":"ADBE Vector Filter - Repeater","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/examples/lottie/qtlottieviewer/doc/src/qtlottieviewerexample.qdoc:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2025 The Qt Company Ltd.
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3 |
4 | /*!
5 | \title qtlottieviewer Example
6 | \example qtlottieviewer
7 | \image qtlottieviewerexample.png {Lottie animation viewer with frame rate and
8 | scaling controls}
9 | \brief An example demonstrating the use of Qt LottieAnimation in an application.
10 | \ingroup qtlottieexamples
11 | \examplecategory {Graphics}
12 |
13 | This example demonstrates how to use the \l{LottieAnimation} item
14 | of the \l{Qt.labs.lottieqt} module to directly display and control
15 | a Lottie animated vector graphics file in a Qt Quick application.
16 |
17 | \section1 Overview
18 |
19 | The main part of the example window is a Rectangle containing a
20 | LottieAnimation item which plays a Lottie animation.
21 |
22 | Below this is a row controls. The user can control the animation
23 | speed with the Frame Rate slider, and zoom in and out using the
24 | Scale slider. The animation can be stopped and restarted using the
25 | Play/Pause button. When paused, the user can select the exact
26 | frame to be displayed using the Goto Frame slider. The Open button
27 | will display a file dialog, allowing the user to select a Lottie
28 | file to load and display.
29 |
30 | LottieAnimation is a \l{QQuickPaintedItem}, employing software
31 | rasterization of the vector graphics. For alternative ways
32 | displaying Lottie files in Quick applications, utilizing graphics
33 | hardware rendering, see \l{lottietoqml} and the \l{VectorImage}
34 | item.
35 |
36 | */
37 |
--------------------------------------------------------------------------------
/examples/lottie/qtlottieviewer/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2025 The Qt Company Ltd.
2 | # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3 |
4 | cmake_minimum_required(VERSION 3.16)
5 |
6 | project(qtlottieviewer LANGUAGES CXX)
7 |
8 | set(CMAKE_CXX_STANDARD_REQUIRED ON)
9 |
10 | find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick QuickControls2)
11 |
12 | qt_standard_project_setup(REQUIRES 6.8)
13 |
14 | qt_add_executable(qtlottieviewerexample
15 | main.cpp
16 | )
17 |
18 | set(default_lottie_file "logo.json")
19 | set_source_files_properties(${default_lottie_file} PROPERTIES
20 | QT_RESOURCE_ALIAS default_file.json
21 | )
22 |
23 | qt_add_qml_module(qtlottieviewerexample
24 | URI qtlottieviewer
25 | VERSION 1.0
26 | QML_FILES
27 | Main.qml
28 | RESOURCES
29 | ${default_lottie_file}
30 | RESOURCE_PREFIX
31 | /
32 | )
33 |
34 | target_link_libraries(qtlottieviewerexample PRIVATE
35 | Qt6::Core
36 | Qt6::Gui
37 | Qt6::Qml
38 | Qt6::Quick
39 | Qt6::QuickControls2
40 | )
41 |
42 | set(resource_files
43 | "qtquickcontrols2.conf"
44 | )
45 |
46 | qt_add_resources(qtlottieviewerexample "res"
47 | PREFIX
48 | "/"
49 | FILES
50 | ${resource_files}
51 | )
52 |
53 | install(TARGETS qtlottieviewerexample
54 | BUNDLE DESTINATION .
55 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
56 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
57 | )
58 |
59 | qt_generate_deploy_qml_app_script(
60 | TARGET qtlottieviewerexample
61 | OUTPUT_SCRIPT deploy_script
62 | MACOS_BUNDLE_POST_BUILD
63 | NO_UNSUPPORTED_PLATFORM_ERROR
64 | DEPLOY_USER_QML_MODULES_ON_UNSUPPORTED_PLATFORM
65 | )
66 | install(SCRIPT ${deploy_script})
67 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/repeatertransform/data/repeater_transform_animated.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":100,"h":100,"nm":"AnimatedRepeaterTransformShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[0,0,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"rp","c":{"a":0,"k":3,"ix":1},"o":{"a":0,"k":0,"ix":2},"m":1,"ix":1,"tr":{"ty":"tr","p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":0,"s":[50,50],"e":[75,75],"to":[4.16666650772095,4.16666650772095],"ti":[-4.16666650772095,-4.16666650772095]},{"t":179}],"ix":2},"a":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":0,"s":[50,50],"e":[25,25],"to":[-4.16666650772095,-4.16666650772095],"ti":[4.16666650772095,4.16666650772095]},{"t":179}],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"n":["0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167"],"t":0,"s":[50,50],"e":[100,100]},{"t":179}],"ix":3},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[0],"e":[1110]},{"t":179}],"ix":4},"so":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[0],"e":[25]},{"t":179}],"ix":5},"eo":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[100],"e":[75]},{"t":179}],"ix":6},"nm":"Transform"},"nm":"Repeater 1","mn":"ADBE Vector Filter - Repeater","hd":false}],"ip":-50,"op":184,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/LICENSES/LicenseRef-Lottie-Simple-License-9.13.21.txt:
--------------------------------------------------------------------------------
1 | Lottie Simple License (FL 9.13.21)
2 |
3 | Copyright © 2021 Design Barn Inc.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of the public animation files available for download at the LottieFiles site (“Files”) to download, reproduce, modify, publish, distribute, publicly display, and publicly digitally perform such Files, including for commercial purposes, provided that any display, publication, performance, or distribution of Files must contain (and be subject to) the same terms and conditions of this license. Modifications to Files are deemed derivative works and must also be expressly distributed under the same terms and conditions of this license. You may not purport to impose any additional or different terms or conditions on, or apply any technical measures that restrict exercise of, the rights granted under this license. This license does not include the right to collect or compile Files from LottieFiles to replicate or develop a similar or competing service.
6 |
7 |
8 | Use of Files without attributing the creator(s) of the Files is permitted under this license, though attribution is strongly encouraged. If attributions are included, such attributions should be visible to the end user.
9 |
10 |
11 | FILES ARE 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. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL THE CREATOR(S) OF FILES OR DESIGN BARN, INC. BE LIABLE ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE, OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF SUCH FILES.
12 |
--------------------------------------------------------------------------------
/tests/manual/testApp/rect_scale_anchors_on_layer.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":30,"ip":30,"op":60,"w":320,"h":320,"nm":"Star - On","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Star Echo","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[128.5,77.5,0],"ix":2},"a":{"a":0,"k":[240,240,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.25,0.25,0.25],"y":[1,1,1]},"o":{"x":[0.001,0.001,0.001],"y":[0,0,0]},"n":["0p25_1_0p001_0","0p25_1_0p001_0","0p25_1_0p001_0"],"t":30,"s":[100,100,100],"e":[70,70,100]},{"i":{"x":[0,0,0],"y":[1,1,1]},"o":{"x":[0.001,0.001,0.001],"y":[0,0,0]},"n":["0_1_0p001_0","0_1_0p001_0","0_1_0p001_0"],"t":36,"s":[70,70,100],"e":[200,200,100]},{"t":56}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[8.843,-21.095],[-23.375,-21.095],[-23.375,13.122],[8.843,13.122]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.638999968884,0.513999968884,0.380000005984,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":3,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[255.393,265.656],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":90,"st":15,"bm":0}],"markers":[{"tm":30,"cm":"Start","dr":0},{"tm":60,"cm":"End","dr":0}]}
2 |
--------------------------------------------------------------------------------
/tests/manual/testApp/rect_scale_anchors_on_rect.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":30,"ip":30,"op":60,"w":320,"h":320,"nm":"Star - On","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Star Echo","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[128.5,77.5,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.25,0.25,0.25],"y":[1,1,1]},"o":{"x":[0.001,0.001,0.001],"y":[0,0,0]},"n":["0p25_1_0p001_0","0p25_1_0p001_0","0p25_1_0p001_0"],"t":30,"s":[100,100,100],"e":[70,70,100]},{"i":{"x":[0,0,0],"y":[1,1,1]},"o":{"x":[0.001,0.001,0.001],"y":[0,0,0]},"n":["0_1_0p001_0","0_1_0p001_0","0_1_0p001_0"],"t":36,"s":[70,70,100],"e":[200,200,100]},{"t":56}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[8.843,-21.095],[-23.375,-21.095],[-23.375,13.122],[8.843,13.122]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.638999968884,0.513999968884,0.380000005984,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":3,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[255.393,265.656],"ix":2},"a":{"a":0,"k":[240,240],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":90,"st":15,"bm":0}],"markers":[{"tm":30,"cm":"Start","dr":0},{"tm":60,"cm":"End","dr":0}]}
2 |
--------------------------------------------------------------------------------
/tests/manual/testApp/shape_complex.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":175.000007127896,"w":400,"h":224,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[200,112,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[-38.234,34.801],[-32.222,-9.403],[-14.71,0.126],[-21.203,33.16]],"o":[[0,0],[4.82,-4.387],[32.222,9.403],[23.332,-0.199],[21.203,-33.16]],"v":[[81,22],[10.234,8.699],[1.278,-25.403],[2.5,-59],[55.297,-30.84]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false}],"ip":0,"op":174.825007120768,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/baseline/data/original/rect_scale_anchors_on_rect.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":30,"ip":30,"op":60,"w":320,"h":320,"nm":"Star - On","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Star Echo","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[128.5,77.5,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.25,0.25,0.25],"y":[1,1,1]},"o":{"x":[0.001,0.001,0.001],"y":[0,0,0]},"n":["0p25_1_0p001_0","0p25_1_0p001_0","0p25_1_0p001_0"],"t":30,"s":[100,100,100],"e":[70,70,100]},{"i":{"x":[0,0,0],"y":[1,1,1]},"o":{"x":[0.001,0.001,0.001],"y":[0,0,0]},"n":["0_1_0p001_0","0_1_0p001_0","0_1_0p001_0"],"t":36,"s":[70,70,100],"e":[200,200,100]},{"t":56}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[8.843,-21.095],[-23.375,-21.095],[-23.375,13.122],[8.843,13.122]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.638999968884,0.513999968884,0.380000005984,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":3,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[255.393,265.656],"ix":2},"a":{"a":0,"k":[240,240],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":90,"st":15,"bm":0}],"markers":[{"tm":30,"cm":"Start","dr":0},{"tm":60,"cm":"End","dr":0}]}
2 |
--------------------------------------------------------------------------------
/tests/baseline/data/original/rect_scale_anchors_on_layer.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":30,"ip":30,"op":60,"w":320,"h":320,"nm":"Star - On","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Star Echo","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[128.5,77.5,0],"ix":2},"a":{"a":0,"k":[240,240,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.25,0.25,0.25],"y":[1,1,1]},"o":{"x":[0.001,0.001,0.001],"y":[0,0,0]},"n":["0p25_1_0p001_0","0p25_1_0p001_0","0p25_1_0p001_0"],"t":30,"s":[100,100,100],"e":[70,70,100]},{"i":{"x":[0,0,0],"y":[1,1,1]},"o":{"x":[0.001,0.001,0.001],"y":[0,0,0]},"n":["0_1_0p001_0","0_1_0p001_0","0_1_0p001_0"],"t":36,"s":[70,70,100],"e":[200,200,100]},{"t":56}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[8.843,-21.095],[-23.375,-21.095],[-23.375,13.122],[8.843,13.122]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.638999968884,0.513999968884,0.380000005984,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":3,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[255.393,265.656],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":90,"st":15,"bm":0}],"markers":[{"tm":30,"cm":"Start","dr":0},{"tm":60,"cm":"End","dr":0}]}
2 |
--------------------------------------------------------------------------------
/tests/baseline/data/original/shape_complex.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":175.000007127896,"w":400,"h":224,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[200,112,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[-38.234,34.801],[-32.222,-9.403],[-14.71,0.126],[-21.203,33.16]],"o":[[0,0],[4.82,-4.387],[32.222,9.403],[23.332,-0.199],[21.203,-33.16]],"v":[[81,22],[10.234,8.699],[1.278,-25.403],[2.5,-59],[55.297,-30.84]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"st","c":{"a":0,"k":[0,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false}],"ip":0,"op":174.825007120768,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/src/lottie/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2022 The Qt Company Ltd.
2 | # SPDX-License-Identifier: BSD-3-Clause
3 |
4 | qt_internal_extend_target(Lottie
5 | SOURCES
6 | qbeziereasing.cpp qbeziereasing_p.h
7 | qlottiebase.cpp qlottiebase_p.h
8 | qlottiebasictransform.cpp qlottiebasictransform_p.h
9 | qlottieconstants_p.h
10 | qlottieellipse.cpp qlottieellipse_p.h
11 | qlottiefill.cpp qlottiefill_p.h
12 | qlottiefilleffect.cpp qlottiefilleffect_p.h
13 | qlottiefreeformshape.cpp qlottiefreeformshape_p.h
14 | qlottiegfill.cpp qlottiegfill_p.h
15 | qlottiegroup.cpp qlottiegroup_p.h
16 | qlottieimage.cpp qlottieimage_p.h
17 | qlottieflatlayers.cpp qlottieflatlayers_p.h
18 | qlottielayer.cpp qlottielayer_p.h
19 | qlottiepolystar.cpp qlottiepolystar_p.h
20 | qlottieprecomplayer.cpp qlottieprecomplayer_p.h
21 | qlottieproperty_p.h
22 | qlottierect.cpp qlottierect_p.h
23 | qlottierepeater.cpp qlottierepeater_p.h
24 | qlottierepeatertransform.cpp qlottierepeatertransform_p.h
25 | qlottieroot.cpp qlottieroot_p.h
26 | qlottieround.cpp qlottieround_p.h
27 | qlottieshape.cpp qlottieshape_p.h
28 | qlottieshapelayer.cpp qlottieshapelayer_p.h
29 | qlottieshapetransform.cpp qlottieshapetransform_p.h
30 | qlottiespatialproperty_p.h
31 | qlottiestroke.cpp qlottiestroke_p.h
32 | qlottietrimpath.cpp qlottietrimpath_p.h
33 | renderer/qbatchrenderer.cpp renderer/qbatchrenderer_p.h
34 | renderer/qlottierenderer.cpp renderer/qlottierenderer_p.h
35 | renderer/qlottierasterrenderer.cpp renderer/qlottierasterrenderer_p.h
36 | INCLUDE_DIRECTORIES
37 | renderer
38 | )
39 |
--------------------------------------------------------------------------------
/src/lottie/qlottierepeater.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2018 The Qt Company Ltd.
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3 |
4 | #include "qlottierepeater_p.h"
5 |
6 | QLottieRepeater::QLottieRepeater(const QJsonObject &definition, QLottieBase *parent)
7 | {
8 | setParent(parent);
9 | m_transform.setParent(this);
10 | construct(definition);
11 | }
12 |
13 | QLottieBase *QLottieRepeater::clone() const
14 | {
15 | return new QLottieRepeater(*this);
16 | }
17 |
18 | void QLottieRepeater::construct(const QJsonObject &definition)
19 | {
20 | qCDebug(lcLottieQtLottieParser) << "QLottieRepeater::parse():" << m_name;
21 |
22 | QLottieBase::parse(definition);
23 | if (m_hidden)
24 | return;
25 |
26 | QJsonObject copies = definition.value(u"c"_s).toObject();
27 | copies = resolveExpression(copies);
28 | m_copies.construct(copies);
29 |
30 | QJsonObject offset = definition.value(u"o"_s).toObject();
31 | offset = resolveExpression(offset);
32 | m_offset.construct(offset);
33 |
34 | m_transform.parse(definition.value(u"tr"_s).toObject());
35 | }
36 |
37 | void QLottieRepeater::updateProperties(int frame)
38 | {
39 | m_copies.update(frame);
40 | m_offset.update(frame);
41 | m_transform.setInstanceCount(m_copies.value());
42 | m_transform.updateProperties(frame);
43 | }
44 |
45 | void QLottieRepeater::render(QLottieRenderer &renderer) const
46 | {
47 | renderer.render(*this);
48 | }
49 |
50 | int QLottieRepeater::copies() const
51 | {
52 | return m_copies.value();
53 | }
54 |
55 | qreal QLottieRepeater::offset() const
56 | {
57 | return m_offset.value();
58 | }
59 |
60 | const QLottieRepeaterTransform &QLottieRepeater::transform() const
61 | {
62 | return m_transform;
63 | }
64 |
--------------------------------------------------------------------------------
/tests/manual/testApp/rect_scale.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":175.000007127896,"w":400,"h":224,"nm":"rect_scale","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[200,112,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"n":["0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167"],"t":0,"s":[100,100,100],"e":[0,0,100]},{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"n":["0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167"],"t":47,"s":[0,0,100],"e":[100,100,100]},{"t":94.0000038286985}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[47,-41.5],[-47,-41.5],[-47,41.5],[47,41.5]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":4,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0.23529399797,1,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[3,2.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":95.0000038694293,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/baseline/data/original/rect_scale.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":175.000007127896,"w":400,"h":224,"nm":"rect_scale","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[200,112,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"n":["0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167"],"t":0,"s":[100,100,100],"e":[0,0,100]},{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"n":["0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167"],"t":47,"s":[0,0,100],"e":[100,100,100]},{"t":94.0000038286985}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[47,-41.5],[-47,-41.5],[-47,41.5],[47,41.5]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":4,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0.23529399797,1,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[3,2.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":95.0000038694293,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/manual/testApp/linked_layers.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":10.0000004073083,"op":175.000007127896,"w":400,"h":224,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 2","parent":2,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":20,"s":[150,0,0],"e":[0,0,0],"to":[-37.2210121154785,-3.5262824391979e-15,0],"ti":[21.4031734466553,2.0277157723221e-15,0]},{"t":110.000004480392}],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"rc","d":1,"s":{"a":0,"k":[100,100],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0.874509811401,0.082352943718,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false}],"ip":-15.0000006109625,"op":175.000007127896,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":21,"s":[50,112,0],"e":[200,112,0],"to":[37.6828193664551,0,0],"ti":[-21.1501274108887,0,0]},{"t":110.000004480392}],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"rc","d":1,"s":{"a":0,"k":[100,100],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false}],"ip":-17.0000006924242,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/baseline/data/original/linked_layers.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":10.0000004073083,"op":175.000007127896,"w":400,"h":224,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 2","parent":2,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":20,"s":[150,0,0],"e":[0,0,0],"to":[-37.2210121154785,-3.5262824391979e-15,0],"ti":[21.4031734466553,2.0277157723221e-15,0]},{"t":110.000004480392}],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"rc","d":1,"s":{"a":0,"k":[100,100],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0.874509811401,0.082352943718,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false}],"ip":-15.0000006109625,"op":175.000007127896,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":21,"s":[50,112,0],"e":[200,112,0],"to":[37.6828193664551,0,0],"ti":[-21.1501274108887,0,0]},{"t":110.000004480392}],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"rc","d":1,"s":{"a":0,"k":[100,100],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false}],"ip":-17.0000006924242,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/src/lottie/qlottierect_p.h:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2018 The Qt Company Ltd.
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3 |
4 | #ifndef QLOTTIERECT_P_H
5 | #define QLOTTIERECT_P_H
6 |
7 | //
8 | // W A R N I N G
9 | // -------------
10 | //
11 | // This file is not part of the Qt API. It exists purely as an
12 | // implementation detail. This header file may change from version to
13 | // version without notice, or even be removed.
14 | //
15 | // We mean it.
16 | //
17 |
18 | #include
19 | #include
20 | #include
21 | #include
22 |
23 | #include
24 | #include
25 | #include
26 | #include
27 | #include
28 |
29 | QT_BEGIN_NAMESPACE
30 |
31 | class Q_LOTTIE_EXPORT QLottieRect : public QLottieShape
32 | {
33 | public:
34 | explicit QLottieRect(const QLottieRect &other);
35 | QLottieRect(QLottieBase *parent = nullptr);
36 |
37 | QLottieBase *clone() const override;
38 |
39 | void construct(const QJsonObject &definition);
40 |
41 | bool setProperty(QLottieLiteral::PropertyType propertyType, QVariant value) override;
42 |
43 | void updateProperties(int frame) override;
44 | void render(QLottieRenderer &renderer) const override;
45 | bool acceptsTrim() const override;
46 | int parse(const QJsonObject &definition) override;
47 |
48 | QPointF position() const;
49 | QSizeF size() const;
50 | qreal roundness() const;
51 |
52 | protected:
53 | QLottieSpatialProperty m_position;
54 | QLottieProperty2D m_size;
55 | QLottieProperty m_roundness;
56 | };
57 |
58 | QT_END_NAMESPACE
59 |
60 | #endif // QLOTTIERECT_P_H
61 |
--------------------------------------------------------------------------------
/src/lottie/qlottieshapetransform_p.h:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2018 The Qt Company Ltd.
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3 |
4 | #ifndef QLOTTIESHAPETRANSFORM_P_H
5 | #define QLOTTIESHAPETRANSFORM_P_H
6 |
7 | //
8 | // W A R N I N G
9 | // -------------
10 | //
11 | // This file is not part of the Qt API. It exists purely as an
12 | // implementation detail. This header file may change from version to
13 | // version without notice, or even be removed.
14 | //
15 | // We mean it.
16 | //
17 |
18 | #include
19 |
20 | #include
21 | #include
22 | #include
23 |
24 | QT_BEGIN_NAMESPACE
25 |
26 | class QJsonObject;
27 |
28 | class Q_LOTTIE_EXPORT QLottieShapeTransform : public QLottieBasicTransform
29 | {
30 | public:
31 | explicit QLottieShapeTransform(const QLottieShapeTransform &other);
32 | QLottieShapeTransform(QLottieBase *parent = nullptr);
33 |
34 | QLottieBase *clone() const override;
35 |
36 | int parse(const QJsonObject &definition) override;
37 |
38 | void updateProperties(int frame) override;
39 | void render(QLottieRenderer &renderer) const override;
40 |
41 | qreal skew() const;
42 | qreal skewAxis() const;
43 | qreal shearX() const;
44 | qreal shearY() const;
45 | qreal shearAngle() const;
46 |
47 | QLottieProperty skewProperty() const { return m_skew; }
48 | QLottieProperty skewAxisProperty() const { return m_skewAxis; }
49 |
50 | protected:
51 | QLottieProperty m_skew;
52 | QLottieProperty m_skewAxis;
53 | qreal m_shearX = 0;
54 | qreal m_shearY = 0;
55 | qreal m_shearAngle = 0;
56 | };
57 |
58 | QT_END_NAMESPACE
59 |
60 | #endif // QLOTTIESHAPETRANSFORM_P_H
61 |
--------------------------------------------------------------------------------
/tests/auto/lottie/shape/shapetransform/data/shapetransform_animated.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.4","fr":60,"ip":0,"op":180,"w":100,"h":100,"nm":"AnimatedShapeTransformShapeLayer","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[0,0.125,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"tr","p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":0,"s":[50,50],"e":[75,75],"to":[4.16666650772095,4.16666650772095],"ti":[-4.16666650772095,-4.16666650772095]},{"t":179}],"ix":2},"a":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":0,"s":[50,50],"e":[25,25],"to":[-4.16666650772095,-4.16666650772095],"ti":[4.16666650772095,4.16666650772095]},{"t":179}],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"n":["0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167"],"t":0,"s":[50,50],"e":[100,100]},{"t":179}],"ix":3},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[0],"e":[1110]},{"t":179}],"ix":6},"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[100],"e":[25]},{"t":179}],"ix":7},"sk":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[0],"e":[4]},{"t":179}],"ix":4},"sa":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[0],"e":[745]},{"t":179}],"ix":5},"nm":"Transform"}],"nm":"Group 1","np":0,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":180,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/src/lottie/qlottiestroke_p.h:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2018 The Qt Company Ltd.
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3 |
4 | #ifndef QLOTTIESTROKE_P_H
5 | #define QLOTTIESTROKE_P_H
6 |
7 | //
8 | // W A R N I N G
9 | // -------------
10 | //
11 | // This file is not part of the Qt API. It exists purely as an
12 | // implementation detail. This header file may change from version to
13 | // version without notice, or even be removed.
14 | //
15 | // We mean it.
16 | //
17 |
18 | #include
19 | #include
20 |
21 | #include
22 | #include
23 |
24 | QT_BEGIN_NAMESPACE
25 |
26 | class Q_LOTTIE_EXPORT QLottieStroke : public QLottieShape
27 | {
28 | public:
29 | explicit QLottieStroke(const QLottieStroke &other);
30 | QLottieStroke(QLottieBase *parent = nullptr);
31 |
32 | QLottieBase *clone() const override;
33 |
34 | void updateProperties(int frame) override;
35 | void render(QLottieRenderer &renderer) const override;
36 | int parse(const QJsonObject &definition) override;
37 |
38 | QPen pen() const;
39 | qreal opacity() const;
40 |
41 | QLottieProperty4D colorProperty() const { return m_color; }
42 | QLottieProperty opacityProperty() const { return m_opacity; }
43 |
44 | protected:
45 | QColor getColor() const;
46 |
47 | protected:
48 | QLottieProperty m_opacity;
49 | QLottieProperty m_width;
50 | QLottieProperty4D m_color;
51 | Qt::PenCapStyle m_capStyle;
52 | Qt::PenJoinStyle m_joinStyle;
53 | qreal m_miterLimit = 0;
54 | QLottieProperty m_dashOffset;
55 | QLottieProperty m_dashLength;
56 | QLottieProperty m_dashGap;
57 | bool m_isDashed = false;
58 | };
59 |
60 | QT_END_NAMESPACE
61 |
62 | #endif // QLOTTIESTROKE_P_H
63 |
--------------------------------------------------------------------------------
/tests/baseline/data/original/trim_path2_sequential.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":70,"w":550,"h":309,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[9,-2,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"d":2,"ty":"el","s":{"a":0,"k":[100,100],"ix":2},"p":{"a":0,"k":[267,155],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[54,-44],[-54,-44],[-54,44],[54,44]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[190,154],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":2,"cix":2,"ix":2,"mn":"ADBE Vector Group","hd":false},{"ty":"st","c":{"a":0,"k":[0,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":16,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[0],"e":[100]},{"t":50.0000020365418}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":2,"ix":4,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/manual/testApp/trim_path2_offset.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":175.000007127896,"w":550,"h":309,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[28.5,-4,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"d":2,"ty":"el","s":{"a":0,"k":[100,100],"ix":2},"p":{"a":0,"k":[267,155],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[54,-44],[-54,-44],[-54,44],[54,44]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[190,154],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":2,"cix":2,"ix":2,"mn":"ADBE Vector Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":4,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":0,"k":50,"ix":2},"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[-25],"e":[75]},{"t":61.0000024845809}],"ix":3},"m":1,"ix":4,"nm":"Trim Paths 2","mn":"ADBE Vector Filter - Trim","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/manual/testApp/trim_path2_sequential.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":175.000007127896,"w":550,"h":309,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[9,-2,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"d":2,"ty":"el","s":{"a":0,"k":[100,100],"ix":2},"p":{"a":0,"k":[267,155],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[54,-44],[-54,-44],[-54,44],[54,44]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[190,154],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":2,"cix":2,"ix":2,"mn":"ADBE Vector Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":16,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[0],"e":[100]},{"t":50.0000020365418}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":2,"ix":4,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/src/vectorimagehelpers/qquicklayeritem.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2025 The Qt Company Ltd.
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3 |
4 | #include "qquicklayeritem_p.h"
5 | #include
6 |
7 | QT_BEGIN_NAMESPACE
8 |
9 | /*!
10 | \qmltype LayerItem
11 | \inqmlmodule Qt.labs.lottieqt.VectorImageHelpers
12 | \brief An Item that provides access to its transformation matrix as a property.
13 |
14 | The LayerItem type maintains a \c transformMatrix property, which at any time will contain the
15 | combination of the item's own transform with all its ancestors' transforms. It is used in
16 | particular to support linked transforms in certain vector graphics formats. As any type in
17 | the \c VectorImageHelpers module, it is only intended to be used in code generated by
18 | \l VectorImage and related tools.
19 | */
20 | QQuickLayerItem::QQuickLayerItem(QQuickItem *parent)
21 | : QQuickItem(parent)
22 | {
23 | }
24 |
25 | /*!
26 | \qmlproperty matrix4x4 Qt.labs.lottieqt.VectorImageHelpers::LayerItem::transformMatrix
27 |
28 | The result of combining this item's transform with the transforms of its entire
29 | ancestor chain.
30 | */
31 | QMatrix4x4 QQuickLayerItem::transformMatrix()
32 | {
33 | Q_D(const QQuickItem);
34 | if (m_transformDirty) {
35 | m_transformDirty = false;
36 | QTransform xf;
37 | d->itemToParentTransform(&xf);
38 | m_transform = xf;
39 | }
40 | return m_transform;
41 | }
42 |
43 | void QQuickLayerItem::itemChange(ItemChange change, const ItemChangeData &value)
44 | {
45 | if (change == ItemTransformHasChanged) {
46 | m_transformDirty = true;
47 | emit transformMatrixChanged();
48 | }
49 |
50 | QQuickItem::itemChange(change, value);
51 | }
52 |
53 | QT_END_NAMESPACE
54 |
55 | #include
56 |
--------------------------------------------------------------------------------
/tests/baseline/data/original/trim_path2_offset.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":175.000007127896,"w":550,"h":309,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[28.5,-4,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"d":2,"ty":"el","s":{"a":0,"k":[100,100],"ix":2},"p":{"a":0,"k":[267,155],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[54,-44],[-54,-44],[-54,44],[54,44]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[190,154],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":2,"cix":2,"ix":2,"mn":"ADBE Vector Group","hd":false},{"ty":"st","c":{"a":0,"k":[0,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":4,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":0,"k":50,"ix":2},"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[-25],"e":[75]},{"t":61.0000024845809}],"ix":3},"m":1,"ix":4,"nm":"Trim Paths 2","mn":"ADBE Vector Filter - Trim","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/baseline/data/docsamples/image.json:
--------------------------------------------------------------------------------
1 | {
2 | "v": "5.5.2",
3 | "fr": 60,
4 | "ip": 0,
5 | "op": 60,
6 | "w": 512,
7 | "h": 512,
8 | "ddd": 0,
9 | "assets": [
10 | {
11 | "id": "blep",
12 | "h": 512,
13 | "w": 512,
14 | "p": "blep.png",
15 | "u": "",
16 | "e": 0
17 | }
18 | ],
19 | "layers": [
20 | {
21 | "nm": "foo",
22 | "mn": "bar",
23 | "ddd": 0,
24 | "ty": 2,
25 | "sr": 1,
26 | "ks": {
27 | "a": {
28 | "k": [
29 | 256,
30 | 256
31 | ],
32 | "a": 0
33 | },
34 | "p": {
35 | "k": [
36 | 256,
37 | 256
38 | ],
39 | "a": 0
40 | },
41 | "s": {
42 | "k": [
43 | 100,
44 | 100
45 | ],
46 | "a": 0
47 | },
48 | "r": {
49 | "k": 0,
50 | "a": 0
51 | },
52 | "o": {
53 | "k": 100,
54 | "a": 0
55 | },
56 | "sk": {
57 | "k": 0,
58 | "a": 0
59 | },
60 | "sa": {
61 | "k": 0,
62 | "a": 0
63 | }
64 | },
65 | "ao": 0,
66 | "ip": 0,
67 | "op": 60,
68 | "st": 0,
69 | "bm": 0,
70 | "ind": 0,
71 | "refId": "blep"
72 | }
73 | ]
74 | }
75 |
--------------------------------------------------------------------------------
/tests/manual/testApp/rect_move_bezier.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":175.000007127896,"w":400,"h":224,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":0,"s":[200,112,0],"e":[331,214,0],"to":[21.8333339691162,17,0],"ti":[-161.33332824707,2.33333325386047,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":35,"s":[331,214,0],"e":[493,89,0],"to":[161.33332824707,-2.33333325386047,0],"ti":[13.3333330154419,12.75,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":83,"s":[493,89,0],"e":[251,137.5,0],"to":[-13.3333330154419,-12.75,0],"ti":[40.3333320617676,-8.08333301544189,0]},{"t":122.000004969162}],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[38,-32.5],[-38,-32.5],[-38,32.5],[38,32.5]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":1,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0.23529399797,1,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-137.5,-59],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/tests/baseline/data/original/rect_move_bezier.json:
--------------------------------------------------------------------------------
1 | {"v":"5.3.1","fr":29.9700012207031,"ip":0,"op":175.000007127896,"w":400,"h":224,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":0,"s":[200,112,0],"e":[331,214,0],"to":[21.8333339691162,17,0],"ti":[-161.33332824707,2.33333325386047,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":35,"s":[331,214,0],"e":[493,89,0],"to":[161.33332824707,-2.33333325386047,0],"ti":[13.3333330154419,12.75,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":83,"s":[493,89,0],"e":[251,137.5,0],"to":[-13.3333330154419,-12.75,0],"ti":[40.3333320617676,-8.08333301544189,0]},{"t":122.000004969162}],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[38,-32.5],[-38,-32.5],[-38,32.5],[38,32.5]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":1,"ix":5},"lc":1,"lj":1,"ml":4,"ml2":{"a":0,"k":4,"ix":8},"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0.23529399797,1,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-137.5,-59],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":175.000007127896,"st":0,"bm":0}],"markers":[]}
2 |
--------------------------------------------------------------------------------
/src/lottie/qlottieflatlayers_p.h:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2025 The Qt Company Ltd.
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3 |
4 | #ifndef QLOTTIEFLATLAYERS_P_H
5 | #define QLOTTIEFLATLAYERS_P_H
6 |
7 | //
8 | // W A R N I N G
9 | // -------------
10 | //
11 | // This file is not part of the Qt API. It exists purely as an
12 | // implementation detail. This header file may change from version to
13 | // version without notice, or even be removed.
14 | //
15 | // We mean it.
16 | //
17 |
18 | #include
19 | #include
20 |
21 | QT_BEGIN_NAMESPACE
22 |
23 | class QJsonObject;
24 | class QLottieRenderer;
25 |
26 | class Q_LOTTIE_EXPORT QLottieNullLayer : public QLottieLayer
27 | {
28 | public:
29 | QLottieNullLayer() = default;
30 | explicit QLottieNullLayer(const QLottieNullLayer &other);
31 |
32 | QLottieBase *clone() const override;
33 |
34 | void render(QLottieRenderer &render) const override;
35 | int parse(const QJsonObject &definition) override;
36 | };
37 |
38 | class Q_LOTTIE_EXPORT QLottieSolidLayer : public QLottieLayer
39 | {
40 | public:
41 | QLottieSolidLayer() = default;
42 | explicit QLottieSolidLayer(const QLottieSolidLayer &other);
43 |
44 | QLottieBase *clone() const override;
45 |
46 | void render(QLottieRenderer &render) const override;
47 | int parse(const QJsonObject &definition) override;
48 |
49 | QColor color() const;
50 |
51 | private:
52 | QColor m_color;
53 | };
54 |
55 | class Q_LOTTIE_EXPORT QLottieImageLayer : public QLottieLayer
56 | {
57 | public:
58 | QLottieImageLayer() = default;
59 | explicit QLottieImageLayer(const QLottieImageLayer &other);
60 |
61 | QLottieBase *clone() const override;
62 |
63 | void render(QLottieRenderer &render) const override;
64 | int parse(const QJsonObject &definition) override;
65 | };
66 |
67 | QT_END_NAMESPACE
68 |
69 | #endif // QLOTTIEFLATLAYERS_P_H
70 |
--------------------------------------------------------------------------------
/src/lottie/qlottietrimpath_p.h:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2018 The Qt Company Ltd.
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3 |
4 | #ifndef QLOTTIETRIMPATH_P_H
5 | #define QLOTTIETRIMPATH_P_H
6 |
7 | //
8 | // W A R N I N G
9 | // -------------
10 | //
11 | // This file is not part of the Qt API. It exists purely as an
12 | // implementation detail. This header file may change from version to
13 | // version without notice, or even be removed.
14 | //
15 | // We mean it.
16 | //
17 |
18 | #include
19 | #include
20 |
21 | #include
22 | #include
23 |
24 | QT_BEGIN_NAMESPACE
25 |
26 | class Q_LOTTIE_EXPORT QLottieTrimPath : public QLottieShape
27 | {
28 | public:
29 | QLottieTrimPath(QLottieBase *parent = nullptr);
30 | explicit QLottieTrimPath(const QLottieTrimPath &other);
31 |
32 | void inherit(const QLottieTrimPath &other);
33 |
34 | QLottieBase *clone() const override;
35 |
36 | int parse(const QJsonObject &definition) override;
37 |
38 | void updateProperties(int frame) override;
39 | void render(QLottieRenderer &renderer) const override;
40 |
41 | bool acceptsTrim() const override;
42 | void applyTrim(const QLottieTrimPath &trimmer) override;
43 |
44 | qreal start() const;
45 | qreal end() const;
46 | qreal offset() const;
47 | bool isParallel() const;
48 |
49 | QPainterPath trim(const QPainterPath &path) const;
50 |
51 | QLottieProperty startProperty() const { return m_start; }
52 | QLottieProperty endProperty() const { return m_end; }
53 | QLottieProperty offsetProperty() const { return m_offset; }
54 |
55 | protected:
56 | QLottieProperty m_start;
57 | QLottieProperty m_end;
58 | QLottieProperty m_offset;
59 | bool m_isParallel = true;
60 | };
61 |
62 | QT_END_NAMESPACE
63 |
64 | #endif // QLOTTIETRIMPATH_P_H
65 |
--------------------------------------------------------------------------------
/src/lottie/qlottiepolystar_p.h:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2024 The Qt Company Ltd.
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3 |
4 | #ifndef QLOTTIEPOLYSTAR_P_H
5 | #define QLOTTIEPOLYSTAR_P_H
6 |
7 | //
8 | // W A R N I N G
9 | // -------------
10 | //
11 | // This file is not part of the Qt API. It exists purely as an
12 | // implementation detail. This header file may change from version to
13 | // version without notice, or even be removed.
14 | //
15 | // We mean it.
16 | //
17 |
18 | #include
19 | #include
20 | #include
21 | #include
22 | #include
23 |
24 | #include
25 | #include
26 | #include
27 | #include
28 | #include
29 |
30 | QT_BEGIN_NAMESPACE
31 |
32 | class QJsonObject;
33 |
34 | class Q_LOTTIE_EXPORT QLottiePolyStar : public QLottieShape
35 | {
36 | public:
37 | explicit QLottiePolyStar(const QLottiePolyStar &other);
38 | QLottiePolyStar(QLottieBase *parent = nullptr);
39 |
40 | QLottieBase *clone() const override;
41 |
42 | int parse(const QJsonObject &definition) override;
43 |
44 | void updateProperties(int frame) override;
45 | void render(QLottieRenderer &renderer) const override;
46 |
47 | bool acceptsTrim() const override;
48 |
49 | QPointF position() const;
50 | qreal outerRadius() const;
51 | qreal innerRadius() const;
52 | qreal startAngle() const;
53 | int pointCount() const;
54 | bool isPolygonModeEnabled() const;
55 |
56 | protected:
57 | QLottieSpatialProperty m_position;
58 | QLottieProperty m_pointCount;
59 | QLottieProperty m_outerRadius;
60 | QLottieProperty m_innerRadius;
61 | QLottieProperty m_startAngle;
62 | bool m_polygonMode = false;
63 | };
64 |
65 | QT_END_NAMESPACE
66 |
67 | #endif // QLOTTIEPOLYSTAR_P_H
68 |
--------------------------------------------------------------------------------