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 BufferedImageCreates aBufferedImagefrom aStack.static BufferedImagecreateRGB(Voxels<UnsignedByteBuffer> red, Voxels<UnsignedByteBuffer> green, Voxels<UnsignedByteBuffer> blue, Extent extent) Creates aBufferedImagefrom threeVoxels<UnsignedByteBuffer>representing respectively, red, green, blue color components.
-
Method Details
-
create
Creates aBufferedImagefrom 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 aBufferedImagefrom threeVoxels<UnsignedByteBuffer>representing respectively, red, green, blue color components.All three
Voxelsmust 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 theBufferedImageto create.- Returns:
- a newly created 8-bit
BufferedImagethat 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.
-