1. 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).
  2. 10 Sep, 2018 1 commit
  3. 21 Jul, 2018 1 commit
    • Michael Natterer's avatar
      Initial space invasion commit in GIMP · e09e563a
      Michael Natterer authored
      All babl formats now have a space equivalent to a color profile,
      determining the format's primaries and TRCs. This commit makes GIMP
      aware of this.
      - enum GimpPrecision: rename GAMMA values to NON_LINEAR and keep GAMMA
        as deprecated aliases, add PERCEPTUAL values so we now have LINEAR,
        NON_LINEAR and PERCPTUAL for each encoding, matching the babl
        encoding variants RGB, R'G'B' and R~G~B~.
      - gimp_color_transform_can_gegl_copy() now returns TRUE if both
        profiles can return a babl space, increasing the amount of fast babl
        color conversions significantly.
      - TODO: no solution yet for getting libgimp drawable proxy buffers in
        the right format with space.
      - follow the GimpPrecision change.
      - TODO: everything else unchanged and partly broken or sub-optimal,
        like setting a new image's color profile too late.
      - add enum GimpTRCType { LINEAR, NON_LINEAR, PERCEPTUAL } as
        replacement for all "linear" booleans.
      - change gimp-babl functions to take babl spaces and GimpTRCType
        parameters and support all sorts of new perceptual ~ formats.
      - a lot of places changed in the early days of goat invasion didn't
        take advantage of gimp-babl utility functions and constructed
        formats manually. They all needed revisiting and many now use much
        simpler code calling gimp-babl API.
      - change gimp_babl_format_get_color_profile() to really extract a
        newly allocated color profile from the format, and add
        gimp_babl_get_builtin_color_profile() which does the same as
        gimp_babl_format_get_color_profile() did before. Visited all callers
        to decide whether they are looking for the format's actual profile,
        or for one of the builtin profiles, simplifying code that only needs
        builtin profiles.
      - drawables have a new get_space_api(), get_linear() is now get_trc().
      - images now have a "layer space" and an API to get it,
        gimp_image_get_layer_format() returns formats in that space.
      - an image's layer space is created from the image's color profile,
        change gimpimage-color-profile to deal with that correctly
      - change many babl_format() calls to babl_format_with_space() and take
        the space from passed formats or drawables
      - add function gimp_layer_fix_format_space() which replaces the
        layer's buffer with one that has the image's layer format, but
        doesn't change pixel values
      - use gimp_layer_fix_format_space() to make sure layers loaded from
        XCF and created by plug-ins have the right space when added to the
        image, because it's impossible to always assign the right space upon
        layer creation
      - "assign color profile" and "discard color profile" now require use
        of gimp_layer_fix_format_space() too because the profile is now
        embedded in all formats via the space.  Add
        gimp_image_assign_color_profile() which does all that and call it
        instead of a simple gimp_image_set_color_profile(), also from the
        PDB set-color-profile functions, which are essentially "assign" and
        "discard" calls.
      - generally, make sure a new image's color profile is set before
        adding layers to it, gimp_image_set_color_profile() is more than
        before considered know-what-you-are-doing API.
      - take special precaution in all places that call
        gimp_drawable_convert_type(), we now must pass a new_profile from
        all callers that convert layers within the same image (such as
        image_convert_type, image_convert_precision), because the layer's
        new space can't be determined from the image's layer format during
        the call.
      - change all "linear" properties to "trc", in all config objects like
        for levels and curves, in the histogram, in the widgets. This results
        in some GUI that now has three choices instead of two.
        TODO: we might want to reduce that back to two later.
      - keep "linear" boolean properties around as compat if needed for file
        pasring, but always convert the parsed parsed boolean to
      - TODO: the image's "enable color management" switch is currently
        broken, will fix that in another commit.
  4. 11 Jul, 2018 1 commit
  5. 21 Jun, 2018 1 commit
  6. 25 Apr, 2018 1 commit
  7. 19 Apr, 2018 1 commit
    • Ell's avatar
      app: refactor gimppaintcore-loops to coalesce iteration · f2a1fd5b
      Ell authored
      The gimppaintcore-loops functions perform very little actual
      computational work (in case of do_layer_blend(), at least for
      simple blend modes), which makes the cost of buffer iteration, and
      memory bandwidth, nonnegligible factors.  Since these functions are
      usually called in succession, acessing the same region of the same
      buffers, using the same foramts, coalescing them into a single
      function, which performs all the necessary processing in a single
      step, can improve performance when these functions are the
      Add a gimp_paint_core_loops_process() function, which does just
      that: it takes a set of algorithms to run, and a set of parameters,
      and performs all of them in one go.  The individual functions are
      kept for convenience, but are merely wrappers around
      Be warned: the implementation uses unholy C++ from outer space, in
      order to make this (sort of) managable.  See the comments for more
  8. 05 Apr, 2018 1 commit
  9. 04 Apr, 2018 2 commits
  10. 31 Mar, 2018 1 commit
  11. 12 Feb, 2018 1 commit
    • Ell's avatar
      Bug 793392 - Issue when painting with some layer modes ... · 1be00225
      Ell authored
      ... on perceptual gamma image
      When constructing the paint core's paint buffer, in GimpBrushCore
      and GimpInk, use the drawable's format as the preferred format in
      the call to gimp_layer_mode_get_format(), instead of NULL.
      Subsequently, use the paint buffer's format, instead of the source
      buffer's format, as the preferred iterator format in
      do_layer_blend(), since the iterator format must match the paint
      buffer format.
  12. 17 Aug, 2017 1 commit
    • Ell's avatar
      app: layer mode code shuffling · 71bbd88e
      Ell authored
      Commit 3635cf04 moved the special
      handling of bottom-layer compositing to GimpOperationLayerMode.
      This required giving the op more control over the process()
      function of its subclasses.  As a temporary workaround, the commit
      bypassed the subclasses entirely, using "gimp:layer-mode" for all
      modes.  This is the reckoning :)
      Add a process() virtual function to GimpOperationLayerMode, which
      its subclasses should override instead of
      GeglOperationPointComposer3's process() functions.  Reinstate the
      subclasses (by returning the correct op in
      gimp_layer_mode_get_oepration()), and have them override this
      Improve the way gimp_operation_layer_mode_process() dispatches to
      the actual process function, to slightly lower its overhead and
      fix some thread-safety issues.
      Remove the "function" field of the layer-mode info array, and have
      gimp_layer_mode_get_function() return the
      GimpOperationLayerMode::process() function of the corresponding
      op's class (caching the result, to keep it cheap.)  This reduces
      redundancy, allows us to make the ops' process() functions private,
      and simplifies SSE dispatching (only used by NORMAL mode,
      Move the blend and composite functions of the non-specialized
      layer modes to gimpoperationlayermode-{blend,composite}.[hc],
      respectively, to improve code organization.
      Move the SSE2 composite functions to a separate file, so that they
      can be built as part of libapplayermodes_sse2, allowing
      libapplayermodes to be built without SSE2 compiler flags.  This
      allows building GIMP with SSE acceleration enabled, while running
      the resulting binary on a target with no SSE accelration.
      Add a "blend_function" field to the layer-mode info array, and use
      it to specify the blend function for the non-specialized modes.
      This replaces the separate switch() statement that we used
      Remove the "affected_region" field of the layer-mode info array.
      We don't need it anymore, since we can go back to using
      GimpOperationLayerMode's virtual get_affected_region() function.
      Last but not least, a bunch of code cleanups and consistency
  13. 17 Feb, 2017 1 commit
    • Ell's avatar
      app: remove GIMP_LAYER_MODE_FLAG_WANTS_LINEAR_DATA and friends · 74021275
      Ell authored
      Instead, add a gimp_layer_mode_get_format() function, which takes
      the layer mode, composite space, and blend space, and returns the
      I/O format.
      Currently, we always use the composite space format as the I/O
      format.  This simplifies gimp_composite_blend(), and gives us
      composite-space support for the "special" layer mode ops for free.
  14. 15 Feb, 2017 1 commit
  15. 14 Feb, 2017 1 commit
  16. 05 Feb, 2017 2 commits
  17. 31 Jan, 2017 1 commit
  18. 22 Jan, 2017 2 commits
  19. 21 Jan, 2017 2 commits
  20. 20 Jan, 2017 2 commits
  21. 19 Jan, 2017 3 commits
  22. 16 Jan, 2017 1 commit
  23. 11 Jan, 2017 1 commit
  24. 08 Jan, 2017 1 commit
  25. 02 Feb, 2016 1 commit
    • Jehan's avatar
      Bug 648776 - mirror symmetries. · 76f573c9
      Jehan authored
      You can now set any paint tool to mirror painting relatively
      horizontal/vertical axis or a central point (any combination of these 3
      This has been implemented as a new multi-stroke core, where every stroke
      is actually handled as a multi-stroke (default of size 1).
      This is also the first usage of custom guides for symmetry guiding.
      Current version has to be activated in the playground.
  26. 06 Sep, 2015 1 commit
  27. 04 Jul, 2015 1 commit
  28. 01 Jun, 2015 1 commit
  29. 02 Jul, 2014 1 commit
  30. 22 Feb, 2014 1 commit
  31. 28 Nov, 2013 1 commit
  32. 21 May, 2013 1 commit
    • Daniel Sabo's avatar
      Faster paintcore · cd91144f
      Daniel Sabo authored
      Directly access the brush and paint buffers rather than using
      GEGL iterators.
      Replicate the relevant parts of GimpApplicator using direct