ImageAdapter class

Interface for image I/O


ImageAdapter, an abstract class, specifies the Image Processing Toolbox™ interface for region-based reading and writing of image files. You can use classes that inherit from the ImageAdapter interface with the blockproc function for file-based processing of arbitrary image file formats.


adapter = ClassName(...) handles object initialization, manages file opening or creation, and sets the initial values of class properties. The class constructor can take any number of arguments.



Specifies a colormap. Use the Colormap property when working with indexed images.

Data Type: 2-D, real, M-by-3 matrix

Default: Empty ([]), indicating either a grayscale, logical, or truecolor image


Holds the size of the entire image. When you construct a new class that inherits from ImageAdapter, set the ImageSize property in your class constructor.

Data Type: 2- or 3-element vector specified as [rows cols] or [rows cols bands], where rows indicates height and cols indicates width


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

closeClose ImageAdapter object
readRegionRead region of image
writeRegionWrite block of data to region of image
Was this topic helpful?