| HDF5 High Level APIs |
The HDF5 Image API defines a standard storage for HDF5 datasets that are indented to be interpreted as images. The specification for this API is presented in another document: HDF5 Image and Palette Specification. This version of the API is primarily concerned with two dimensional raster data similar to HDF4 Raster Images. The HDF5 image API uses the Lite HDF5 API.
The following functions are part of the HDF5 Image API version 1.0.
The C Interfaces:
| Image functions
|
Palette functions |
The FORTRAN90 Interfaces:
(ONLY available in HDF5-1.7 snapshots)
In general, each FORTRAN90 subroutine performs exactly the same task
as the corresponding C function.
| Image functions
|
Palette functions |
H5IMmake_image_8bit creates and writes a dataset named dset_name attached to
the file or group specified by the identifier loc_id.
Attributes conforming to the HDF5 Image and Palette specification for an
indexed image are attached
to the dataset, thus identifying it as an image. The image data is of the
type H5T_NATIVE_UCHAR. An indexed image is an image in which each each pixel
information storage is an index to a table palette. loc_id dset_name buffersubroutine h5immake_image_8bit_f(loc_id,dset_name,width,height,buf,errcode)implicit none integer(HID_T), intent(IN) :: loc_id ! file or group identifier character(LEN=*), intent(IN) :: dset_name ! name of the dataset integer(HSIZE_T), intent(IN) :: width ! width of image integer(HSIZE_T), intent(IN) :: height ! height of image integer*1, intent(IN), dimension(*) :: buf ! 1 byte integer data buffer integer :: errcode ! error codeend subroutine h5immake_image_8bit_f
H5Lmake_image_24bit creates and writes a dataset named dset_name attached to
the file or group specified by the identifier loc_id. This
function defines a true color image conforming to the HDF5 Image and Palette
specification. The function assumes that the image data is of the type H5T_NATIVE_UCHAR.
loc_id dset_name interlacebuffersubroutine h5immake_image_24bit_f(loc_id,dset_name,width,height,il,buf,errcode)implicit none integer(HID_T), intent(IN) :: loc_id ! file or group identifier character(LEN=*), intent(IN) :: dset_name ! name of the dataset integer(HSIZE_T), intent(IN) :: width ! width of image integer(HSIZE_T), intent(IN) :: height ! height of image character(LEN=*), intent(IN) :: il ! interlace integer*1, intent(IN), dimension(*) :: buf ! 1 byte integer data buffer integer :: errcode ! error code end subroutine h5immake_image_24bit_f
H5IMget_image_info gets information about an image named dset_name attached to
the file or group specified by the identifier loc_id. . loc_id dset_name width height planes interlace npals subroutine h5imget_image_info_f(loc_id,dset_name,width,height,planes,interlace,npals,errcode)implicit none integer(HID_T), intent(IN) :: loc_id ! file or group identifier character(LEN=*), intent(IN) :: dset_name ! name of the dataset integer(HSIZE_T), intent(INOUT) :: width ! width of image integer(HSIZE_T), intent(INOUT) :: height ! height of image integer(HSIZE_T), intent(INOUT) :: planes ! color planes integer(HSIZE_T), intent(INOUT) :: npals ! palettes character(LEN=*), intent(INOUT) :: interlace ! interlace integer :: errcode ! error code end subroutine h5imget_image_info_f
H5IMread_image reads a dataset named dset_name attached to
the file or group specified by the identifier loc_id. loc_id dset_name buffersubroutine h5imread_image_f(loc_id,dset_name,buf,errcode)implicit none integer(HID_T), intent(IN) :: loc_id ! file or group identifier character(LEN=*), intent(IN) :: dset_name ! name of the dataset integer*1, intent(INOUT), dimension(*) :: buf ! 1 byte integer data buffer integer :: errcode ! error codeend subroutine h5imread_image_f
H5IMis_image inquires if a dataset named dset_name,
attached to
the file or group specified by the identifier loc_id, is an image
based on the HDF5 Image and Palette Specification. loc_id dset_name integer function h5imis_image_f(loc_id,dset_name)implicit none integer(HID_T), intent(IN) :: loc_id ! file or group identifier character(LEN=*), intent(IN) :: dset_name ! name of the dataset integer :: errcode ! error codeend function h5imis_image_f
H5IMmake_palette creates and writes a dataset named pal_name. Attributes conforming to the HDF5 Image and Palette specification are attached
to the dataset, thus identifying it as a palette. The
palette data is of the type H5T_NATIVE_UCHAR. loc_id pal_name pal_dims pal_datasubroutine h5immake_palette_f(loc_id,dset_name,pal_dims,buf,errcode)implicit none integer(HID_T), intent(IN) :: loc_id ! file or group identifier character(LEN=*), intent(IN) :: dset_name ! name of the dataset integer(HSIZE_T), intent(IN), dimension(*) :: pal_dims ! dimensions integer*1, intent(IN), dimension(*) :: buf ! 1 byte integer data buffer integer :: errcode ! error code end subroutine h5immake_palette_f
H5IMlink_palette attaches a palette named pal_name
to an image specified by image_name.
The image dataset may or not already have an attached palette. If it has, the array of
palette references is extended to hold the reference to the new palette. loc_id image_name pal_name subroutine h5imlink_palette_f(loc_id,dset_name,pal_name,errcode)implicit none integer(HID_T), intent(IN) :: loc_id ! file or group identifier character(LEN=*), intent(IN) :: dset_name ! name of the dataset character(LEN=*), intent(IN) :: pal_name ! palette name integer :: errcode ! error code end subroutine h5imlink_palette_f
H5IMunlink_palette dettaches a palette from an image specified by image_name. loc_id image_name pal_name subroutine h5imunlink_palette_f(loc_id,dset_name,pal_name,errcode)implicit none integer(HID_T), intent(IN) :: loc_id ! file or group identifier character(LEN=*), intent(IN) :: dset_name ! name of the dataset character(LEN=*), intent(IN) :: pal_name ! palette name integer :: errcode ! error codeend subroutine h5imunlink_palette_f
H5IMget_npalettes gets the number of palettes associated to an image specified by image_name. loc_id image_name npals subroutine h5imget_npalettes_f(loc_id,dset_name,npals,errcode)implicit none integer(HID_T), intent(IN) :: loc_id ! file or group identifier character(LEN=*), intent(IN) :: dset_name ! name of the dataset integer(HSIZE_T), intent(INOUT) :: npals ! palettes integer :: errcode ! error codeend subroutine h5imget_npalettes_f
H5IMget_palette_info gets the dimensions of the palette
dataset identified by pal_number (a zero based index)
associated to an image specified by image_name. loc_id image_name pal_number pal_dims subroutine h5imget_palette_info_f(loc_id,dset_name,pal_number,dims,errcode)implicit none integer(HID_T), intent(IN) :: loc_id ! file or group identifier character(LEN=*), intent(IN) :: dset_name ! name of the dataset integer, intent(IN) :: pal_number ! palette number integer(HSIZE_T), dimension(*), intent(INOUT) :: dims ! dimensions integer :: errcode ! error codeend subroutine h5imget_palette_info_f
H5IMget_palette gets the palette dataset identified by pal_number
(a zero based index) associated to an image specified by image_name. loc_id image_name pal_number pal_data subroutine h5imget_palette_f(loc_id,dset_name,pal_number,buf,errcode)implicit none integer(HID_T), intent(IN) :: loc_id ! file or group identifier character(LEN=*), intent(IN) :: dset_name ! name of the dataset integer, intent(IN) :: pal_number ! palette number integer*1, intent(INOUT), dimension(*) :: buf ! 1 byte integer data buffer integer :: errcode ! error codeend subroutine h5imget_palette_f
H5IMis_palette inquires if a dataset named dset_name, attached to
the file or group specified by the identifier loc_id, is a
palette based on the HDF5 Image and Palette Specification. loc_id dset_name integer function h5imis_palette_f(loc_id,dset_name)implicit none integer(HID_T), intent(IN) :: loc_id ! file or group identifier character(LEN=*), intent(IN) :: dset_name ! name of the dataset integer :: errcode ! error codeend function h5imis_palette_f