Hi He,
        You can build up this sort of selection with the H5Sselect_hyperslab() 
routine by using the H5S_SELECT_OR operator (or another convenient operator).

                Quincey

On Nov 13, 2012, at 1:06 PM, [email protected] wrote:

> Hi 
>  The problem is the hyperslab's  strid is meaused by the number of  pixels, 
> not bytes, so I i have a 8 16bit pixels, and a 4 padding bits, 
> the stride will not work. as if the stride is 1 it will be 16bit not 4bits.
>  
> He Yang
> 
> 
> 
> On Tue, Nov 13, 2012 at 12:24 PM, Quincey Koziol <[email protected]> wrote:
> 
> On Nov 12, 2012, at 8:52 AM, [email protected] wrote:
> 
> > Hi All
> >     I am trying to save image data to the dataset,  the image data is 
> > allocated by other library,  so the image's scanline length is not equal to 
> > the number
> > of pixels, and will have the padding bytes.  I want save it into hdf5 as a 
> > matrix,  which don't  have those padding bytes,  as the image can be float, 
> > unsigned short, and come from other data, the scanline length(/ step ) 
> > between each row may not be the multiples of the pixels.  for example, the
> > image has 9 unsigned short pixels, and the sacn line length is defined by 
> > allocate 9*(16/2)+4=76 bytes, the stride in hdf5 can only be the interger 
> > times the elements length.  so it can not work.  And I don't want use a 
> > temporary buffer to change the memory layout. I also want all other hdf5 
> > application can directly read the image out as matrix, so I don't want use 
> > raw data format.   Is there a way which can directly use hdf5's api and it 
> > will automatically strip the padding bytes for image data.
> 
>         You should be able to use hyperslab or point selections to achieve 
> what you want.
> 
>                 Quincey
> 
> 
> 
> _______________________________________________
> Hdf-forum is for HDF software users discussion.
> [email protected]
> http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org
> 
> _______________________________________________
> Hdf-forum is for HDF software users discussion.
> [email protected]
> http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

Reply via email to