1. 17 Apr, 2019 1 commit
    • Ell's avatar
      app: add incremental mode to the Dodge/Burn tool · 83184d16
      Ell authored
      Add an "Incremental" option to the Dodge/Burn tool, which,
      similarly to the Paintbrush, Pencil, and Eraser tools, applies the
      effect incrementally as the pointer moves.
      83184d16
  2. 06 Mar, 2019 1 commit
  3. 02 Mar, 2019 1 commit
  4. 24 Feb, 2019 2 commits
    • Ell's avatar
      app: in GimpSmudge, avoid copying brush pixmap when flow = 0 · fb5987fd
      Ell authored
      In GimpSmudge, avoid copying the brush's dab to the paint buffer
      when using a pixmap brush if the flow parameter is 0 -- it has no
      effect in this case.
      fb5987fd
    • Ell's avatar
      app: improve gimp_brush_core_color_area_with_pixmap() · 5b09af43
      Ell authored
      Reimplement gimp_brush_core_color_area_with_pixmap(), which copies
      the brush's dab to the paint buffer when using a pixmap brush, in
      terms of gimp-gegl-loops.  This simplifies the functions,
      parallelizes processing, and transparently handles float brushes.
      
      Replace the "mode" parameter of the function with an "apply_mask"
      parameter, which specifies whether to apply the brush's mask to
      the dab as part of copying.  Avoid applying the mask in
      GimpPaintbrush; previously, we would erroneously apply the mask
      twice when using the paintbrush tool: once when copying the
      dab to the paint buffer, and again when pasting the paint buffer
      to the canvas.
      
      We still apply the mask in GimpSmudge, which results in the same
      double-application behavior, however, this might be less practical
      to fix.
      5b09af43
  5. 21 Feb, 2019 1 commit
    • Ell's avatar
      app: replace use of deprecated dont-cache/no_cache with cache-policy · 7489f0ae
      Ell authored
      Replace the use of the deprecated GeglNode::dont-cache property,
      and GeglOperationClass::no_cache field, with GeglNode::cache-policy
      and GeglOperationClass::cache_policy, respectively.
      
      See commit gegl@7f24430cda0d8c3eff311868823d445edc2a4e12.
      7489f0ae
  6. 16 Feb, 2019 8 commits
    • Ell's avatar
      app: in gimppaintcore-loops, unsuppress COMBINE_PAINT_MASK_TO_CANVAS_BUFFER algorithm · 6fe57a94
      Ell authored
      In gimppaintcore-loops, unsuppress the
      COMBINE_PAINT_MASK_TO_CANVAS_BUFFER algorithm (partially
      reverts commit b717ead1.)
      
      In gimp_paint_core_paste() it's always used together with
      CANVAS_BUFFER_TO_PAINT_BUF_ALPHA, which matches a combined
      algorithm, preventing it from being called, however, it can still
      be called through gimp_paint_core_replace(), which uses it
      together with CANVAS_BUFFER_TO_COMP_MASK, which doesn't have a
      combined algorithm.  We can, however, filter out
      CANVAS_BUFFER_TO_PAINT_BUF_ALPHA whenver
      COMBINE_PAINT_MASK_TO_CANVAS_BUFFER is matched (since the combined
      algorithm will be matched beforehand when both algorithms are
      included).
      6fe57a94
    • Ell's avatar
    • Ell's avatar
      app: use MASK_COMPONENTS algorithm in gimp_paint_core_{paste,replace}() · c7d8d9ba
      Ell authored
      Remove the mask_components_onto() gimppaintcore-loops function, and
      the GimpPaintCore::comp_buffer member.  Instead, in
      gimp_paint_core_paste() and gimp_paint_core_replace(), use the
      MASK_COMPONENTS algorithm, added in the previous commit.
      c7d8d9ba
    • Ell's avatar
      app: in gimppaintcore-loops, add MASK_COMPONENTS algorithm · 08fa46ea
      Ell authored
      In gimppaintcore-loops, add a new MASK_COMPONENTS algorithm, which
      masks the output of compositing into the destination buffer,
      according to a component mask.  The algorithm uses the same code as
      gimp:mask-comopnents, and can be used as part of a
      gimp_paint_core_loops_process() pipeline, instead of using a
      separate function.
      08fa46ea
    • Ell's avatar
      app: in gimppaintcore-loops, add [Temp]CompBuffer algorithm helper-classes · 858f30a6
      Ell authored
      In gimppaintcore-loops, add a CompBuffer algorithm helper-class,
      which provides access to the output buffer used for compositing,
      to be used by the DO_LAYER_BLEND algorithm instead of the
      destination buffer.
      
      CompVuffer itself doesn't provide the storage for the buffer; this
      is rather the responsibility of the algorithms that use it.  The
      TempCompBuffer algorithm helper-class provides temporary storage
      for the compositing buffer, and can be used by algorithms that need
      a temporary buffer.
      858f30a6
    • Ell's avatar
      app: in gimppaintcore-loops, mark algorithms as mandatory/suppressed · b717ead1
      Ell authored
      In gimppaintcore-loops, use {Mandatory,Supressed}AlgorithmDispatch,
      added in the previous commit, to mark certain algorithms as always
      occuring, or never occuring, in all hierarchies.
      b717ead1
    • Ell's avatar
      app: in gimppaintcore-loops, add {Mandatory,Suppressed}AlgorithmDispatch · fc7ffc71
      Ell authored
      In gimppaintcore-loops, add MandatoryAlgorithmDispatch and
      SuppressedAlgorithmDispatch class templates, which implement
      dispatch functions suitable for algorithms which are always part of
      the hierarchy, or never part of the hierarchy, respectively.  Using
      one of these classes as the dispatch function for a given algorithm
      verifies that the algorithm is/isn't included in the requested-
      algorithm set, but doesn't otherwise increase the number of
      instanciated hierarchies, since only one of these cases has to be
      handled.
      fc7ffc71
    • Ell's avatar
      app: in gimppaintcore-loops, remove individual-algorithm functions · 95761db5
      Ell authored
      In gimppaintcore-loops, remove the individual-algorithm convenience
      functions, which are merely wrappers around
      gimp_paint_core_loops_process(), and aren't used anywhere anymore.
      This allows us to avoid instanciating certain algorithm-hierarchies
      which aren't used in practice, as will be done by the following
      commits.
      95761db5
  7. 13 Feb, 2019 1 commit
  8. 12 Feb, 2019 13 commits
    • Ell's avatar
    • Ell's avatar
      app: in gimp_paint_core_replace(), improve applicator path · 3451ffb6
      Ell authored
      In the applicator path of gimp_paint_core_replace(), actually use
      the paint-core's applicator, instead of using
      gimp_drawable_replace_buffer().  This improves speed, consolidates
      code, and fixes some cases in which the latter is broken.
      
      Furthermore, when using CONSTANT paint application-mode, use the
      paint-core's undo_buffer as the compositing source, rather than the
      drawable buffer, which is the correct behavior.
      3451ffb6
    • Ell's avatar
      app: in gimp_paint_core_paste(), don't copy paint mask when combining to canvas buffer · ba6713bb
      Ell authored
      In the applicator path of gimp_paint_core_paste(), use the paint
      mask directly when combining it to the canvas buffer, rather than
      using a copy of it, since it's not being modified.
      
      Fix some comments.
      ba6713bb
    • Ell's avatar
      app: implement gimp_paint_core_replace() using gimp_paint_core_loops_process() · ddb69b77
      Ell authored
      Implement the no-applicator path of gimp_paint_core_replace() in
      terms of gimp_paint_core_loops_process(), using the algorithms
      added in the previous commit, instead of using
      gimp_drawable_replace_buffer().  This improves speed, consolidates
      code, and fixes some cases in which the latter is broken.
      
      Furthermore, when using CONSTANT paint application-mode, use the
      paint-core's undo_buffer as the compositing source, rather than the
      drawable buffer, which is the correct behavior.
      ddb69b77
    • Ell's avatar
      app: in gimppaintcore-loops, add {CANVAS_BUFFER,PAINT_MASK}_TO_COMP_MASK algorithms · 183a5561
      Ell authored
      In gimppaintcore-loops, add CANVAS_BUFFER_TO_COMP_MASK and
      PAINT_MASK_TO_COMP_MASK paint algorithms, which copy the canvas
      buffer and the paint mask, respectively, to the compositing mask.
      When there is an image mask buffer, the algorithms additionally
      combine the copied mask with the mask buffer.  When possible, the
      algorithms use the canvas buffer/paint mask data directly as the
      compositing mask data, instead of copying.
      
      These algorithms are necessary in order to implement
      gimp_paint_core_replace() in terms of
      gimp_paint_core_loops_process(), which is done by the next commit.
      183a5561
    • Ell's avatar
      app: in gimppaintcore-loops, make sure dest_buffer is the primary iterator buffer · f9c072c3
      Ell authored
      In gimppaintcore-loops, in the DO_LAYER_BLEND paint algorithm, and
      in the CanvasBufferIterator algorithm helper-class, initialize the
      iterator *before* initializing the base class, to make sure that
      dest_buffer, or canvas_buffer, respectively and in that order, is
      the primary buffer of the iterator.  In particular, this avoids the
      mask buffer being the primary buffer.  This is desirable, since
      most of the buffers we iterate over are tile-aligned to the dest/
      canvas buffers.
      f9c072c3
    • Ell's avatar
      app: in gimppaintcore-loops, add MaskBufferIterator algorithm helper-class · 44281ce2
      Ell authored
      In gimppaintcore-loops, add a MaskBufferIterator algorithm helper-
      class, which provides read-only iterator access to the mask buffer,
      if one is used.
      
      Use the new class in DoLayerBlend, instead of manually managing the
      mask-buffer iterator.
      44281ce2
    • Ell's avatar
      app: in gimppaintcore-loops, add [Temp]CompMask algorithm helper-classes · e36847fe
      Ell authored
      In gimppaintcore-loops, add a CompMask algorithm helper-class,
      which provides access to the mask buffer used for compositing, to
      be used by the DO_LAYER_BLEND algorithm instead of the image mask
      buffer.
      
      CompMask itself doesn't provide the storage for the mask; this is
      rather the responsibility of the algorithms that use it.  The
      TempCompMask algorithm helper-class provides temporary storage for
      the compositing mask, and can be used by algorithms that need a
      temporary mask.
      e36847fe
    • Ell's avatar
      app: in gimppaintcore-loops, name algorithms more consistently · d23e239f
      Ell authored
      In gimppaintcore-loops, make the algorithm names, and the names of
      the corresponding functions, more consistent.
      d23e239f
    • Ell's avatar
      app: in gimppaintcore-loops, allow specifying dependencies to BasicDispatch · 2788444d
      Ell authored
      ... which are dispatched before the algorithm, as in
      AlgorithmDispatch.
      2788444d
    • Ell's avatar
      app: in gimppaintcore-loops, add finalize[_step]() algorithm functions · 4d2ce154
      Ell authored
      In gimppaintcore-loops, add finalize() and finalize_step()
      algorithm functions, which get called at the end of processing the
      entire area, and at the end of processing each chunk, respectively.
      Algorithms can use these functions to clean up allocated resources.
      4d2ce154
    • Ell's avatar
      app: in gimppaintcore-loops, make CanvasBufferIterator self-contained · 0d1f7241
      Ell authored
      In gimppaintcore-loops, make the CanvasBufferIterator algorithm
      helper-class self-contained, not having to rely on AlgorithmBase.
      0d1f7241
    • Ell's avatar
      app: in gimppaintcore-loops, use dynamic iterator indices · 9d1d21e7
      Ell authored
      In the various gimppaintcore-loops algorithms, assign each
      algorithm's iterator indices dynamically, rather than statically,
      so that algorithms have more freedom in the way they initialize the
      iterator.
      9d1d21e7
  9. 06 Feb, 2019 3 commits
  10. 20 Jan, 2019 1 commit
  11. 19 Jan, 2019 1 commit
  12. 29 Dec, 2018 1 commit
    • Ell's avatar
      app: in GimpApplicator, allow enabling cache/preview after construction; remove preview cache · ab52dc6b
      Ell authored
      Remove the use_split_preview and use_result_cache parameters of
      gimp_applicator_new(), and allow enabling/disabling the cache
      (through gimp_applicator_set_cache()) and the preview crop (through
      gimp_applicator_set_preview()) after construction.
      
      Move the preview crop node after the result cache, and remove the
      separate preview cache node.  This eliminates an extra cache
      buffer, reducing the space consumed by filters, and speeds up split
      preview, since the cached result now includes the output
      compositing.
      ab52dc6b
  13. 02 Dec, 2018 2 commits
  14. 14 Nov, 2018 1 commit
  15. 18 Sep, 2018 1 commit
    • Ell's avatar
      app, libgimp*, modules: don't use g_type_class_add_private() ... · 3b0040c0
      Ell authored
      ... and G_TYPE_INSTANCE_GET_PRIVATE()
      
      g_type_class_add_private() and G_TYPE_INSTANCE_GET_PRIVATE() were
      deprecated in GLib 2.58.  Instead, use
      G_DEFINE_[ABSTRACT_]TYPE_WITH_PRIVATE(), and
      G_ADD_PRIVATE[_DYNAMIC](), and the implictly-defined
      foo_get_instance_private() functions, all of which are available in
      the GLib versions we depend on.
      
      This commit only covers types registered using one of the
      G_DEFINE_FOO() macros (i.e., most types), but not types with a
      custom registration function, of which we still have a few -- GLib
      currently only provides a (non-deprecated) public API for adding a
      private struct using the G_DEFINE_FOO() macros.
      
      Note that this commit was 99% auto-generated (because I'm not
      *that* crazy :), so if there are any style mismatches... we'll have
      to live with them for now.
      3b0040c0
  16. 11 Sep, 2018 1 commit
    • Ell's avatar
      app: some cleanup in gimppaintcore-loops · 6c6a7514
      Ell authored
      In gimp_paint_core_loops_process(), initialize the iterator with
      sufficient room for the number of iterators used by the algorithm
      hierarchy, instead of a fixed number.
      
      Add an additional 'rect' parameter to the init_step() and
      process_rows() algorithm member functions, which receives the area
      of the currently-processed chunk, to be used instead of the
      iterator's ROI member.  This allows us to pass a NULL iterator to
      hierarchies that don't use an iterator, and avoid the stack-
      allocated iterator hack we used in this case (and which became even
      more problematic with the new iterator API).
      6c6a7514
  17. 10 Sep, 2018 1 commit