1. 24 Jun, 2020 1 commit
  2. 12 Jun, 2020 1 commit
  3. 04 Jun, 2020 1 commit
  4. 17 May, 2020 1 commit
  5. 05 May, 2020 2 commits
    • Agata Cacko's avatar
      Move asserts before usage of a variable · c2ffbc6b
      Agata Cacko authored
      Before this commit, there were two asserts that were checked
      only after both of the variables were used. This means that instead of
      asserting, Krita would crash. It probaby doesn't change much in case of
      Q_ASSERTs (it would be different with asserts that allows recovering)
      but nonetheless, it makes no sense to assert after using a variable.
      This commit moves the asserts above the usage.
    • Rafał Mikrut's avatar
      Check if pointer is null before using it · c01502c9
      Rafał Mikrut authored and Agata Cacko's avatar Agata Cacko committed
  6. 01 May, 2020 1 commit
    • Mathias Wein's avatar
      Fix tone reproduction curve estimation · 733afddd
      Mathias Wein authored
      The ITUR_2100_PQ_FULL.ICC has no colorants and revealed the bugs.
      Iteration order was inverted so normalization didn't work.
      Also only the first colorant was ever written, and
      consequently the luma coefficients were also incomplete.
      Additionally, RGB vs. BGR channel ordering was not respected,
      and the sum of luma coefficients needs to be 1.0 for HSY
      color space calculations.
      And while at it, calculate a few more points so the graph in
      the color space browser looks at least somewhat like a curve.
      (cherry picked from commit fe47c061)
  7. 20 Apr, 2020 1 commit
  8. 17 Apr, 2020 1 commit
  9. 16 Apr, 2020 1 commit
  10. 14 Apr, 2020 1 commit
    • Dmitry Kazakov's avatar
      Fix comparison of KoColor objects packed into QVariant · ca5df540
      Dmitry Kazakov authored
      KoResourceManager compares value of the resource before issuing
      update signals. It doesn't issue update signal is the resource hasn't
      This patch fixes a bug when moving a shape used to make all color
      selectors crazy because of constant updates of BG/FG colors.
  11. 13 Apr, 2020 1 commit
  12. 10 Apr, 2020 2 commits
    • Dmitry Kazakov's avatar
      Fix compilation on clang · 22cb6a76
      Dmitry Kazakov authored
    • Dmitry Kazakov's avatar
      Add a workaround for a bug(?) in clang · 5a82b010
      Dmitry Kazakov authored
      It looks like clang cannot link to explicit instantiations containing
      'half' as a template parameter. I didn't manage to reproduce a limited
      self-contained test yet.
      The workaround just stops exporting templated classes. It exports a
      factory that accepts KoId. This factory then dispatches the calls to
      proper templated code.
  13. 09 Apr, 2020 4 commits
  14. 08 Apr, 2020 3 commits
  15. 03 Apr, 2020 1 commit
    • Dmitry Kazakov's avatar
      Add the latest lightness blending algorithm by Peter Schatz · 7e3f6c76
      Dmitry Kazakov authored
      "We needed a formula f(x) where f(0) = 0, f(1) = 1, and f(.5) = z,
      where z is the lightness of the color chosen. This can’t be
      linear unless the color chosen is also .5. So I went with
      a quadratic equation and solved it.
      f(x) = ax^2 + b^x +c
      0,0 -> 0 = a0^2 + b0 + c -> c = 0
      1,1 -> 1 = a1^2 +b1 + c -> 1 = a + b + 0 -> a = 1 - b
      .5,z -> z = a*.5^2 + b*.5 + c -> z
                = a/4 + b/2 + 0 -> z =
                = 1/4 - b/4 + b/2 -> z = 1/4 + b/4 -> b = 4z - 1
      f(x) = (1 - (4z - 1)) * x^2 + (4z - 1) * x
      So yes, the equation will be different for every value of
      color chosen, because that’s the only possible way to
      achieve the goal of an equation that runs through (0,0),
      (.5,z), and (1,1)."
  16. 01 Apr, 2020 1 commit
  17. 30 Mar, 2020 1 commit
  18. 26 Mar, 2020 1 commit
  19. 25 Mar, 2020 2 commits
    • Dmitry Kazakov's avatar
      Optimize Auto Brush by merging fill and mask passes into one · 256d014e
      Dmitry Kazakov authored
      The patch removes extra "fill with color" pass from KisAutoBrsuh and
      moves that into KoColorSpace::fillInverseAlphaNormedFloatMaskWithColor(),
      where both filling and masking happens. It makes brush speed at least
      10% higher.
    • Dmitry Kazakov's avatar
      Fix "Preserve Lightness" to work with all color spaces · 4064d50a
      Dmitry Kazakov authored
      Now filling of the brush with color and applying alpha mask has been
      moved into KoColorSpace as a single operation. It should be much faster
      and it makes the code more understandable.
      This patch also changes the "preserve lightness" algorithm. Instead of lerp
      it uses standard overlay operation in the lightness scale. This approach
      generates result a bit more like Ramon's brushes.
  20. 19 Mar, 2020 1 commit
  21. 05 Mar, 2020 1 commit
    • Amy spark's avatar
      Fix Lab channel render in canvas and Channels docker · 7261d7bd
      Amy spark authored
      This moves the channel rendering code to a KoColorSpace function
      named convertChannelToVisualRepresentation, implemented in
      KoColorSpaceAbstract and overriden in Lab colorspaces.
      This function now handles copying channel values and, where necessary,
      renormalizes it so as to fit the valid channel range (as with Lab).
      As a bonus, I also fixed scaleToU8 in Lab because it needed
      the same renormalization procedure.
      Thanks to Wolthera for the initial pseudopatch -- the missing part was
      the canvas code.
      BUG: 254784
  22. 28 Feb, 2020 1 commit
    • Dmitry Kazakov's avatar
      Remove KoResource::operator=() · a4c282c7
      Dmitry Kazakov authored
      It was implemented incorrectly: no operators in derived classes called
      corresponding implementations of base classes, which basically caused
      "slicing". It was easier to remove all operator=() implementations instead
      of just trying to fix all of them. Anyway, they were never used (and that
      is the reason the bug has never been seen).
  23. 21 Feb, 2020 3 commits
    • Dmitry Kazakov's avatar
      Fix building KoColorSet after the merge · 1fc63cc1
      Dmitry Kazakov authored
    • Dmitry Kazakov's avatar
      Refactor out using global resources singletons in KisPaintOpSettings · 477012cd
      Dmitry Kazakov authored
      We cannot access global resource system while rendering the stroke in
      a worker thread. Therefore, we should prepare all the resources in
      advance, in GUI-thread, wrap them into a "server-like" storage and
      then pass to the paintop itself
      The patch does the following changes:
      1) KisPaintOpSettings now stores an internal link to "resources interface".
         Whenever the settings object wants to fetch a resource, e.g. in
         KisBrushBasedPaintOpSettings::paintOpSize(), it asks the resource
         interface about it.
      2) Before starting a stroke KisResourcesSnapshot does the following
         preparations (via KisPaintOpPreset::createLocalResourcesSnapshot()):
         1) Asks the paintop's factory about all the needed resources via
            (static) call to prepareResources().
         2) Wraps all these resources into KisLocalStrokeResources "fake"
         3) Sets this "fake" object as a resources source for KisPaintOpSettings
            object. Therefore, no global resources system will be accessed during
            the execution of the stroke.
      3) KoResource::load() and KoResource::loadFromDevice() now should also
         accept the resources interface. Obviously, the resources source for
         for KisPaintOpPreset should be set up right from the construction.
    • Dmitry Kazakov's avatar
      Implement KoEphemeralResource resource type · d8e47c44
      Dmitry Kazakov authored
      This type of resources has no representation on disk. They are created
      on the fly by the corresponding factories. E.g. KisAutoBrush. These
      resources don't have any load/save() methods, so they are implemented in
      a base, KoEphemeralResource.
      The main reason of this patch is to remove code duplication in
      implementations of save()/load() calls and move actual implementation
      to KoResource class.
  24. 20 Feb, 2020 3 commits
  25. 18 Feb, 2020 1 commit
  26. 15 Feb, 2020 3 commits