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.

readRGBATile

Class: Tiff

Read tile data using RGBA interface

Syntax

[RGB,alpha] = readRGBATile(tiffobj,row,col)

Description

[RGB,alpha] = readRGBATile(tiffobj,row,col) reads a tile from the TIFF file associated with the Tiff object using the RGBA interface. row and col are the one-based row and column numbers of any pixel in the requested tile. RGB consists of an m-by-n-by-3 colormetric image, where m and n are the height and width of the tile, respectively. alpha is the associated alpha matting. If the image does not have associated alpha matting, then alpha is a matrix with all values set to 255 (transparent).

The tile is clipped if the tile boundaries extend past the edges of the image.

The pixel values may be transformed depending upon the values of the following tags:

PhotometricInterpretation
BitsPerSample
SamplesPerPixel
Orientation
ExtraSamples
ColorMap

Examples

Open a Tiff object and read the first tile using the RGBA interface.

t = Tiff('example.tif','r');
t.setDirectory(1); 
[RGB,A] = t.readRGBATile(1,1);
t.close();

References

This method corresponds to the TIFFReadRGBATile function in the LibTIFF C API.

To use this method, you must be familiar with LibTIFF version 4.0.0, as well as the TIFF specification and technical notes. View this documentation at LibTIFF - TIFF Library and Utilities.

Was this topic helpful?