-
Notifications
You must be signed in to change notification settings - Fork 9
Add some life filters like in the app "aieye" #8
Comments
@nfsprodriver I think this is a great feture to add but it probably should be added as a plugin and not as core functionality of the camera, I think this suggest that the camera app should have some kinda of plugin system to allow developers add functionality easily without worrying about the core code. @Flohack74 What do you think? |
I think this would be the best idea 👍 |
Please keep @sverzegnassi in the loop, he did the wonderful InstantFX which does similar stuff. |
InstantFX uses the QtQuick Scene Graph as a framework for applying GPU-accelerated filters to pictures. It proved to be a viable solution that reduces the development costs of (e.g.) porting GPUImage from iOS, or implementing an ad-hoc solution like in Instagram. In InstantFX (and Instagram as well), there is an important constraint on the size of the image to elaborate: it can not be larger than the maximum texture size supported by the GPU. IIRC the most common limit is 4096x4096px; however, I didn't feel confident to use anything bigger than 2048x2048, as the hardware of UT low-end devices can easily get saturated. Also, a further problem could appear if you want to apply real-time filters on the camera preview output. For instance, Instagram uses different filters for pictures and videos - the ones used for videos are much more lightweight than standard filters. In QML, any processing should last max. 1ms in order to grant a constant frame rate, so we might want to avoid anything too heavy. All these limitations might be unsuitable in camera-app, as UT smartphones (e.g. Meizu Pro 5) can shoot up-to-21mpx pictures. On the contrary, InstantFX and Instagram are designed for the web, where a 2048x2048px picture is considered as "acceptable". The QML Camera object (used by camera-app) provides some basic image processing[1]. Moreover, Qt provides a relevant example for your requests[2]. I really think QML CameraImageProcessing is the way to go, since camera-app is a general purpose app. On other platforms, image filtering features are usually provided by third parties, or by the gallery app. [1] See http://doc.qt.io/qt-5/qml-qtmultimedia-cameraimageprocessing.html#colorFilter-prop [2] https://doc.qt.io/qt-5/qtmultimedia-multimedia-video-qmlvideofx-example.html |
Wow @sverzegnassi thanks for the detailed response!. Regarding this issue I`ll probably just add the QML CameraImageProcessing flags to the camera quick options menu as core camera-app filters as you are right and theres no need to duplicate features. However I still think that a plugin system is required as some of the filters might require a live preview and some you would like to apply when taking the photo (like the date stamp one) also generally it helps to alleviate development complexity as it contain the code to a specific plugin , Think it`s too much on a core app? |
I guess - but I'm not sure - that the live preview of a QML Camera object would respect the settings provided through CameraImageProcessing. In any case, it is still possible to apply shaders to a QML VideoOutput item through QQuickItem layers[1], in order to preview the expected result. With regard to your second question, I agree with you. One of the reasons why InstantFX has no built-in camera support is that it wasn't worth for me to spend more time to rewrite everything. Moreover, IIRC camera-app implements some workaround in order to support all the Ubuntu Touch devices. I would expect to have an official API for implementing such things, something that I can import through a "Ubuntu.Camera" QML module. It should provide not only the backend used in camera-app[2], but also a basic (and extendable) user interface which respects Ubuntu Touch UX specifications and camera-app visuals. I don't think it would be too much work, since we would only move part of the development and maintenance costs to another project. Camera-app codebase would be much smaller and maintainable. However, UBports is not going to release any further OTA for 15.04. It means that any effort of a new QML module wouldn't be available outside camera-app itself and third party apps wouldn't benefit from this. I'm sure @Flohack74 or @NeoTheThird can provide more information on this. :) Huh, as a general reference, Nokia used to provide a great community-driven developer wiki with a lot of references about QML development and imaging (they have run a specific contest for this). Microsoft have shot the website down, but a cache is still available. For instance:
[1] http://doc.qt.io/qt-5/qml-qtquick-item.html#item-layers |
Hey @sverzegnassi , You've taken my suggestion further then I thought :) I actually meant just a plugin system to the camera app and other apps be damned! :). But that seem as an actual problem in the sdk so it might be a good idea to create an issue to refactor the camera app to use a UBport camera class provided by the Ubuntu/UBPorts SDK that will be based on the core of the camera app, i think the first sterp to implement it is the refactor of the camera app so we will have the core class and the added ui/behavior in to sections of the code, this can then be adjusted and integrated as SDK/external package later. I`ll create an issue about it... |
This would be a very cool feature!
The text was updated successfully, but these errors were encountered: