Skip to contentPackage: Histogram
Histogram
Coverage
1: /*
2: * *********************************************************************************************************************
3: *
4: * Mistral: open source imaging engine
5: * http://tidalwave.it/projects/mistral
6: *
7: * Copyright (C) 2003 - 2023 by Tidalwave s.a.s. (http://tidalwave.it)
8: *
9: * *********************************************************************************************************************
10: *
11: * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
12: * the License. You may obtain a copy of the License at
13: *
14: * http://www.apache.org/licenses/LICENSE-2.0
15: *
16: * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
17: * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
18: * specific language governing permissions and limitations under the License.
19: *
20: * *********************************************************************************************************************
21: *
22: * git clone https://bitbucket.org/tidalwave/mistral-src
23: * git clone https://github.com/tidalwave-it/mistral-src
24: *
25: * *********************************************************************************************************************
26: */
27: package it.tidalwave.image;
28:
29: import it.tidalwave.image.render.PreviewSettings;
30: import lombok.extern.slf4j.Slf4j;
31:
32: /***********************************************************************************************************************
33: *
34: * @author Fabrizio Giudici
35: *
36: **********************************************************************************************************************/
37: @Slf4j
38: public abstract class Histogram
39: {
40: protected Object image;
41: protected int bandCount;
42: protected int bitsPerBand;
43:
44: /*******************************************************************************************************************
45: *
46: * @param image
47: *
48: ******************************************************************************************************************/
49: protected Histogram (final Object image)
50: {
51: this.image = image;
52:
53: // bitsPerBand = image. getBitsPerBand();
54: }
55:
56: /*******************************************************************************************************************
57: *
58: * @param band
59: * @return
60: *
61: ******************************************************************************************************************/
62: public abstract int[] getFrequencies (int band);
63:
64: /*******************************************************************************************************************
65: *
66: * @param band
67: * @return
68: *
69: ******************************************************************************************************************/
70: public abstract int getMin (int band);
71:
72: /*******************************************************************************************************************
73: *
74: * @param band
75: * @return
76: *
77: ******************************************************************************************************************/
78: public abstract int getMax (int band);
79:
80: /*******************************************************************************************************************
81: *
82: * @return
83: *
84: ******************************************************************************************************************/
85: public int getBandCount()
86: {
87: return bandCount;
88: }
89:
90: /*******************************************************************************************************************
91: *
92: * @param previewSetting
93: * @return
94: *
95: ******************************************************************************************************************/
96: public abstract Histogram getPreview (PreviewSettings previewSetting);
97:
98: /*******************************************************************************************************************
99: *
100: * @param band
101: *
102: ******************************************************************************************************************/
103: protected void validateBand (final int band)
104: {
105: // if ((band < 0) || (band >= bandCount))
106: // {
107: // throw new IllegalArgumentException("band must be in range 0.." + (bandCount - 1));
108: // }
109: }
110: }