diff scripts/image/imread.m @ 17350:ba79ba4e83ab

Rewrite of imfinfo. * __magick_read__.cc (is_indexed, get_depth, read_maps): new functions to check if image is indexed, identify bitdepth, and read colormap. Extracted from __magick_read__() and read_indexed_image() so they can be shared with __magick_finfo__. (read_indexed_images): readjusted to use read_maps(). (__magick_read__): readjusted to use new functions is_indexed() and get_depth(). (magick_to_octave_value): remove template for unspecific classes. New ones for CompressionType, and OrientationType. (disposal_methods): new. Returns a map so it may be used in the future for writing animated GIFs. (__magick_finfo__): complete rewrite. Use of octave_scalar_map and fast_element_insert (instead of contents() and non-linear operator()) has a nice improvement for multipage images. Removed fields are: LongFormat, TotalColors, TileName, Matte, ModulusDepth, QuantizeColors, and View. New fields are: FormatVersion, Comment, DisposalMethod, Chromaticities, Compression, Colormap, and Orientation. Renamed fields are: AnimationDelay to DelayTime, AnimationIterations to LoopCount, and ResolutionUnits to ResolutionUnit. Macro was removed since it is no longer required. GraphicsMagick seems to no longer throw exception when parameter is not present, and we are using read_file() so try-catch block was also removed. Values returned by ResolutionUnit changed for Matlab compatibility. Added CMYK to ColorType. * imfinfo.m: document new, and remove old, info, fields returned. * imread.m: document imfinfo should be used to obtain multiple colormaps in case of multipage images.
author Carnë Draug <carandraug@octave.org>
date Thu, 29 Aug 2013 06:31:55 +0100
parents 1c89599167a6
children 040752d07240
line wrap: on
line diff
--- a/scripts/image/imread.m	Thu Aug 29 19:48:58 2013 -0700
+++ b/scripts/image/imread.m	Thu Aug 29 06:31:55 2013 +0100
@@ -39,12 +39,17 @@
 ## @nospell{MxNx3} matrix.  Gray-level and black-and-white images are
 ## of size @nospell{MxN}.  Multipage images will have an additional 4th
 ## dimension.
+##
 ## The bit depth of the image determines the
-## class of the output: @qcode{"uint8"} or @qcode{"uint16"} for gray
-## and color, and @qcode{"logical"} for black and white.
+## class of the output: @qcode{"uint8"}, @qcode{"uint16"} or @qcode{"single"}
+## for gray and color, and @qcode{"logical"} for black and white.
 ## Note that indexed images always return the indexes for a colormap,
 ## independent if @var{map} is a requested output.  To obtain the actual
-## RGB image, use @code{ind2rgb}.
+## RGB image, use @code{ind2rgb}.  When more than one indexed image is being
+## read, @var{map} is obtained from the first.  In some rare cases this
+## may be incorrect and @code{imfinfo] can be used to obtain the colormap of
+## each image.
+##
 ## See the Octave manual for more information in representing images.
 ##
 ## Some file formats, such as TIFF and GIF, are able to store multiple