GithubHelp home page GithubHelp logo

laferq / lottie-qt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from conntac/lottie-qt

0.0 2.0 0.0 34.17 MB

Lottie for QtQuick implementation based on the iOS one.

License: Apache License 2.0

QMake 1.54% C++ 82.36% C 0.33% Objective-C++ 10.71% Objective-C 4.12% GLSL 0.94%

lottie-qt's Introduction

Lottie QtQuick

This is Lottie for Qt. It was not invented by us and most of the code was directly ported from the iOS Objective-C code.

This version has known bugs and does not work (especially masks are missing). Expect asserts, unfinished parts of the code might have them commented out.

Tested with Qt 5.10.1 on Android/iOS/macOS. Built once with 5.12.0 :)

Examples

Viewer: Viewer

Typewriter: Viewer

Why this exists

Porting try #1

Lottie has a javascript renderer. QtQuick can execute javascript. Let's draw into a canvas!

After a few hours of coding I was at the point where I could just run the renderer of lottie-web on a QML Canvas. It looked really great on my laptop. I was pretty happe worked really fast and straight forward - until I tried to execute it on a mobile phone. The same animation that was running on my laptop with 60fps got ~0.5fps on an iPhone 6s.

Ok but there's QtQuickCompiler, let it run. Performance was almost the same.

But Qt 5.11 is faster! At that time it was not released but I built it from source aaaand: It was at about the same speed.

After having no solution, I used the phone and navigated to lottiefiles.com and noticed: The javascript renderer seems to have a low performance. Since I'm not a javascript guy and thought the rendering should not be done on Qt's js engine anyway I gave up this try.

Porting try #2

Don't port but wrap the Java and Objective-C implementations. While this would be the easiest way, there are a few downsides:

  • Native implementations will only work as overlays. This means we have the same limitations as with QtWebView. Scrolling will appear strange and we can't render with QML over the view. We will also not be able to handle mouse events.
  • I want my application to work on all platforms!

Porting try #3

Porting the objective-c code to Qt.

lottie-qt's People

Contributors

ansman avatar bellchen avatar blackm00n avatar buba447 avatar fabionuno avatar fnazrala avatar hansemannn avatar jmyers0022 avatar jqsilver avatar kyle-fox avatar lelandrichardson avatar letsgogeeky avatar onekyle avatar orta avatar panmingyang2009 avatar pbardea avatar readmecritic avatar revolter avatar ricardobarroso avatar rishabhtayal avatar romainbiard avatar ryanstout avatar sanekgusev avatar simonmitchell avatar singro avatar sujaypat avatar tapanprakasht avatar theoriginalgri avatar valeriyvan avatar welshm avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.