Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

我们为许可用户提供了部分翻译好的中文文档。您只需登录便可查阅这些文档

writeEncodedStrip

Class: Tiff

Write data to specified strip

Syntax

writeEncodedStrip(tiffobj,stripNumber,imageData)
writeEncodedStrip(tiffobj,stripNumber,Y,Cb,Cr)

Description

writeEncodedStrip(tiffobj,stripNumber,imageData) writes the data in imageData to the strip specified by stripNumber. Strip identification numbers are one-based. If imageData has fewer bytes than fit into a strip, writeEncodedStrip silently pads the strip. If imageData has more bytes than fit into a strip, writeEncodedStrip issues a warning and truncates the data. To determine the size of a strip, view the value of the RowsPerStrip tag.

writeEncodedStrip(tiffobj,stripNumber,Y,Cb,Cr) writes the YCbCr component data to the specified tile. You must set the YCbCrSubSampling tag.

Examples

expand all

Open a Tiff object for writing and set tag values.

t = Tiff('myfile.tif','w');
setTag(t,'ImageLength',32)
setTag(t,'ImageWidth',32)
setTag(t,'Photometric',Tiff.Photometric.MinIsBlack)
setTag(t,'BitsPerSample',8)
setTag(t,'SamplesPerPixel',1)
setTag(t,'RowsPerStrip',16)
setTag(t,'PlanarConfiguration',Tiff.PlanarConfiguration.Chunky)

Write data to the first and second strips.

writeEncodedStrip(t,1,ones(16,32,'uint8'))
writeEncodedStrip(t,2,2*ones(16,32,'uint8'))
close(t)

Related Examples

References

This method corresponds to the TIFFWriteEncodedStrip function in the LibTIFF C API. To use this method, you must be familiar with the TIFF specification and technical notes. View this documentation at LibTIFF - TIFF Library and Utilities.


Was this topic helpful?