ImageAdapter class

Interface for image I/O

Description

ImageAdapter is an abstract class that defines custom region-based reading and writing of images in arbitrary image file formats. You can use classes that inherit from the ImageAdapter interface with the blockproc function to perform file-based block processing.

To write an Image Adapter class for a particular file format, you must be able to:

  • Query the size of the file on disk

  • Read a rectangular block of data from the file

To use this class, you must inherit from the ImageAdapter class. Type the following syntax as the first line of your class definition file:

classdef MyAdapter < ImageAdapter
    ...
end

Classes that inherit from ImageAdapter must implement the readRegion and close methods to support basic region-based reading of images. The optional writeRegion method allows for incremental, region-based writing of images. Image Adapter classes that do not implement the writeRegion method are read-only.

The ImageAdapter class is a handle class.

Class Attributes

Abstract
true
HandleCompatible
true

For information on class attributes, see Class Attributes (MATLAB).

Properties

expand all

Image size, specified as a 2-element vector of positive integers [m n], or a 3-element vector of positive integers [m n p], where m is the number of rows, n is the number of columns, and p is the number of channels of the image.

When you construct a new class that inherits from ImageAdapter, set the ImageSize property in your class constructor.

Example: [1920 1080]

Attributes:

GetAccess
public
SetAccess
protected

Colormap for indexed images, specified as a c-by-3 numeric matrix with values in the range [0, 1]. Each row of the matrix is a 3-element RGB triplet that specifies the red, green, and blue components of a single color.

When you construct a new class that inherits from ImageAdapter, set the Colormap property in your class constructor.

Attributes:

GetAccess
public
SetAccess
protected

Methods

expand all

Introduced in R2010a