Package org.carrot2.util
Class ColorQuantizer.ColorReductionInfo
java.lang.Object
org.carrot2.util.ColorQuantizer.ColorReductionInfo
- Enclosing class:
ColorQuantizer
Indicates how many distinct colors an image has, whether it has partial transparency (alpha channel).
-
Field Summary
FieldsModifier and TypeFieldDescriptionint
Number of distinct colors in the image.boolean
True if the image has partially transparent areas (alpha channel). -
Constructor Summary
ConstructorsConstructorDescriptionColorReductionInfo
(boolean hasPartialTransparency, int distinctColors) Instantiates a new color reduction info. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if the image can be saved in a 8-bit indexed color format with 1-bit transparency without quality loss.
-
Field Details
-
distinctColors
public int distinctColorsNumber of distinct colors in the image. -
hasPartialTransparency
public boolean hasPartialTransparencyTrue if the image has partially transparent areas (alpha channel).
-
-
Constructor Details
-
ColorReductionInfo
public ColorReductionInfo(boolean hasPartialTransparency, int distinctColors) Instantiates a new color reduction info.- Parameters:
hasPartialTransparency
- the has partial transparencydistinctColors
- the distinct colors
-
-
Method Details
-
canReduceWithoutQualityLoss
public boolean canReduceWithoutQualityLoss()Returns true if the image can be saved in a 8-bit indexed color format with 1-bit transparency without quality loss.- Returns:
- true, if successful
-