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