Documentation

This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this 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)

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?