Package com.xinapse.image
Enum Class SubSampleType
- All Implemented Interfaces:
Serializable
,Comparable<SubSampleType>
,Constable
An enumeration of the types of sub-sampling to be used for resampling images.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionSub-sampling by averaging across nearest pixels.Sub-sampling by low-pass filtering and sinc interpolation.Sub-sampling by selecting the nearest neighbour. -
Method Summary
Modifier and TypeMethodDescriptionstatic SubSampleType
Returns theSubSampleType
corresponding to a String representation.static SubSampleType
getPreferredSubSampleType
(Preferences prefs, SubSampleType defaultType) Returns theSubSampleType
set in the preferences.static void
savePreferredSubSampleType
(Preferences prefs, SubSampleType subSampleType) Save aSubSampleType
to the preferences.toString()
Returns a String describing this sub sampling type.static SubSampleType
Returns the enum constant of this class with the specified name.static SubSampleType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NN
Sub-sampling by selecting the nearest neighbour. -
BY_AVERAGING
Sub-sampling by averaging across nearest pixels. -
LPF
Sub-sampling by low-pass filtering and sinc interpolation.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getInstance
Returns theSubSampleType
corresponding to a String representation.- Parameters:
s
- a String which has been obtained by a thetoString()
method. Case is ignored.- Returns:
- the
SubSampleType
corresponding to a String representation. - Throws:
InvalidArgumentException
- if the String is invalid.
-
getPreferredSubSampleType
Returns theSubSampleType
set in the preferences.- Parameters:
prefs
- thePreferences
in which to look.defaultType
- the defaultSubSampleType
to return if not set in the Preferences.- Returns:
- the
SubSampleType
set in the preferences, or the default.
-
savePreferredSubSampleType
Save aSubSampleType
to the preferences.- Parameters:
prefs
- thePreferences
in which to save the type.subSampleType
- the type to save in the Preferences.
-
toString
Returns a String describing this sub sampling type.- Overrides:
toString
in classEnum<SubSampleType>
- Returns:
- a String describing this sub sampling type.
-