public class DefaultImageView extends Object implements ImageView
A scalar dataset in HDF can be displayed in image or table. By default, an HDF4 GR image and HDF5 image is displayed as an image. Other scalar datasets are display in a two-dimensional table.
Users can also choose to display a scalar dataset as image. Currently verion of the ImageView only supports 8-bit raster image with indexed RGB color model of 256 colors or 24-bit true color raster image. Data of other type will be converted to 8-bit integer. The simple linear conversion is used for this purpose:
y = f * (x - min), where y = the value of 8-bit integer, x = the value of original data, f = 255/(max-min), conversion factor, max = the maximum of the original data, min = the minimum of the original data.
A default color table is provided for images without palette attached to it. Current choice of default palettes include Gray, Rainbow, Nature and Wave. For more infomation on palette, read HDF5 Image and Palette Specification
- Version:
- 2.4 2//2016
- Author:
- Jordan T. Henderson
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultImageView.FlipFilter
FlipFilter creates image filter to flip image horizontally or vertically.static class
DefaultImageView.Rotate90Filter
-
Field Summary
Fields Modifier and Type Field Description static int
FLIP_HORIZONTAL
Horizontal direction to flip an image.static int
FLIP_VERTICAL
Vertical direction to flip an image.static int
ROTATE_CCW_90
ROTATE IMAGE COUNTER CLOCKWISE 90 DEGREE.static int
ROTATE_CW_90
ROTATE IMAGE 90 DEGREE CLOCKWISE.Fields inherited from interface hdf.view.DataView.DataView
DATAVIEW_IMAGE, DATAVIEW_TABLE, DATAVIEW_UNKNOWN
-
Constructor Summary
Constructors Constructor Description DefaultImageView(DataViewManager theView)
Constructs an ImageView.DefaultImageView(DataViewManager theView, HashMap map)
Constructs an ImageView. -
Method Summary
Modifier and Type Method Description HObject
getDataObject()
Image
getImage()
byte[]
getImageByteData()
byte[][]
getPalette()
Rectangle
getSelectedArea()
returns the selected area of the imageObject
getSelectedData()
Returns the selected data values.boolean
isPlaneInterlace()
boolean
isTrueColor()
void
setImage(Image img)
Sets the imagevoid
setPalette(byte[][] pal)
Sets the image paletteMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
FLIP_HORIZONTAL
Horizontal direction to flip an image.- See Also:
- Constant Field Values
-
FLIP_VERTICAL
Vertical direction to flip an image.- See Also:
- Constant Field Values
-
ROTATE_CW_90
ROTATE IMAGE 90 DEGREE CLOCKWISE.- See Also:
- Constant Field Values
-
ROTATE_CCW_90
ROTATE IMAGE COUNTER CLOCKWISE 90 DEGREE.- See Also:
- Constant Field Values
-
-
Constructor Details
-
DefaultImageView
Constructs an ImageView.- Parameters:
theView
- the main HDFView.
-
DefaultImageView
Constructs an ImageView.- Parameters:
theView
- the main HDFView.map
- the properties on how to show the data. The map is used to allow applications to pass properties on how to display the data, such as, transposing data, showing data as character, applying bitmask, and etc. Predefined keys are listed at ViewProperties.DATA_VIEW_KEY.
-
-
Method Details
-
getImage
-
getDataObject
- Specified by:
getDataObject
in interfaceDataView
- Returns:
- the data object displayed in this data viewer
-
getImageByteData
- Specified by:
getImageByteData
in interfaceImageView
- Returns:
- the byte array of the image data
-
getSelectedData
Returns the selected data values.- Specified by:
getSelectedData
in interfaceImageView
- Returns:
- the selected data object.
-
getSelectedArea
returns the selected area of the image- Specified by:
getSelectedArea
in interfaceImageView
- Returns:
- the rectangle of the selected image area.
-
isTrueColor
- Specified by:
isTrueColor
in interfaceImageView
- Returns:
- true if the image is a truecolor image.
-
isPlaneInterlace
- Specified by:
isPlaneInterlace
in interfaceImageView
- Returns:
- true if the image interlace is plance interlace.
-
setImage
Description copied from interface:ImageView
Sets the image -
getPalette
- Specified by:
getPalette
in interfaceImageView
- Returns:
- the palette of the image
-
setPalette
Description copied from interface:ImageView
Sets the image palette- Specified by:
setPalette
in interfaceImageView
- Parameters:
pal
- the palette for the image to view
-