Class BufferedImageFromStack
Object
BufferedImageFromStack
Converts a
Stack
or similar data-objects into an AWT BufferedImage
.
Please see BufferedImageFromVoxels
to convert from a Voxels
instance.
- Author:
- Owen Feehan
-
Method Summary
Modifier and TypeMethodDescriptionstatic BufferedImage
Creates aBufferedImage
from aStack
.static BufferedImage
createRGB
(Voxels<UnsignedByteBuffer> red, Voxels<UnsignedByteBuffer> green, Voxels<UnsignedByteBuffer> blue, Extent extent) Creates aBufferedImage
from threeVoxels<UnsignedByteBuffer>
representing respectively, red, green, blue color components.
-
Method Details
-
create
Creates aBufferedImage
from aStack
.The following situations are supported with the
Stack
:- Three channels of type
UnsignedByteVoxelType
, representing the colors red, green, blue respectively. - A single-channel of type
UnsignedByteVoxelType
. - A single-channel of type
UnsignedShortVoxelType
.
- Parameters:
stack
- the stack.- Returns:
- a newly created
BufferedImage
. - Throws:
CreateException
- if the stack does not conform to a supported data-type or number of channels or if the stack is 3D which is unsupported.
- Three channels of type
-
createRGB
public static BufferedImage createRGB(Voxels<UnsignedByteBuffer> red, Voxels<UnsignedByteBuffer> green, Voxels<UnsignedByteBuffer> blue, Extent extent) throws CreateException Creates aBufferedImage
from threeVoxels<UnsignedByteBuffer>
representing respectively, red, green, blue color components.All three
Voxels
must be sized exactly asextent
.- Parameters:
red
- the voxels describing the red color component.green
- the voxels describing the green color component.blue
- the voxels describing the blue color component.extent
- the size of theBufferedImage
to create.- Returns:
- a newly created 8-bit
BufferedImage
that reuses the underlying array in the buffer ofvoxels
. - Throws:
CreateException
- if the stack does not conform to a supported data-type or number of channels or if the stack is 3D which is unsupported.
-