net.sourceforge.jiu.color.data

Interface Histogram3D

Known Implementing Classes:
NaiveHistogram3D

public interface Histogram3D

An interface for classes that store three-dimensional histograms. Histograms count the occurrence of values, so a three-dimensional histogram has counters for three-dimensional values. The 3D histograms are used (as an example) to count the occurrence of each color in an RGB image.
Author:
Marco Schmidt
See Also:
Histogram1D

Method Summary

void
clear()
Sets all counters to zero.
int
getEntry(int index1, int index2, int index3)
Returns the counter value of (index1, index2, index3).
int
getMaxValue(int index)
Returns the maximum index value for one of the three indexes.
int
getNumUsedEntries()
Returns the number of used entries (those entries with a counter value larger than zero).
void
increaseEntry(int index1, int index2, int index3)
Increases the counter value of (index1, index2, index3) by one.
void
setEntry(int index1, int index2, int index3, int newValue)
Sets the counter value of (index1, index2, index3) to newValue.

Method Details

clear

public void clear()
Sets all counters to zero.

getEntry

public int getEntry(int index1,
                    int index2,
                    int index3)
Returns the counter value of (index1, index2, index3).
Parameters:
index1 - first of the three values forming the threedimensional index
index2 - second of the three values forming the threedimensional index
index3 - three of the three values forming the threedimensional index
Returns:
the counter value of the desired index

getMaxValue

public int getMaxValue(int index)
Returns the maximum index value for one of the three indexes.

getNumUsedEntries

public int getNumUsedEntries()
Returns the number of used entries (those entries with a counter value larger than zero).
Returns:
number of non-zero counter values

increaseEntry

public void increaseEntry(int index1,
                          int index2,
                          int index3)
Increases the counter value of (index1, index2, index3) by one. This method can be implemented by the one-liner setEntry(index1, index2, index3, getEntry(index1, index2, index3) + 1); However, implementations of this method may take advantage of implementation details to provide a more efficient approach.
Parameters:
index1 - first of the three values forming the threedimensional index
index2 - second of the three values forming the threedimensional index
index3 - three of the three values forming the threedimensional index

setEntry

public void setEntry(int index1,
                     int index2,
                     int index3,
                     int newValue)
Sets the counter value of (index1, index2, index3) to newValue.
Parameters:
index1 - first of the three values forming the threedimensional index
index2 - second of the three values forming the threedimensional index
index3 - three of the three values forming the threedimensional index
newValue - the counter value that is assigned to the argument index