mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-01-18 15:15:56 +08:00
[svn-r6577] Purpose:
Code cleanup (sorta) Description: The H5Pset_szip API call was forcing users to pass in their parameters in the same way as the internal representation of the filter parameters used by the library (as an array of unsigned values). Solution: Changed to pass in separate parameters in a more user-friendly format. Platforms tested: FreeBSD 4.8 (sleipnir) IRIX64 6.5 (modi4) w/parallel Misc. update:
This commit is contained in:
parent
a3a391d457
commit
db8ff96dc0
@ -760,34 +760,39 @@ done:
|
|||||||
*
|
*
|
||||||
* Return: Non-negative on success/Negative on failure
|
* Return: Non-negative on success/Negative on failure
|
||||||
*
|
*
|
||||||
* Programmer: Robb Matzke
|
* Programmer: Kent Yang
|
||||||
* Wednesday, April 15, 1998
|
* Tuesday, April 1, 2003
|
||||||
*
|
*
|
||||||
* Modifications:
|
* Modifications:
|
||||||
*
|
*
|
||||||
* Raymond Lu
|
|
||||||
* Tuesday, October 2, 2001
|
|
||||||
* Changed the way to check parameter and set property for
|
|
||||||
* generic property list.
|
|
||||||
*
|
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
herr_t
|
herr_t
|
||||||
H5Pset_szip(hid_t plist_id, const unsigned cd_values[])
|
H5Pset_szip(hid_t plist_id,
|
||||||
|
int options_mask,
|
||||||
|
int bits_per_pixel,
|
||||||
|
int pixels_per_block,
|
||||||
|
int pixels_per_scanline)
|
||||||
{
|
{
|
||||||
H5O_pline_t pline;
|
H5O_pline_t pline;
|
||||||
H5P_genplist_t *plist; /* Property list pointer */
|
H5P_genplist_t *plist; /* Property list pointer */
|
||||||
|
unsigned cd_values[4]; /* Filter parameters */
|
||||||
herr_t ret_value=SUCCEED; /* return value */
|
herr_t ret_value=SUCCEED; /* return value */
|
||||||
|
|
||||||
FUNC_ENTER_API(H5Pset_szip, FAIL);
|
FUNC_ENTER_API(H5Pset_szip, FAIL);
|
||||||
/* H5TRACE2("e","i*Iu",plist_id,cd_values);
|
H5TRACE5("e","iIsIsIsIs",plist_id,options_mask,bits_per_pixel,
|
||||||
H5TRACE2("e","i*Iu",plist_id,cd_values);
|
pixels_per_block,pixels_per_scanline);
|
||||||
*/
|
|
||||||
|
|
||||||
/* Get the plist structure */
|
/* Get the plist structure */
|
||||||
if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE)))
|
if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE)))
|
||||||
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
|
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
|
||||||
|
|
||||||
|
/* Set the parameters for the filter */
|
||||||
|
cd_values[0]=options_mask;
|
||||||
|
cd_values[1]=bits_per_pixel;
|
||||||
|
cd_values[2]=pixels_per_block;
|
||||||
|
cd_values[3]=pixels_per_scanline;
|
||||||
|
|
||||||
/* Add the filter */
|
/* Add the filter */
|
||||||
if(H5P_get(plist, H5D_CRT_DATA_PIPELINE_NAME, &pline) < 0)
|
if(H5P_get(plist, H5D_CRT_DATA_PIPELINE_NAME, &pline) < 0)
|
||||||
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get pipeline");
|
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get pipeline");
|
||||||
|
@ -220,7 +220,8 @@ H5_DLL H5Z_filter_t H5Pget_filter(hid_t plist_id, int filter,
|
|||||||
unsigned cd_values[]/*out*/,
|
unsigned cd_values[]/*out*/,
|
||||||
size_t namelen, char name[]);
|
size_t namelen, char name[]);
|
||||||
H5_DLL herr_t H5Pset_deflate(hid_t plist_id, unsigned aggression);
|
H5_DLL herr_t H5Pset_deflate(hid_t plist_id, unsigned aggression);
|
||||||
H5_DLL herr_t H5Pset_szip(hid_t plist_id,const unsigned cd_values[]);
|
H5_DLL herr_t H5Pset_szip(hid_t plist_id, int options_mask, int bits_per_pixel,
|
||||||
|
int pixels_per_block, int pixels_per_scanline);
|
||||||
H5_DLL herr_t H5Pset_shuffle(hid_t plist_id, unsigned bytespertype);
|
H5_DLL herr_t H5Pset_shuffle(hid_t plist_id, unsigned bytespertype);
|
||||||
H5_DLL herr_t H5Pset_fletcher32(hid_t plist_id);
|
H5_DLL herr_t H5Pset_fletcher32(hid_t plist_id);
|
||||||
H5_DLL herr_t H5Pset_edc_check(hid_t plist_id, H5Z_EDC_t check);
|
H5_DLL herr_t H5Pset_edc_check(hid_t plist_id, H5Z_EDC_t check);
|
||||||
|
Loading…
Reference in New Issue
Block a user