Add annotation/editing system from Spectacle

add spectacle annotation system

Allow saving and clearing the annotation document from QML

Expand interactive path strokes by 0.5px to make it easier to fully contain the underlying graphics within a ShapePath

Add KConfig to ci

Fix build on Windows/MSVC

isnan is not declared as constexpr in MSVC

Add benchmark for stackblur

Use own stackblur implementation

The new implementation is not as fast as the implementation of stackblur which uses SIMD but is fast enough already and doesn't drag the whole OpenCV dependency.

Benchmark (before):

1.8 msecs per iteration (total: 18, iterations: 10)

Benchmark (after):

27.8 msecs per iteration (total: 279, iterations: 10)

Make OpenCV REQUIRED on linux and OPTIONAL on other platforms

Currently force disabled on Windows as it is causing some build issue.

AnnotationDocument & SelectedItemWrapper: Add applyTransform()

AnnotationDocument::applyTransform() Allows applying a QMatrix4x4 to the image. SelectedItemWrapper::applyTransform() Allows applying a QMatrix4x4 to an annotation's geometry.

We store the matrix as a QMatrix4x4 instead of a QTransform even though QTransform is more suitable for the internal logic. There are subtle differences between QMatrix4x4 and QTransform that can cause bugs when switching between the two, especially when multiplying two QTransforms or QMatrix4x4s. It is better to just stick with one and only use the other when you need to. We stick with QMatrix4x4 because it's already usable in QML.

Also:

  • Added SelectedItemWrapper::geometryPath, the real item geometry.
  • Added SelectedItemWrapper::transform, the combination of all transforms applied to the item.
    • Resets when changes are committed with SelectedItemWrapper::commitChanges().
  • Added functions to Utils for handling handle logic in C++ to keep the QML clean.
  • Changed the drag handler logic in AnnotationSeletionTool to work with image and annotation transformations.
  • Changed outlines for hover and selection to scale based on AnnotationDocument's image transform.

Move functions above struct/class definitions

Makes it easier to write and use independent functions

Add modified property to annotationdocument

Similar to QTextDocument::modified

Move modification state tracking to History

This allows the external API and internal logic to be cleaner. It also allows us to swap History objects if we want to support multiple histories and base images in the future.

Edited by Noah Davis

Merge request reports

Loading