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 classDefaultImageView.FlipFilterFlipFilter creates image filter to flip image horizontally or vertically.static classDefaultImageView.Rotate90Filter -
Field Summary
Fields Modifier and Type Field Description static intFLIP_HORIZONTALHorizontal direction to flip an image.static intFLIP_VERTICALVertical direction to flip an image.static intROTATE_CCW_90ROTATE IMAGE COUNTER CLOCKWISE 90 DEGREE.static intROTATE_CW_90ROTATE 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 HObjectgetDataObject()ImagegetImage()byte[]getImageByteData()byte[][]getPalette()RectanglegetSelectedArea()returns the selected area of the imageObjectgetSelectedData()Returns the selected data values.booleanisPlaneInterlace()booleanisTrueColor()voidsetImage(Image img)Sets the imagevoidsetPalette(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:
getDataObjectin interfaceDataView- Returns:
- the data object displayed in this data viewer
-
getImageByteData
- Specified by:
getImageByteDatain interfaceImageView- Returns:
- the byte array of the image data
-
getSelectedData
Returns the selected data values.- Specified by:
getSelectedDatain interfaceImageView- Returns:
- the selected data object.
-
getSelectedArea
returns the selected area of the image- Specified by:
getSelectedAreain interfaceImageView- Returns:
- the rectangle of the selected image area.
-
isTrueColor
- Specified by:
isTrueColorin interfaceImageView- Returns:
- true if the image is a truecolor image.
-
isPlaneInterlace
- Specified by:
isPlaneInterlacein interfaceImageView- Returns:
- true if the image interlace is plance interlace.
-
setImage
Description copied from interface:ImageViewSets the image -
getPalette
- Specified by:
getPalettein interfaceImageView- Returns:
- the palette of the image
-
setPalette
Description copied from interface:ImageViewSets the image palette- Specified by:
setPalettein interfaceImageView- Parameters:
pal- the palette for the image to view
-