|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.pearsoneduc.ip.op.Histogram
A class which calculates the histogram of a BufferedImage, together with associated statistics such as minimum and maximum values in all bands, mean value in all bands, etc.
BufferedImage
Constructor Summary | |
Histogram()
Default constructor. |
|
Histogram(java.awt.image.BufferedImage image)
Constructs the histogram of a BufferedImage. |
|
Histogram(java.io.Reader reader)
Constructs a histogram using a Reader as the data source. |
Method Summary | |
java.lang.Object |
clone()
Clones a histogram. |
void |
computeHistogram(java.awt.image.BufferedImage image)
Calculates histogram data for a BufferedImage. |
boolean |
equals(java.lang.Object obj)
Tests for equivalence of Histogram objects. |
int |
getCumulativeFrequency(int value)
Retrieves the frequency of occurrence of a grey level less than or equal to the specified value. |
int |
getCumulativeFrequency(int band,
int value)
Retrieves the frequency of occurrence of values less than or equal to the specified value in a given band. |
int |
getFrequency(int value)
Retrieves the frequency of occurrence of a specified grey level. |
int |
getFrequency(int band,
int value)
Retrieves the frequency of occurrence of a particular value in a given band. |
int |
getMaxFrequency()
Gives the largest frequency recorded in the histogram. |
int |
getMaxFrequency(int band)
Gives the largest frequency recorded in the histogram. |
int |
getMaxValue()
Gives maximum value for which counts have been recorded. |
int |
getMaxValue(int band)
Gives maximum value for which counts have been recorded in the specified band. |
double |
getMeanValue()
Gives mean value of a greyscale histogram. |
double |
getMeanValue(int band)
Gives mean value in one band of a colour histogram. |
int |
getMinFrequency()
Gives the smallest frequency recorded in the histogram. |
int |
getMinFrequency(int band)
Gives the smallest frequency recorded in the histogram. |
int |
getMinValue()
Gives minimum value for which counts have been recorded. |
int |
getMinValue(int band)
Gives minimum value for which counts have been recorded in the specified band. |
int |
getNumBands()
Gives number of histogram bands. |
int |
getNumSamples()
Gives number of samples taken from source image. |
void |
read(java.io.Reader source)
Reads histogram data from the specified source. |
boolean |
sourceIsGrey()
Indicates whether histogram was computed from a greyscale image or not. |
java.lang.String |
toString()
|
void |
write(java.io.Writer destination)
Writes histogram data to the specified destination. |
void |
writeCumulative(java.io.Writer destination)
Writes cumulative histogram data to the specified destination. |
Methods inherited from class java.lang.Object |
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public Histogram()
public Histogram(java.io.Reader reader) throws java.io.IOException
reader
- the Reader used to obtain histogram datapublic Histogram(java.awt.image.BufferedImage image) throws HistogramException
image
- the image for which a histogram is requiredMethod Detail |
public java.lang.Object clone()
public boolean equals(java.lang.Object obj)
public java.lang.String toString()
public void computeHistogram(java.awt.image.BufferedImage image) throws HistogramException
image
- BufferedImage for which a histogram is requiredpublic void read(java.io.Reader source) throws java.io.IOException
source
- Reader used to obtain histogram datapublic void write(java.io.Writer destination)
destination
- Writer used to output histogram datapublic void writeCumulative(java.io.Writer destination)
destination
- Writer used to output datapublic boolean sourceIsGrey()
public int getNumBands()
public int getNumSamples()
public int getFrequency(int value) throws HistogramException
value
- pixel value for which a frequency is requiredpublic int getFrequency(int band, int value)
band
- band for which a frequency is required (0, 1 or 2)value
- pixel value for which a frequency is requiredpublic int getCumulativeFrequency(int value) throws HistogramException
value
- pixel value for which a cumulative frequency is requiredpublic int getCumulativeFrequency(int band, int value)
band
- band for which a cumulative frequency is requiredvalue
- pixel value for which a cumulative frequency is requiredpublic int getMinFrequency() throws HistogramException
public int getMinFrequency(int band)
band
- band for which a minimum frequency is required (0, 1 or 2)public int getMaxFrequency() throws HistogramException
public int getMaxFrequency(int band)
band
- band from which maximum frequency is required (0, 1 or 2)public int getMinValue() throws HistogramException
public int getMinValue(int band)
band
- band for which a minimum value is required (0, 1 or 2)public int getMaxValue() throws HistogramException
public int getMaxValue(int band)
band
- the band for which maximum value is required (0, 1 or 2)public double getMeanValue() throws HistogramException
public double getMeanValue(int band)
band
- the band for which mean value is required (0, 1 or 2)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |