public class PhotometricInterpreterFloat
extends org.apache.commons.imaging.formats.tiff.photometricinterpreters.PhotometricInterpreter
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:
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.
Constructor and Description |
---|
PhotometricInterpreterFloat(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(java.util.List<PaletteEntry> paletteEntries)
Constructs a photometric interpreter that will use the specified palette
to assign colors to floating-point values.
|
Modifier and Type | Method and Description |
---|---|
float |
getMaxFound()
Gets the maximum value found while rendering the image
|
int[] |
getMaxXY()
Gets the coordinates (x,y) at which the maximum value was identified
during processing
|
float |
getMeanFound()
Get the mean of the values found while processing
|
float |
getMinFound()
Gets the minimum value found while rendering the image
|
int[] |
getMinXY()
Gets the coordinates (x,y) at which the minimum value was identified
during processing
|
void |
interpretPixel(org.apache.commons.imaging.common.ImageBuilder imageBuilder,
int[] samples,
int x,
int y) |
int |
mapValueToARGB(float f)
Provides a method for mapping a pixel value to an integer (ARGB) value.
|
public PhotometricInterpreterFloat(float valueBlack, float valueWhite)
valueBlack
- the value associated with the dark side of the gray
scalevalueWhite
- the value associated with the light side of the gray
scalepublic PhotometricInterpreterFloat(java.util.List<PaletteEntry> paletteEntries)
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 in the use of single-value palette entries which may be used to override the specifications for ranges.
paletteEntries
- a valid, non-empty list of palette entriespublic void interpretPixel(org.apache.commons.imaging.common.ImageBuilder imageBuilder, int[] samples, int x, int y) throws ImageReadException, java.io.IOException
interpretPixel
in class org.apache.commons.imaging.formats.tiff.photometricinterpreters.PhotometricInterpreter
ImageReadException
java.io.IOException
public float getMinFound()
public int[] getMaxXY()
public float getMaxFound()
public int[] getMinXY()
public float getMeanFound()
public int mapValueToARGB(float f)
f
- the floating point value to be mapped to an ARGB valueCopyright © 2010 - 2023 Adobe. All Rights Reserved