Package ome.formats.model
Class ColorsFactory
- java.lang.Object
-
- ome.formats.model.ColorsFactory
-
public class ColorsFactory extends java.lang.Object
Utility class to determine the color usually associated to a specified channel depending on its emission wavelength. Ported from the server side omeis.providers.re.ColorsFactory.
-
-
Field Summary
Fields Modifier and Type Field Description static int
ALPHA_INDEX
Index of the red component of a color.static int
BLUE_INDEX
Index of the red component of a color.static int
GREEN_INDEX
Index of the red component of a color.static int
RED_INDEX
Index of the red component of a color.
-
Constructor Summary
Constructors Constructor Description ColorsFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int[]
determineColor(Length value)
Determines the color corresponding to the passed value.static int[]
getColor(ChannelData channelData)
Determines the color usually associated to the specified wavelength or explicitly defined for a particular channel.static boolean
hasEmissionData(ChannelData channelData)
Returnstrue
if the channel has emission metadata,false
otherwise.static int[]
newBlueColor()
Creates a new Blue Color object.static int[]
newGreenColor()
Creates a new Green Color object.static int[]
newGreyColor()
Creates a new Grey Color object.static int[]
newRedColor()
Creates a new Red Color object.static int[]
newWhiteColor()
Creates a new White Color object.
-
-
-
Field Detail
-
RED_INDEX
public static final int RED_INDEX
Index of the red component of a color.- See Also:
- Constant Field Values
-
GREEN_INDEX
public static final int GREEN_INDEX
Index of the red component of a color.- See Also:
- Constant Field Values
-
BLUE_INDEX
public static final int BLUE_INDEX
Index of the red component of a color.- See Also:
- Constant Field Values
-
ALPHA_INDEX
public static final int ALPHA_INDEX
Index of the red component of a color.- See Also:
- Constant Field Values
-
-
Method Detail
-
getColor
public static int[] getColor(ChannelData channelData)
Determines the color usually associated to the specified wavelength or explicitly defined for a particular channel.- Parameters:
channelData
- Channel data to use to determine a color for.
-
determineColor
public static int[] determineColor(Length value)
Determines the color corresponding to the passed value.- Parameters:
value
- The value to handle.
-
hasEmissionData
public static boolean hasEmissionData(ChannelData channelData)
Returnstrue
if the channel has emission metadata,false
otherwise.- Parameters:
channelData
- Channel data to use to determine a color for.- Returns:
- See above.
-
newRedColor
public static int[] newRedColor()
Creates a new Red Color object.- Returns:
- An RGBA array representation of the color Red.
-
newGreenColor
public static int[] newGreenColor()
Creates a new Green Color object.- Returns:
- An RGBA array representation of the color Green.
-
newBlueColor
public static int[] newBlueColor()
Creates a new Blue Color object.- Returns:
- An RGBA array representation of the color Blue.
-
newGreyColor
public static int[] newGreyColor()
Creates a new Grey Color object.- Returns:
- An RGBA array representation of the color Blue.
-
newWhiteColor
public static int[] newWhiteColor()
Creates a new White Color object.- Returns:
- An RGBA array representation of the color Blue.
-
-