Class PhotometricInterpreterFloat
This class allows an Apache Commons implementation to construct and specify a custom photometric interpreter when reading from a TIFF file. Applications may supply their own palette that maps real-valued data to specified colors.
This class provides two constructors:
- A simple constructor to support gray scales
- A constructor to support a color palette (with potential interpolation)
To use this class, an application must access the TIFF file using the low-level, TIFF-specific API provided by the Apache Commons Imaging library.
- 
Field SummaryFields inherited from class org.apache.commons.imaging.formats.tiff.photometricinterpreters.AbstractPhotometricInterpreterheight, predictor, samplesPerPixel, width
- 
Constructor SummaryConstructorsConstructorDescriptionPhotometricInterpreterFloat(float valueBlack, float valueWhite) Constructs a photometric interpreter that will produce a gray scale linearly distributed across the RGB color space for values in the range valueBlack to valueWhite.PhotometricInterpreterFloat(List<PaletteEntry> paletteEntries) Constructs a photometric interpreter that will use the specified palette to assign colors to floating-point values.
- 
Method SummaryModifier and TypeMethodDescriptionfloatGets the maximum value found while rendering the imageint[]getMaxXY()Gets the coordinates (x,y) at which the maximum value was identified during processingfloatGets the mean of the values found while processingfloatGets the minimum value found while rendering the imageint[]getMinXY()Gets the coordinates (x,y) at which the minimum value was identified during processingvoidinterpretPixel(ImageBuilder imageBuilder, int[] samples, int x, int y) intmapValueToArgb(float f) Provides a method for mapping a pixel value to an integer (ARGB) value.Methods inherited from class org.apache.commons.imaging.formats.tiff.photometricinterpreters.AbstractPhotometricInterpretergetBitsPerSample
- 
Constructor Details- 
PhotometricInterpreterFloatConstructs a photometric interpreter that will produce a gray scale linearly distributed across the RGB color space for values in the range valueBlack to valueWhite. Note that the two values may be given in either ascending order or descending order, but they must not be equal. Infinite values will not result in proper numerical computations.- Parameters:
- valueBlack- the value associated with the dark side of the gray scale
- valueWhite- the value associated with the light side of the gray scale
 
- 
PhotometricInterpreterFloatConstructs a photometric interpreter that will use the specified palette to assign colors to floating-point values.Although there is no prohibition against using palette entries with overlapping ranges, the behavior of such specifications is undefined and subject to change in the future. Therefore, it is not recommended. The exception in the use of single-value palette entries which may be used to override the specifications for ranges. - Parameters:
- paletteEntries- a valid, non-empty list of palette entries
 
 
- 
- 
Method Details- 
getMaxFoundGets the maximum value found while rendering the image- Returns:
- if data was processed, a valid value; otherwise, Negative Infinity
 
- 
getMaxXYGets the coordinates (x,y) at which the maximum value was identified during processing- Returns:
- a valid array of length 2.
 
- 
getMeanFoundGets the mean of the values found while processing- Returns:
- if data was processed, a valid mean value; otherwise, a zero.
 
- 
getMinFoundGets the minimum value found while rendering the image- Returns:
- if data was processed, a valid value; otherwise, Positive Infinity
 
- 
getMinXYGets the coordinates (x,y) at which the minimum value was identified during processing- Returns:
- a valid array of length 2.
 
- 
interpretPixelpublic void interpretPixel(ImageBuilder imageBuilder, int[] samples, int x, int y) throws ImagingException, IOException - Specified by:
- interpretPixelin class- AbstractPhotometricInterpreter
- Throws:
- ImagingException
- IOException
 
- 
mapValueToArgbProvides a method for mapping a pixel value to an integer (ARGB) value. This method is not defined for the standard photometric interpreters and is provided as a convenience to applications that are processing data outside the standard TIFF image-reading modules.- Parameters:
- f- the floating point value to be mapped to an ARGB value
- Returns:
- a valid ARGB value, or zero if no palette specification covers the input value.
 
 
-