Mercurial > octave-antonio
diff scripts/image/imread.m @ 16984:997efb8d0b19
imread: implement options Index, Frames, and Info.
* imread.m: write documentation about options of param/key style.
* private/core_imread.m: write parsing of options in the param/key style.
Implement the option for Index, Frames, and Info. Also write parsing
for PixelRegion but comment out the code until it's implemented in
__magick_read__(). Add comments about, and deprecate, Octave's native
image format which is completely undocumented. Remove tests since they
are duplicated from the ones in imread.m.
* __magick_read__.cc: move input check to the m file calling it. Rewrite
parsing of options which are now in a non-optional struct (default values
are now set on the m function).
* private/imageIO.m: fix call to other functions with varargout with
multiple output values.
author | Carnë Draug <carandraug@octave.org> |
---|---|
date | Sat, 13 Jul 2013 12:41:59 +0100 |
parents | 52c1b832d98e |
children | a1d091243d11 |
line wrap: on
line diff
--- a/scripts/image/imread.m Sat Jul 13 01:33:17 2013 +0100 +++ b/scripts/image/imread.m Sat Jul 13 12:41:59 2013 +0100 @@ -1,3 +1,4 @@ +## Copyright (C) 2013 Carnë Draug ## Copyright (C) 2008-2012 Thomas L. Scofield ## Copyright (C) 2008 Kristian Rumberg ## Copyright (C) 2006 Thomas Weber @@ -25,6 +26,7 @@ ## @deftypefnx {Function File} {[@dots{}] =} imread (@var{filename}, @var{ext}) ## @deftypefnx {Function File} {[@dots{}] =} imread (@var{url}) ## @deftypefnx {Function File} {[@dots{}] =} imread (@dots{}, @var{idx}) +## @deftypefnx {Function File} {[@dots{}] =} imread (@dots{}, @var{param1}, @var{val1}, @dots{}) ## Read images from various file formats. ## ## Reads an image as a matrix from the file @var{filename}. If there is @@ -47,9 +49,25 @@ ## specifying the index of the images to read. By default, Octave ## will only read the first page. ## +## Depending on the file format, it is possible to configure the reading +## of images with @var{param}, @var{val} pairs. The following options +## are supported: +## +## @table @asis +## @item Frames or Index +## This is an alternative method to specify @var{idx}. When specifying it +## in this way, its value can also be the string "all". +## +## @item Info +## This option exists for @sc{Matlab} compatibility and has no effect. For +## maximum performance while reading multiple images from a single file, +## use the Index option. +## @end table +## ## @seealso{imwrite, imfinfo, imformats} ## @end deftypefn +## Author: Carnë Draug <carandraug@octave.org> ## Author: Thomas L. Scofield <scofield@calvin.edu> ## Author: Kristian Rumberg <kristianrumberg@gmail.com> ## Author: Thomas Weber <thomas.weber.mail@gmail.com> @@ -72,7 +90,7 @@ filename{2} = varargin{2}; endif - varargout{1:nargout} = imageIO (@core_imread, "read", filename, varargin{:}); + [varargout{1:nargout}] = imageIO (@core_imread, "read", filename, varargin{:}); endfunction %!testif HAVE_MAGICK