After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 785535 - Histogram not updating in real time when filters are active
Histogram not updating in real time when filters are active
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: General
unspecified
Other All
: Normal normal
: 2.10
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2017-07-28 15:46 UTC by mholder22
Modified: 2017-08-11 01:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Implements gegl_buffer_iterator_add_node() (15.03 KB, patch)
2017-07-31 22:21 UTC, Michael Natterer
none Details | Review

Description mholder22 2017-07-28 15:46:17 UTC
Histogram waits until I finish an adjustment, like levels or brightness, before updating.
Comment 1 Michael Natterer 2017-07-29 17:04:54 UTC
I have fixed this locally but the fix requires an addition to GEGL
which needs to be discussed. Stay tuned :)
Comment 2 mholder22 2017-07-31 11:56:38 UTC
Ok thanks for the update
Comment 3 Michael Natterer 2017-07-31 22:17:48 UTC
Ok here is what's needed: we need to be able to create a histogram
from both the layer's original buffer, and from the output of the
filter graph on top of the layer.

GimpHistogram currently uses a GeglBufferIterator, so I hacked
up GeglBufferIterator to be able to read from a GeglNode, a better
API would be:

 GeglIterator
 gegl_iterator_new_empty()
 gegl_iterator_new_buffer()
 gegl_iterator_new_node()
 gegl_iterator_add_buffer()
 gegl_iterator_add_node()
 the rest just renamed gegl_buffer_iterator -> gegl_iterator

But for now I'll attach a patch that simply adds

 gegl_buffer_iterator_add_node()
Comment 4 Michael Natterer 2017-07-31 22:21:06 UTC
Created attachment 356676 [details] [review]
Implements gegl_buffer_iterator_add_node()
Comment 5 Øyvind Kolås (pippin) 2017-08-01 11:11:14 UTC
GeglBuffer as the data storage foundation should not itself be using any graph APIs, a possibility that has been kept possible and should continue being kept possible is splitting GeglBuffer out to a separate library that GEGL can depend on.

Adding a single node to process the buffer also breaks expectations of how nodes are used in gegl, what if one wanted to have a chain of nodes?

It seems more reasonable to add better iteration API for nodes that can be used in along with/instead of gegl_node_blit.
Comment 6 Michael Natterer 2017-08-01 12:34:09 UTC
"Node to process the buffer"? I don't understand.

The nodes added via that new iterator api are the outputs
of complete graphs of course.

And the killer feature is actually to be able to iterate over
buffers *and* graph outputs at the same time.
Comment 7 Øyvind Kolås (pippin) 2017-08-01 15:09:04 UTC
Ah, I haven't had time to more than a couple of glances on the patch. Maybe what needs to be done is to have both a gegl_buffer_iterator_ API in GeglBuffer and a gegl_iterator_ API in GEGL, that either duplicates or reuses infrastructure provided by GeglBuffer.
Comment 8 Michael Natterer 2017-08-02 06:20:40 UTC
I would be willing to create a GeglIterator in graph/ or perhaps better
process/, for now duplicating the code. I'm not quite sure about a good
apptoach to re-use the GeglBufferIterator code tho.
Comment 9 Michael Natterer 2017-08-05 15:13:42 UTC
Comment on attachment 356676 [details] [review]
Implements gegl_buffer_iterator_add_node()

This patch is now attached to a GEGL bug.
Comment 10 Michael Natterer 2017-08-05 15:21:28 UTC
Fixed in master:

commit c41e8eca86df42bb92905b7be9670334d377709f
Author: Michael Natterer <mitch@gimp.org>
Date:   Sat Aug 5 17:15:31 2017 +0200

    Bug 785535 - Histogram not updating in real when filters are active
    
    Add "gboolean with_filters" to gimp_drawable_calculate_histogram(),
    which is passed as FALSE in almost all places, except the histogram
    dockable where we want to see both the drawable's unmodified histogram
    *and* the histogram after filters are applied.

 app/core/gimpdrawable-equalize.c    | 10 ++++----
 app/core/gimpdrawable-histogram.c   | 70 ++++++++++++++++++++++++++++++++++++++++++++++---------
 app/core/gimpdrawable-histogram.h   |  3 ++-
 app/core/gimpdrawable-levels.c      |  2 +-
 app/pdb/color-cmds.c                |  2 +-
 app/pdb/drawable-color-cmds.c       |  2 +-
 app/tools/gimpcurvestool.c          |  2 +-
 app/tools/gimplevelstool.c          |  2 +-
 app/tools/gimpthresholdtool.c       |  2 +-
 app/widgets/gimphistogrameditor.c   | 10 +++-----
 tools/pdbgen/pdb/color.pdb          |  2 +-
 tools/pdbgen/pdb/drawable_color.pdb |  2 +-
 12 files changed, 77 insertions(+), 32 deletions(-)
Comment 11 mholder22 2017-08-11 01:21:01 UTC
That awesome it is fixed!  It is kind of strange though nobody mentioned it before . . . or maybe they did and just didn't say anything or I just was in the dark about all of it.  Anyway, thanks for fixing it.  With more than 8 bits Gimp is much more useful when adjusting the levels and curves without those massive gaps in the histogram that 8 bits leave around.