Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

writeTile - Class: Tiff

Write data to specified tile

Syntax

writeEncodedTile(tileNumber,imageData)
tiffobj.writeEncodedTile(tileNumber,Y,Cb,Cr)

Description

writeEncodedTile(tileNumber,imageData) writes the data in imageData to the tile specified by tileNumber. Tile identification numbers are one-based. If imageData has fewer bytes than fit into a tile, writeEncodedTile silently pads the tile. If imageData has more bytes than fit into a tile, writeEncodedTile issues a warning and truncates the data. To determine the size of a tile, view the value of the tileLength and tileWidth tags.

tiffobj.writeEncodedTile(tileNumber,Y,Cb,Cr) writes the YCbCr component data to the specified tile. You must set the YCbCrSubSampling tags.

Examples

Open a TIFF file for modification. Replace myfile.tif with the name of a TIFF file on your MATLAB path.

t = Tiff('myfile.tif', 'r+');

if t.isTiled()
   width = t.getTag('tileWidth');
	 height = t.getTag('tileLength');
	 numSamples = t.getTag('SamplesPerPixel');
	 imageData = zeros(height,width,numSamples,'uint8');
	 t.writeEncodedTile(1,imageData);
end

References

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

See Also

Tiff.writeEncodedStrip

Tutorials

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS