TIFF Images: How do 16-RGBA image pixels alternate?

I am trying to deal with 16-bit RGBA TIFF images using the C language, I could not find much information about 16-bit images in the specifications.

In the case of an 8-bit RGBA channel image, I understand that the pixel is stored as uint32 and can be deinterlaced by grouping 32 bits into 4 groups (R, G, B, A) of 8 bits, Then, to deal with 8-bit images RGBA per channel, I do the following (see also the attached source code here ):

  • I store image data as a uint32 tab (using TIFFReadRGBAImageOriented) which I call data_tiff
  • I deinterleysiruet pixels, using the following commands: (uint8) TIFFGetR(*data_tiff), (uint8) TIFFGetG(*data_tiff), (uint8) TIFFGetB(*data_tiff)and(uint8) TIFFGetA(*data_tiff)

In the case of a 16-bit RGBA image of the channel, can you tell me how I can deinterlacing the pixels? if I could restore the image data as a uint64 tab, then I could do the following:

#define    TIFF16GetR(abgr)    ((abgr) & 0xffff)
#define    TIFF16GetG(abgr)    (((abgr) >> 16) & 0xffff)
#define    TIFF16GetB(abgr)    (((abgr) >> 32) & 0xffff)
#define    TIFF16GetA(abgr)    (((abgr) >> 48) & 0xffff)`
  • I read image data as uint64 tab.
  • I deinterleysiruet pixels using (uint16) TIFF16GetR(*data_tiff), (uint16) TIFF16GetG(*data_tiff), (uint16) TIFF16GetB(*data_tiff)and(uint16) TIFF16GetA(*data_tiff)

but it seems that the data is not saved on the uint64 tab, so I wonder how the 16-bit images per channel alternate in the uint32 pixels tab.

I also run into difficulties associated with 16-bit grayscale images in the same way (using TIFFReadRGBAImageOrientedto get image data and try to convert every pixel to uint16)

More generally, do you have any documentation on 16-bit shades of gray and color images?

, ,

.

+5
1

TIFFReadRGBAImage 8 .

16 , TIFFReadScanline SamplesPerPixel BitsPerSample. , ( , TIFF 6.0), ( ).

TIFF TIFFReadRGBAImage, , TIFFReadEncodedStrip TIFFReadEncodedTile.

, TIFF , , , libtiff, .

, , TIFF 6.0, TIFF

" TIFF, . , TIFF . [9] , TIFF TIFF. TIFF JPEG LZW. TIFF TIFF 6.0, 1: TIFF" Wikipedia

TIFF 8 , TIFF BitsPerSample 4 8, RGB 8 . TIFF, TIFF .

Tiled Images , StripOffsets, StripByteCounts RowsPerStrip TileWidth, TileLength, TileOffsets TileByteCounts, TIFFGetField().

+6

All Articles