![]() |
|
|||
File indexing completed on 2025-06-20 08:49:46
0001 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 0002 * Copyright by The HDF Group. * 0003 * All rights reserved. * 0004 * * 0005 * This file is part of HDF5. The full HDF5 copyright notice, including * 0006 * terms governing use, modification, and redistribution, is contained in * 0007 * the COPYING file, which can be found at the root of the source code * 0008 * distribution tree, or in https://www.hdfgroup.org/licenses. * 0009 * If you do not have access to either file, you may request a copy from * 0010 * help@hdfgroup.org. * 0011 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 0012 0013 #ifndef H5IMpublic_H 0014 #define H5IMpublic_H 0015 0016 #ifdef __cplusplus 0017 extern "C" { 0018 #endif 0019 0020 /** \page H5IM_UG HDF5 High Level Images 0021 * @todo Under Construction 0022 */ 0023 0024 /**\defgroup H5IM HDF5 Images API (H5IM) 0025 * 0026 * <em>Creating and manipulating HDF5 datasets intended to be 0027 * interpreted as images (H5IM)</em> 0028 * 0029 * The specification for the Images API is presented in another 0030 * document: \ref IMG 0031 * This version of the API is primarily concerned with two dimensional raster 0032 * data similar to HDF4 Raster Images. 0033 * The HDF5 Images API uses the \ref H5LT. 0034 * 0035 * \note \Bold{Programming hints:} 0036 * \note To use any of these functions or subroutines, 0037 * you must first include the relevant include file (C) or 0038 * module (Fortran) in your application. 0039 * \note The following line includes the HDF5 Images package, H5IM, 0040 * in C applications: 0041 * \code #include "hdf5_hl.h" \endcode 0042 * \note This line includes the H5IM module in Fortran applications: 0043 * \code use h5im \endcode 0044 * 0045 * - \ref H5IMget_image_info 0046 * \n Gets information about an image dataset (dimensions, 0047 * interlace mode and number of associated palettes). 0048 * - \ref H5IMget_npalettes 0049 * \n Gets the number of palettes associated to an image. 0050 * - \ref H5IMget_palette 0051 * \n Gets the palette dataset. 0052 * - \ref H5IMget_palette_info 0053 * \n Gets information about a palette dataset (dimensions). 0054 * - \ref H5IMis_image 0055 * \n Inquires if a dataset is an image 0056 * - \ref H5IMis_palette 0057 * \n Inquires if a dataset is a palette. 0058 * - \ref H5IMlink_palette 0059 * \n Attaches a palette to an image. 0060 * - \ref H5IMmake_image_8bit 0061 * \n Creates and writes an image. 0062 * - \ref H5IMmake_image_24bit 0063 * \n Creates and writes a true color image. 0064 * - \ref H5IMmake_palette 0065 * \n Creates and writes a palette. 0066 * - \ref H5IMread_image 0067 * \n Reads image data from disk. 0068 * - \ref H5IMunlink_palette 0069 * \n Detaches a palette from an image. 0070 * 0071 */ 0072 0073 /** 0074 * -------------------------------------------------------------------------- 0075 * \ingroup H5IM 0076 * 0077 * \brief Creates and writes an image. 0078 * 0079 * \fg_loc_id 0080 * \param[in] dset_name The name of the dataset to create 0081 * \param[in] width The width of the image 0082 * \param[in] height The height of the image 0083 * \param[in] buffer Buffer with data to be written to the dataset 0084 * 0085 * \return \herr_t 0086 * 0087 * \details H5IMmake_image_8bit() creates and writes a dataset named 0088 * \p dset_name attached to the file or group specified by the 0089 * identifier \p loc_id. Attributes conforming to the HDF5 Image 0090 * and Palette specification for an indexed image are attached to 0091 * the dataset, thus identifying it as an image. The image data is 0092 * of the type #H5T_NATIVE_UCHAR. An indexed image is an image in 0093 * which each each pixel information storage is an index to a 0094 * table palette. 0095 * 0096 */ 0097 H5_HLDLL herr_t H5IMmake_image_8bit(hid_t loc_id, const char *dset_name, hsize_t width, hsize_t height, 0098 const unsigned char *buffer); 0099 0100 /** 0101 * -------------------------------------------------------------------------- 0102 * \ingroup H5IM 0103 * 0104 * \brief Creates and writes a true color image. 0105 * 0106 * \fg_loc_id 0107 * \param[in] dset_name The name of the dataset to create 0108 * \param[in] width The width of the image 0109 * \param[in] height The height of the image 0110 * \param[in] interlace String defining the interlace mode 0111 * \param[in] buffer Buffer with data to be written to the dataset 0112 * 0113 * \return \herr_t 0114 * 0115 * \details H5IMmake_image_24bit() creates and writes a dataset named 0116 * \p dset_name attached to the file or group specified by the 0117 * identifier \p loc_id. This function defines a true color image 0118 * conforming to the HDF5 Image and Palette specification. 0119 * The function assumes that the image data is of the type 0120 * #H5T_NATIVE_UCHAR. 0121 * 0122 * A true color image is an image where the pixel storage contains 0123 * several color planes. In a 24 bit RGB color model, these planes 0124 * are red, green and blue. In a true color image the stream of bytes 0125 * can be stored in several different ways, thus defining the 0126 * interlace (or interleaving) mode. The 2 most used types of interlace mode 0127 * are interlace by pixel and interlace by plane. In the 24 bit RGB color 0128 * model example, interlace by plane means all the red components for the 0129 * entire dataset are stored first, followed by all the green components, 0130 * and then by all the blue components. Interlace by pixel in this example 0131 * means that for each pixel the sequence red, green, blue is defined. 0132 * In this function, the interlace mode is defined in the parameter 0133 * \p interlace, a string that can have the values INTERLACE_PIXEL 0134 * or INTERLACE_PLANE. 0135 * 0136 */ 0137 H5_HLDLL herr_t H5IMmake_image_24bit(hid_t loc_id, const char *dset_name, hsize_t width, hsize_t height, 0138 const char *interlace, const unsigned char *buffer); 0139 0140 /** 0141 *------------------------------------------------------------------------- 0142 * \ingroup H5IM 0143 * 0144 * \brief Gets information about an image dataset 0145 * (dimensions, interlace mode and number of associated palettes). 0146 * 0147 * \fg_loc_id 0148 * \param[in] dset_name The name of the dataset 0149 * \param[out] width The width of the image 0150 * \param[out] height The height of the image 0151 * \param[out] planes The number of color planes of the image 0152 * \param[out] interlace The interlace mode of the image 0153 * \param[out] npals The number of palettes associated to the image 0154 * 0155 * \return \herr_t 0156 * 0157 * \details H5IMget_image_info() gets information about an image 0158 * named \p dset_name attached to the file or group specified 0159 * by the identifier \p loc_id. 0160 * 0161 */ 0162 H5_HLDLL herr_t H5IMget_image_info(hid_t loc_id, const char *dset_name, hsize_t *width, hsize_t *height, 0163 hsize_t *planes, char *interlace, hssize_t *npals); 0164 0165 /** 0166 * -------------------------------------------------------------------------- 0167 * \ingroup H5IM 0168 * 0169 * \brief Reads image data from disk. 0170 * 0171 * \fg_loc_id 0172 * \param[in] dset_name The name of the dataset to create 0173 * \param[out] buffer Buffer with data to store the image 0174 * 0175 * \return \herr_t 0176 * 0177 * \details H5IMread_image() reads a dataset named \p dset_name 0178 * attached to the file or group specified by the 0179 * identifier \p loc_id. 0180 * 0181 */ 0182 H5_HLDLL herr_t H5IMread_image(hid_t loc_id, const char *dset_name, unsigned char *buffer); 0183 0184 /** 0185 * -------------------------------------------------------------------------- 0186 * \ingroup H5IM 0187 * 0188 * \brief Creates and writes a palette. 0189 * 0190 * \fg_loc_id 0191 * \param[in] pal_name The name of the palette 0192 * \param[in] pal_dims An array of the size of the palette dimensions 0193 * \param[in] pal_data Buffer with data to be written to the dataset 0194 * 0195 * \return \herr_t 0196 * 0197 * \details H5IMmake_palette() creates and writes a dataset 0198 * named \p pal_name. Attributes conforming to the HDF5 Image and 0199 * Palette specification are attached to the dataset, thus 0200 * identifying it as a palette. The palette data is of the 0201 * type #H5T_NATIVE_UCHAR. 0202 * 0203 */ 0204 H5_HLDLL herr_t H5IMmake_palette(hid_t loc_id, const char *pal_name, const hsize_t *pal_dims, 0205 const unsigned char *pal_data); 0206 0207 /** 0208 * -------------------------------------------------------------------------- 0209 * \ingroup H5IM 0210 * 0211 * \brief Attaches a palette to an image. 0212 * 0213 * \fg_loc_id 0214 * \param[in] image_name The name of the dataset to attach the palette to 0215 * \param[in] pal_name The name of the palette 0216 * 0217 * \return \herr_t 0218 * 0219 * \details H5IMlink_palette() attaches a palette named \p pal_name 0220 * to an image specified by \p image_name. The image dataset 0221 * may or not already have an attached palette. If it has, 0222 * the array of palette references is extended to hold the reference 0223 * to the new palette. 0224 * 0225 */ 0226 H5_HLDLL herr_t H5IMlink_palette(hid_t loc_id, const char *image_name, const char *pal_name); 0227 0228 /** 0229 * -------------------------------------------------------------------------- 0230 * \ingroup H5IM 0231 * 0232 * \brief Detaches a palette from an image. 0233 * 0234 * \fg_loc_id 0235 * \param[in] image_name The name of the image dataset 0236 * \param[in] pal_name The name of the palette 0237 * 0238 * \return \herr_t 0239 * 0240 * \details H5IMunlink_palette() detaches a palette from an image 0241 * specified by \p image_name. 0242 * 0243 */ 0244 H5_HLDLL herr_t H5IMunlink_palette(hid_t loc_id, const char *image_name, const char *pal_name); 0245 0246 /** 0247 * -------------------------------------------------------------------------- 0248 * \ingroup H5IM 0249 * 0250 * \brief Gets the number of palettes associated to an image. 0251 * 0252 * \fg_loc_id 0253 * \param[in] image_name The name of the image dataset 0254 * \param[out] npals The number of palettes 0255 * 0256 * \return \herr_t 0257 * 0258 * \details H5IMget_npalettes() gets the number of palettes associated to 0259 * an image specified by \p image_name. 0260 * 0261 */ 0262 H5_HLDLL herr_t H5IMget_npalettes(hid_t loc_id, const char *image_name, hssize_t *npals); 0263 0264 /** 0265 * -------------------------------------------------------------------------- 0266 * \ingroup H5IM 0267 * 0268 * \brief Gets information about a palette dataset (dimensions). 0269 * 0270 * \fg_loc_id 0271 * \param[in] image_name The name of the image dataset 0272 * \param[in] pal_number The zero based index that identifies 0273 * the palette 0274 * \param[out] pal_dims The dimensions of the palette dataset 0275 * 0276 * \return \herr_t 0277 * 0278 * \details H5IMget_palette_info() gets the dimensions of the palette 0279 * dataset identified by \p pal_number (a zero based index) 0280 * associated to an image specified by \p image_name. 0281 * 0282 */ 0283 H5_HLDLL herr_t H5IMget_palette_info(hid_t loc_id, const char *image_name, int pal_number, hsize_t *pal_dims); 0284 0285 /** 0286 * -------------------------------------------------------------------------- 0287 * \ingroup H5IM 0288 * 0289 * \brief Gets the palette dataset. 0290 * 0291 * \fg_loc_id 0292 * \param[in] image_name The name of the image dataset 0293 * \param[in] pal_number The zero based index that identifies 0294 * the palette 0295 * \param[out] pal_data The palette dataset 0296 * 0297 * \return \herr_t 0298 * 0299 * \details H5IMget_palette() gets the palette dataset identified 0300 * by \p pal_number (a zero based index) associated to an 0301 * image specified by \p image_name. 0302 * 0303 */ 0304 H5_HLDLL herr_t H5IMget_palette(hid_t loc_id, const char *image_name, int pal_number, 0305 unsigned char *pal_data); 0306 0307 /** 0308 * -------------------------------------------------------------------------- 0309 * \ingroup H5IM 0310 * 0311 * \brief Inquires if a dataset is an image. 0312 * 0313 * \fg_loc_id 0314 * \param[in] dset_name The name of the dataset 0315 * 0316 * \return \htri_t 0317 * 0318 * \details H5IMis_image() inquires if a dataset named \p dset_name, 0319 * attached to the file or group specified by the identifier 0320 * \p loc_id, is an image based on the HDF5 Image and Palette 0321 * Specification. 0322 * 0323 */ 0324 H5_HLDLL herr_t H5IMis_image(hid_t loc_id, const char *dset_name); 0325 0326 /** 0327 * -------------------------------------------------------------------------- 0328 * \ingroup H5IM 0329 * 0330 * \brief Inquires if a dataset is a palette 0331 * 0332 * \fg_loc_id 0333 * \param[in] dset_name The name of the dataset 0334 * 0335 * \return \htri_t 0336 * 0337 * \details H5IMis_palette() inquires if a dataset named \p dset_name, 0338 * attached to the file or group specified by the 0339 * identifier \p loc_id, is a palette based on the HDF5 0340 * Image and Palette Specification. 0341 * 0342 */ 0343 H5_HLDLL herr_t H5IMis_palette(hid_t loc_id, const char *dset_name); 0344 0345 #ifdef __cplusplus 0346 } 0347 #endif 0348 0349 #endif
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |