public class GreyscaleColorSpace extends Object implements ColorSpace
ColorSpace
that indicates that no color space information is set.
To be used in ImageTypeInfo
Modifier and Type | Field and Description |
---|---|
static GreyscaleColorSpace |
INSTANCE |
Constructor and Description |
---|
GreyscaleColorSpace() |
Modifier and Type | Method and Description |
---|---|
int |
composePixel(int... channelValues)
Converts an array of channel values into a pixel
|
void |
convert(ij.ImagePlus img,
ColorSpace imgSpace,
JIPipeProgressInfo progressInfo)
Converts the image into the current color space
|
int |
convert(int pixel,
ColorSpace imgSpace)
Converts a single pixel from its source image space into this one
|
void |
convertToRGB(ij.ImagePlus img,
JIPipeProgressInfo progressInfo)
Converts the color image into RGB (in-place)
|
int |
convertToRGB(int pixel)
Converts a single pixel from its source image space into RGB
|
void |
decomposePixel(int pixel,
int[] channelValues)
Decomposes an integer pixel value into its channel values
|
String |
getChannelName(int channelIndex)
Returns the channel name for a given channel index
|
String |
getChannelShortName(int channelIndex)
Returns the channel name for a given channel index
|
int |
getNChannels()
Returns the number of pixel channels.
|
String |
toString() |
public static final GreyscaleColorSpace INSTANCE
public void convertToRGB(ij.ImagePlus img, JIPipeProgressInfo progressInfo)
ColorSpace
convertToRGB
in interface ColorSpace
img
- the imageprogressInfo
- the progress infopublic void convert(ij.ImagePlus img, ColorSpace imgSpace, JIPipeProgressInfo progressInfo)
ColorSpace
convert
in interface ColorSpace
img
- the imageimgSpace
- the color space of the imageprogressInfo
- the progresspublic int convert(int pixel, ColorSpace imgSpace)
ColorSpace
convert
in interface ColorSpace
pixel
- the pixel (24 bit)imgSpace
- the pixel image spacepublic int convertToRGB(int pixel)
ColorSpace
convertToRGB
in interface ColorSpace
pixel
- the pixel (24 bit)public int getNChannels()
ColorSpace
getNChannels
in interface ColorSpace
public String getChannelName(int channelIndex)
ColorSpace
getChannelName
in interface ColorSpace
channelIndex
- the channel indexpublic String getChannelShortName(int channelIndex)
ColorSpace
getChannelShortName
in interface ColorSpace
channelIndex
- the channel indexpublic int composePixel(int... channelValues)
ColorSpace
composePixel
in interface ColorSpace
channelValues
- the channel values. must have at least getNChannels() itemspublic void decomposePixel(int pixel, int[] channelValues)
ColorSpace
decomposePixel
in interface ColorSpace
pixel
- the pixelchannelValues
- array with at least getNChannels() items. The values will be written into this array.Copyright © 2020–2024 Leibniz Institute for Natural Product Research and Infection Biology - Hans Knöll Institute (HKI). All rights reserved.