Example #1
0
static void
gimp_threshold_tool_config_notify (GObject           *object,
                                   GParamSpec        *pspec,
                                   GimpThresholdTool *t_tool)
{
  GimpThresholdConfig *config = GIMP_THRESHOLD_CONFIG (object);

  if (! t_tool->histogram_box)
    return;

  gimp_histogram_view_set_range (t_tool->histogram_box->view,
                                 config->low  * 255.999,
                                 config->high * 255.999);

  gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (t_tool));
}
Example #2
0
static void
gimp_threshold_tool_config_notify (GObject           *object,
                                   GParamSpec        *pspec,
                                   GimpThresholdTool *t_tool)
{
    GimpThresholdConfig *config = GIMP_THRESHOLD_CONFIG (object);
    gint                 n_bins;

    if (! t_tool->histogram_box)
        return;

    n_bins = gimp_histogram_n_bins (t_tool->histogram);

    gimp_histogram_view_set_range (t_tool->histogram_box->view,
                                   config->low  * (n_bins - 0.0001),
                                   config->high * (n_bins - 0.0001));
}