Tiff.readRGBAStrip

Reads one strip converted to RGB color data.

Category: Data Import and Analysis > Data Import and Export

Syntax

A = readRGBAStrip(t, row)

Returns the strip that starts at image row row.

Description

The method acts on a Tiff object created with Tiff(filename, mode). It is the color-converted counterpart of readEncodedStrip, useful for displaying a large image in bands. The row argument must be the first row of a strip.

Input arguments

t
Tiff object opened on a stripped image.
row
Row number where the strip starts, counted from 1. Rows start at 1, 1 + RowsPerStrip, and so on.

Output arguments

A
uint8 color array covering the rows of that strip.

Example

First strip as color

tag.ImageLength = 8; tag.ImageWidth = 8;
tag.Photometric = Tiff.Photometric.MinIsBlack;
tag.BitsPerSample = 8; tag.SamplesPerPixel = 1; tag.RowsPerStrip = 4;
tag.PlanarConfiguration = Tiff.PlanarConfiguration.Chunky;
I = uint8(magic(8) * 3);
w = Tiff('t.tif', 'w'); w.setTag(tag); w.write(I); w.close();
r = Tiff('t.tif', 'r');
A = r.readRGBAStrip(1);
size(A, 1:2)
class(A)
r.close();
Output
ans = 1×2

     4     8
ans = 'uint8'

See also

Tiff.readRGBAImage Tiff.readRGBATile Tiff.readEncodedStrip Tiff.computeStrip