Add Support for Perspective Ellipse in Krita for SoK

Halla Rempt halla at valdyas.org
Mon Feb 7 12:31:54 GMT 2022


Sorry, no, I've been sick until today, and I'm still rather tired. If you go with working through the assistants and Dmitry is fine with that, I have no problems either.

Halla

On woensdag 19 januari 2022 18:51:23 CET Srirupa Datta wrote:
> Hi,
> 
> I knew you were sick, hope you are better now. I've noticed that you
> applied as a mentor for the project, thanks!
> 
> As for the button, I was thinking about some kind of enable button in the
> Tools Option Docker.
> I was talking to Dmitry about whether to extend to Ellipse Tool or Ellipse
> Assistant Tool, he suggested that I extend the Ellipse Assistant Tool.
> Actually the ellipse in the Ellipse Assistant Tool is transformable
> contrary to the ellipse in the Ellipse Tool which is not transformable.
> Also, I went through some of the code in EllipseAssistant.cc and it looked
> like some of the functions, particularly related to transformation, have
> already been implemented there.
> 
> On Wed, Jan 19, 2022 at 3:43 PM Halla Rempt <halla at valdyas.org> wrote:
> 
> > Hi,
> >
> > Sorry, I've been pretty sick, so I'm now trying to slowly catch up... I've
> > applied as a mentor for your project, so that's settled.
> >
> > On woensdag 12 januari 2022 12:28:41 CET Srirupa Datta wrote:
> > > Hey all,
> > >
> > > Since Dmitry is on vacation, I am writing here because I needed to
> > clarify
> > > a few things. I wanted to add support for Perspective Ellipse in Krita
> > as a
> > > part of Season of KDE.
> > > The link for the feature request: Circle in a Square
> > > <https://bugs.kde.org/show_bug.cgi?id=405643>
> > >
> > > Now, I wanted to clarify if this is roughly what I would be doing.
> > >
> > >
> > > 1. Create a seperate button on Tools Option Docker for Ellipse Tool.
> > >
> >
> > Ah, we need to be careful here: do you mean a new button in the toolbox,
> > or a toggle in the option widget?
> >
> > > 2. When the perspective ellipse button is clicked, a circle in a square
> > > figure appears on the canvas, the corners of the squares being
> > adjustable.
> > > The circle in a square can be moved to the desired location and corners
> > can
> > > be adjusted. 3. Now when the corners are adjusted, I need to use the
> > > KisPerspectiveTransformStrategy::continuePrimaryAction() function to get
> > > the transformation matrix from the four points and use that to transform
> > > the circle to the corresponding ellipse.
> >
> > Yes.
> >
> > > 4. As Halla suggested, this transformation should not transform the
> > pixels,
> > > so I probably need to look into what other methods are there for
> > > transforming.
> >
> > Yes, the stroke should be drawn using the current brush following the
> > (qpainter)path created by the user when manipulating the perspective box.
> >
> > > 5. As for the mathematical part, I can use the transformation matrix on
> > the
> > > old circle/ellipse to convert it to the new ellipse, but the
> > KisAlgebra2d::
> > > transformEllipse() function uses the semimajor and semiminor axes
> > lengths,
> > > so would it possible to reuse that function by finding the major and
> > minor
> > > axes?
> >
> > I don't know -- maths is not my forte.
> >
> > >
> > > 6. Also, just to be clear, I am extending the Ellipse Tool, not creating
> > > another Assistant Tool(there is one Ellipse option in the Assistant Tool
> > as
> > > well), right?
> >
> > Yes, that is correct.
> >
> > >
> > >
> > > I have created a draft proposal which was reviewed by Halla earlier. The
> > > details have been mentioned there. Link: Draft Proposal
> > > <
> > https://docs.google.com/document/d/1Bgi0og-YMkyU8rmVr9RuXyzi6f4YLretYk-HFSkG-d4/edit?usp=sharing
> > >
> > >
> > >
> > > With regards,
> > >
> > > Srirupa Datta
> > >
> > > IRC: sriru:matrix.org
> > >
> >
> >
> >
> >
> >
> 






More information about the kimageshop mailing list