Make Krita better for more types of spatial projection
Open, WishlistPublic

Description

This is a two part idea:

1 Add extra pages to the projection category.

Might be wise to do this first so that the non-maths mode is figured out and it is determined how useful an assistant can be.

https://docs.krita.org/Category:Projection

  1. Fisheye
  2. Panini
  3. Equirectangular
  4. https://en.wikipedia.org/wiki/Stereographic_projection

2 Add more assistants

  1. Panini: http://tksharpless.net/vedutismo/Pannini/ , https://github.com/shaunlebron/blinky/blob/master/game/lua-scripts/lenses/panini.lua
  2. Equireactangular? (Can't find maths)
WhaleKit added a comment.EditedJul 21 2017, 3:59 PM

so, I added a scetch for it's interface.

As Woltherav noticed earlier, this will require rework of assistant tool's code (and therefore assistants'), because in current implementation assistants can only be controlled by moving points (handles) and little moving-switching-on-and-off-and-moving control.

Also, the same GUI will work with any other projection type (if is doesn't have parameters to it).

WhaleKit added a comment.EditedJul 21 2017, 5:00 PM

I want to write the code for this assistant, but I'm not sure if I'm right person to singlehandedly decide new architecture of assistant tool and assistants (At least I would need to talk to other developers).

also, you can find maths on almost all projections in this dir on github's blinky repo:
https://github.com/shaunlebron/blinky/blob/master/game/lua-scripts/lenses/ (in lenses equations you can see usage functions "latlon_to_ray" and "ray_to_latlon". they are defined here)

Well, I am the previous/last person to extend the assistants so by that logic I am the maintainer of those files :D

My suggestion is that we start to make a list of what we need the assistants to do and start designing from there. There's quite a few variables from that. Similarly, we'll need to look at what is already there and how the different parts interact.

In what timezone are you?

jospin added a subscriber: jospin.Aug 14 2017, 11:05 AM
rempt added a subscriber: rempt.Aug 19 2017, 12:41 PM

Overview of the most important current classes:

RulerAssistantTool: adds the assistant factories to the registry
KisRulerAssistantTool: manipulates the assistants
KisPaintingAssistantsDecoration: owns all assistants for a canvas
KisPaintingAssistantManager: manages the assistants for a view/canvas
KisDocument: owns a set of KisPaintingAssistants
KisPaintingAssistant: one assistant, subclassed for every kind of assistant
KisPaintingAssistantHandle: the primary way to change assistants

Note: we also want to add a second kind of thing, reference images, that can be laid out around and over the image and from which colors can be picked. There is a huge amount of overlap in what is needed for both these concepts.

rempt added a comment.Aug 19 2017, 1:37 PM

Requirements

  • toggle key/button for snapping
  • different kinds of widgets that can be saved, loaded and distinguished visually
    • nodes that define the location of the assistant
    • nodes that define the state of the assistant
  • Option: on crop/transform/mirror canvas/scale: assistants should be processed, too
  • Transform operations on assistants independent of image transform; working on a selection of assistants
  • Integrate clone tool with assistants

Painting assistants are for:

  • Construct a complex image without using actual pixels (complex perspective construction)
  • Help guide the hand while painting (draw many parallel lines, concentric circles)

Organizing assistants:

  • In groups, in a hierarchy, with groups being visible or not, magnetic or not
  • Associated with one or more layers or layer groups