1 //
2 //  PRHistogram.h
3 //  PRICE
4 //
5 //  Created by Riccardo Mottola on Thu Dec 11 2003.
6 //  Copyright (c) 2003-2014 Carduus. All rights reserved.
7 //
8 // This application is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
10 
11 #import <AppKit/AppKit.h>
12 #include <limits.h>
13 #import <PRImage.h>
14 
15 
16 @class PRCHistogram;
17 
18 @interface PRHistogram : NSView
19 {
20     float histogram[UCHAR_MAX+1];             /* normalized histogram */
21     float cumulativeHistogram[UCHAR_MAX+1];   /* cumulative histogram */
22     float histogramR[UCHAR_MAX+1];            /* normalized histogram */
23     float histogramG[UCHAR_MAX+1];            /* normalized histogram */
24     float histogramB[UCHAR_MAX+1];            /* normalized histogram */
25     float cumulativeHistogramR[UCHAR_MAX+1];  /* cumulative histogram */
26     float cumulativeHistogramG[UCHAR_MAX+1];  /* cumulative histogram */
27     float cumulativeHistogramB[UCHAR_MAX+1];  /* cumulative histogram */
28     float maxHisto;
29     float maxCumulativeHisto;
30     IBOutlet PRCHistogram *theController;
31     PRImage *theImage;
32     @private BOOL calculationsDone;
33     @protected BOOL hasColor;
34 }
35 
36 - (void)setImage :(PRImage *)image;
37 - (void)calculateHistogram;
38 - (void)displayHistogram :(NSRect)viewRect;
39 
40 @end
41