Purpose
|
Sets the fill mode for the specified file.
|
Return value
|
Returns the previous fill mode if successful and FAIL (or -1) otherwise.
|
Description
|
SDsetfillmode sets the fill mode to be applied to all SDSs contained in the specified file.
|
|
When the specified file is first opened, or when the file is closed then re-opened, its fill mode will be the default SD_FILL mode, which indicates that fill values will be written when the SDS is created.
|
|
Possible values for fill_mode are: SD_FILL (or 0) or SD_NOFILL (or 256), defined in "hdf.inc". SD_NOFILL indicates that fill values will not be written.
|
|
When an SDS without unlimited dimensions is created, by default the first SDwritedata call will fill the entire dataset with the user-defined fill value, or the default fill value if there is no user-defined fill value, during the call to SDsetfillvalue. In SDSs with an unlimited dimension defined as the slowest-changing dimension, if a new write operation takes place along the unlimited dimension beyond the last location of the previous write operation, the array locations between these written areas will be initialized to the user-defined fill value, or the default fill value if a user-defined fill value hasn't been specified.
|
|
If it is certain that all dataset values will be written before any read operation takes place, there is no need to write the fill values. Simply call SDsetfillmode with a fill_mode value of SD_NOFILL which will eliminate all fill value write operations to the dataset. For large datasets, this can improve the speed by almost 50%.
|