From 365461a772b02c5e9be5ac30677b9c5dad93f61c Mon Sep 17 00:00:00 2001 From: MuQun Yang Date: Fri, 17 Aug 2001 15:34:01 -0500 Subject: [svn-r4370] Purpose: 1. fix a bug 2. turn off a feature Description: 1. change the output of GRgetiminfo from NULL to &interlace_mode. 2. turn off the feature to change line-interleaved feature into pixel-interleaved feature since inconsistent behaviour is found in GR interface. Solution: see above Platforms tested: eirene, arabica --- tools/h4toh5/h4toh5image.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/tools/h4toh5/h4toh5image.c b/tools/h4toh5/h4toh5image.c index 94fa08f..a1ab359 100644 --- a/tools/h4toh5/h4toh5image.c +++ b/tools/h4toh5/h4toh5image.c @@ -118,7 +118,7 @@ int Image_h4_to_h5(int32 file_id,int32 ri_id,hid_t h5_group,hid_t h5_palgroup,in } istat = GRgetiminfo(ri_id, image_name, &ncomp, &image_dtype, - NULL, dimsizes, &ngrattrs); + &interlace_mode, dimsizes, &ngrattrs); if(istat == FAIL) { printf("Cannot obtain GR info. at Image routine.\n"); @@ -154,7 +154,16 @@ int Image_h4_to_h5(int32 file_id,int32 ri_id,hid_t h5_group,hid_t h5_palgroup,in printf("error in allocating memory for image data. \n"); return FAIL; } - + /* GRreqimageil or GRreadimage are not working, comment this out for the time being. + if(interlace_mode == MFGR_INTERLACE_LINE){ + istat = GRreqimageil(ri_id,MFGR_INTERLACE_PIXEL); + if(istat == FAIL){ + printf("error in setting interlace_mode.\n"); + free(image_data); + return FAIL; + } + } + */ istat = GRreadimage(ri_id, start, NULL, edges, (VOIDP)image_data); if (istat == FAIL) { @@ -179,13 +188,16 @@ int Image_h4_to_h5(int32 file_id,int32 ri_id,hid_t h5_group,hid_t h5_palgroup,in h5dims24[1] = edges[0]-start[0]; h5dims24[2] = 3; } - /* currently scan-line is not supported. + /* currently scan-line is not supported. */ else if (interlace_mode == MFGR_INTERLACE_LINE){ - h5dims24[0] = 3; + printf("currently line interleaving is not supported.\n"); + printf("the image %s will not be converted.\n",image_name); + free(image_data); + return SUCCEED; + /*h5dims24[0] = 3; h5dims24[1] = edges[1]-start[1]; - h5dims24[2] = edges[0]-start[0]; + h5dims24[2] = edges[0]-start[0];*/ } - */ else if (interlace_mode == MFGR_INTERLACE_COMPONENT){ h5dims24[0] = 3; h5dims24[1] = edges[1]-start[1]; -- cgit v0.12