Quantcast

Documentation Center

  • Trial Software
  • Product Updates

writeEncodedStrip

Class: Tiff

Write data to specified strip

Syntax

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

Description

tiffobj.writeEncodedStrip(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.

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

Examples

expand all

Write Image Data to Strips

Open a Tiff object for writing and set tag values.

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

Write data to the first and second strips.

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

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.

See Also

Was this topic helpful?