~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to app/core/gimpdrawable-histogram.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070502163303-bvzhjzbpw8qglc4y
Tags: 2.3.16-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/rules: i18n magic.
* debian/control.in:
  - Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch,
  debian/patches/10_dont_show_wizard.patch: updated.
* debian/patches/04_composite-signedness.patch,
  debian/patches/05_add-letter-spacing.patch: dropped, used upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* The GIMP -- an image manipulation program
 
1
/* GIMP - The GNU Image Manipulation Program
2
2
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
3
3
 *
4
 
 * gimphistogram module Copyright (C) 1999 Jay Cox <jaycox@earthlink.net>
 
4
 * gimphistogram module Copyright (C) 1999 Jay Cox <jaycox@gimp.org>
5
5
 *
6
6
 * This program is free software; you can redistribute it and/or modify
7
7
 * it under the terms of the GNU General Public License as published by
28
28
#include "base/pixel-region.h"
29
29
 
30
30
#include "gimpdrawable.h"
 
31
#include "gimpdrawable-histogram.h"
31
32
#include "gimpimage.h"
32
33
 
33
34
 
34
35
void
35
36
gimp_drawable_calculate_histogram (GimpDrawable  *drawable,
36
 
                                   GimpHistogram *histogram)
 
37
                                   GimpHistogram *histogram)
37
38
{
38
39
  PixelRegion region;
39
40
  PixelRegion mask;
49
50
  if ((x1 == x2) || (y1 == y2))
50
51
    return;
51
52
 
52
 
  pixel_region_init (&region, gimp_drawable_data (drawable),
 
53
  pixel_region_init (&region, gimp_drawable_get_tiles (drawable),
53
54
                     x1, y1, (x2 - x1), (y2 - y1), FALSE);
54
55
 
55
56
  if (have_mask)
56
57
    {
57
58
      GimpChannel *sel_mask;
58
 
      GimpImage   *gimage;
 
59
      GimpImage   *image;
59
60
      gint         off_x, off_y;
60
61
 
61
 
      gimage   = gimp_item_get_image (GIMP_ITEM (drawable));
62
 
      sel_mask = gimp_image_get_mask (gimage);
 
62
      image   = gimp_item_get_image (GIMP_ITEM (drawable));
 
63
      sel_mask = gimp_image_get_mask (image);
63
64
 
64
65
      gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y);
65
 
      pixel_region_init (&mask, gimp_drawable_data (GIMP_DRAWABLE (sel_mask)),
66
 
                         x1 + off_x, y1 + off_y, (x2 - x1), (y2 - y1), FALSE);
 
66
      pixel_region_init (&mask,
 
67
                         gimp_drawable_get_tiles (GIMP_DRAWABLE (sel_mask)),
 
68
                         x1 + off_x, y1 + off_y, (x2 - x1), (y2 - y1), FALSE);
67
69
      gimp_histogram_calculate (histogram, &region, &mask);
68
70
    }
69
71
  else