Class StackWriteAttributes
Object
StackWriteAttributes
Attributes describing stack which may determine which writer is used.
This class is immutable.
- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsConstructorDescriptionStackWriteAttributes(boolean always2D, boolean singleChannel, boolean threeChannels, StackRGBState rgb, boolean binary) Alternative constructor that assumes each channel is 8-bits. -
Method Summary
Modifier and TypeMethodDescriptionMark the attributes to indicate that channels are no longer guaranteed to be 8-bit.always2D(boolean binary) Derives aStackWriteAttributesthat will always be 2D, but is otherwise unchanged.and(StackWriteAttributes other) Combines with anotherStackWriteAttributesby performing a logical and on each field.getRgb()Whether it's an RGB or RGBA image when it has three/four channels respectively.booleanWhether the output is guaranteed to only ever 2D i.e. maximally one z-slice?booleanisBinary()Whether all channels represent a binary image.booleanWhether each channel is 8 bits.booleanThe number of channels is guaranteed to be 1 in the output.booleanThe number of channels is guaranteed to be 3 in the output.or(StackWriteAttributes other) Combines with anotherStackWriteAttributesby performing a logical or on each field.rgb(boolean plusAlpha) Derives aStackWriteAttributesthat will be RGB or RGB-A, but is otherwise unchanged.toString()A user-friendly description of the stack-type to include in error and warning messages.booleanwriteAsRGB(Stack stack) Whether to write a stack in RGB mode?
-
Constructor Details
-
StackWriteAttributes
public StackWriteAttributes(boolean always2D, boolean singleChannel, boolean threeChannels, StackRGBState rgb, boolean binary) Alternative constructor that assumes each channel is 8-bits.- Parameters:
always2D- whether the output is guaranteed to only ever 2D i.e. maximally one z-slice?singleChannel- the number of channels is guaranteed to be 1 in the output.threeChannels- the number of channels is guaranteed to be 3 in the output.rgb- whether it's an RGB or RGBA image when it has three/four channels respectively.binary- whether all channels represent a binary image.
-
-
Method Details
-
always2D
Derives aStackWriteAttributesthat will always be 2D, but is otherwise unchanged.- Parameters:
binary- whether all channels are binary (only two allowed states: the max intensity value and the minimum intensity value.)- Returns:
- a newly created
StackWriteAttributesderived from the existing object.
-
rgb
Derives aStackWriteAttributesthat will be RGB or RGB-A, but is otherwise unchanged.- Parameters:
plusAlpha- when true, RGBA is used. when false, RGB.- Returns:
- a newly created
StackWriteAttributesderived from the existing object.
-
and
Combines with anotherStackWriteAttributesby performing a logical and on each field.- Parameters:
other- the otherStackWriteAttributesto combine with.- Returns:
- a newly created
StackWriteAttributeswhere each field is the logical and of the two inputs
-
or
Combines with anotherStackWriteAttributesby performing a logical or on each field.- Parameters:
other- the otherStackWriteAttributesto combine with.- Returns:
- a newly created
StackWriteAttributeswhere each field is the logical or of the two inputs
-
writeAsRGB
Whether to write a stack in RGB mode?- Parameters:
stack- the stack to query whether it should be written in RGB mode.- Returns:
- true if the stack should be written as RGB, false otherwise.
-
allChannelsEightBit
Mark the attributes to indicate that channels are no longer guaranteed to be 8-bit.- Returns:
- a newly-created
StackWriteAttributesthat haseightBit=falsebut is otherwise duplicated.
-
toString
A user-friendly description of the stack-type to include in error and warning messages. -
isAlways2D
public boolean isAlways2D()Whether the output is guaranteed to only ever 2D i.e. maximally one z-slice? -
isSingleChannel
public boolean isSingleChannel()The number of channels is guaranteed to be 1 in the output. -
isThreeChannels
public boolean isThreeChannels()The number of channels is guaranteed to be 3 in the output. -
getRgb
Whether it's an RGB or RGBA image when it has three/four channels respectively.This flag should only be set when
alwaysOneOrThreChannelsis true.This flag is ignored, when the number of channels is not three.
-
isBinary
public boolean isBinary()Whether all channels represent a binary image.This implies each channel has only two allowed states: the max intensity value and the minimum intensity value.
-
isEightBitChannels
public boolean isEightBitChannels()Whether each channel is 8 bits.
-