changeset 14260:1f911333ed3d

doc: Update docstrings for functions in image/ directory * aspell-octave.en.pws, brighten.m, colormap.m, contrast.m, flag.m, gmap40.m gray.m, gray2ind.m, hsv2rgb.m, image.m, ind2gray.m, ind2rgb.m, ntsc2rgb.m, ocean.m, rgb2hsv.m, rgb2ind.m, rgb2ntsc.m: Update docstrings.
author Rik <octave@nomad.inbox5.com>
date Tue, 24 Jan 2012 09:51:48 -0800
parents 08779abcb640
children 284656167c25
files doc/interpreter/doccheck/aspell-octave.en.pws scripts/image/brighten.m scripts/image/colormap.m scripts/image/contrast.m scripts/image/flag.m scripts/image/gmap40.m scripts/image/gray.m scripts/image/gray2ind.m scripts/image/hsv2rgb.m scripts/image/image.m scripts/image/ind2gray.m scripts/image/ind2rgb.m scripts/image/ntsc2rgb.m scripts/image/ocean.m scripts/image/rgb2hsv.m scripts/image/rgb2ind.m scripts/image/rgb2ntsc.m
diffstat 17 files changed, 74 insertions(+), 60 deletions(-) [+]
line wrap: on
line diff
--- a/doc/interpreter/doccheck/aspell-octave.en.pws	Tue Jan 24 08:53:42 2012 -0800
+++ b/doc/interpreter/doccheck/aspell-octave.en.pws	Tue Jan 24 09:51:48 2012 -0800
@@ -120,6 +120,7 @@
 chol
 Cholesky
 cholmod
+chrominance
 cindex
 circ
 circshift
--- a/scripts/image/brighten.m	Tue Jan 24 08:53:42 2012 -0800
+++ b/scripts/image/brighten.m	Tue Jan 24 09:51:48 2012 -0800
@@ -18,20 +18,18 @@
 
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {@var{map_out} =} brighten (@var{map}, @var{beta})
+## @deftypefnx {Function File} {@var{map_out} =} brighten (@var{beta})
 ## @deftypefnx {Function File} {@var{map_out} =} brighten (@var{h}, @var{beta})
-## @deftypefnx {Function File} {@var{map_out} =} brighten (@var{beta})
-## Darken or brighten the given colormap.  If the @var{map} argument
-## is omitted, the function is applied to the current colormap.  The first
-## argument can also be a valid graphics handle @var{h}, in which case
-## @code{brighten} is applied to the colormap associated with this handle.
+## Brighten or darken a colormap.  If the @var{map} argument is omitted, the
+## function is applied to the current colormap.  The first argument can also be
+## a valid graphics handle @var{h}, in which case @code{brighten} is applied to
+## the colormap associated with this handle.
 ##
-## Should the resulting colormap @var{map_out} not be assigned, it will be
-## written to the current colormap.
+## The argument @var{beta} must be a scalar between -1 and 1, where a
+## negative value darkens and a positive value brightens the colormap.
 ##
-## The argument @var{beta} should be a scalar between -1 and 1,
-## where a negative value darkens and a positive value brightens
-## the colormap.
-## @seealso{colormap}
+## If no output is specified then the result is written to the current colormap.
+## @seealso{colormap, contrast}
 ## @end deftypefn
 
 function rmap = brighten (arg1, beta)
--- a/scripts/image/colormap.m	Tue Jan 24 08:53:42 2012 -0800
+++ b/scripts/image/colormap.m	Tue Jan 24 09:51:48 2012 -0800
@@ -20,12 +20,12 @@
 ## @deftypefn  {Function File} {@var{cmap} =} colormap ()
 ## @deftypefnx {Function File} {@var{cmap} =} colormap (@var{map})
 ## @deftypefnx {Function File} {@var{cmap} =} colormap ("default")
-## Set the current colormap.
+## Query or set the current colormap.
 ##
 ## @code{colormap (@var{map})} sets the current colormap to @var{map}.  The
-## color map should be an @var{n} row by 3 column matrix.  The columns
+## colormap should be an @var{n} row by 3 column matrix.  The columns
 ## contain red, green, and blue intensities respectively.  All entries
-## should be between 0 and 1 inclusive.  The new colormap is returned.
+## must be between 0 and 1 inclusive.  The new colormap is returned.
 ##
 ## @code{colormap ("default")} restores the default colormap (the
 ## @code{jet} map with 64 entries).  The default colormap is returned.
--- a/scripts/image/contrast.m	Tue Jan 24 08:53:42 2012 -0800
+++ b/scripts/image/contrast.m	Tue Jan 24 09:51:48 2012 -0800
@@ -17,12 +17,12 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn  {Function File} {} contrast (@var{x})
-## @deftypefnx {Function File} {} contrast (@var{x}, @var{n})
+## @deftypefn  {Function File} {@var{map} =} contrast (@var{x})
+## @deftypefnx {Function File} {@var{map} =} contrast (@var{x}, @var{n})
 ## Return a gray colormap that maximizes the contrast in an image.  The
 ## returned colormap will have @var{n} rows.  If @var{n} is not defined
 ## then the size of the current colormap is used.
-## @seealso{colormap}
+## @seealso{colormap, brighten}
 ## @end deftypefn
 
 function map = contrast (x, n)
--- a/scripts/image/flag.m	Tue Jan 24 08:53:42 2012 -0800
+++ b/scripts/image/flag.m	Tue Jan 24 09:51:48 2012 -0800
@@ -19,7 +19,7 @@
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {@var{map} =} flag ()
 ## @deftypefnx {Function File} {@var{map} =} flag (@var{n})
-## Create color colormap.  This colormap cycles through red, white, blue
+## Create color colormap.  This colormap cycles through red, white, blue,
 ## and black with each index change.
 ## The argument @var{n} must be a scalar.
 ## If unspecified, the length of the current colormap, or 64, is used.
--- a/scripts/image/gmap40.m	Tue Jan 24 08:53:42 2012 -0800
+++ b/scripts/image/gmap40.m	Tue Jan 24 09:51:48 2012 -0800
@@ -23,8 +23,8 @@
 ## magenta and cyan.  This colormap is specifically designed for users of
 ## gnuplot 4.0 where these 6 colors are the allowable ones for patch objects.
 ## The argument @var{n} must be a scalar.
-## If unspecified, a length of 6 is assumed.  Larger values
-## of @var{n} result in a repetition of the above colors.
+## If unspecified, a length of 6 is assumed.  Larger values of @var{n} result
+## in a repetition of the above colors.
 ## @seealso{colormap}
 ## @end deftypefn
 
--- a/scripts/image/gray.m	Tue Jan 24 08:53:42 2012 -0800
+++ b/scripts/image/gray.m	Tue Jan 24 09:51:48 2012 -0800
@@ -23,6 +23,7 @@
 ## shades of gray.
 ## The argument @var{n} must be a scalar.
 ## If unspecified, the length of the current colormap, or 64, is used.
+## @seealso{colormap}
 ## @end deftypefn
 
 ## Author: Tony Richardson <arichard@stark.cc.oh.us>
--- a/scripts/image/gray2ind.m	Tue Jan 24 08:53:42 2012 -0800
+++ b/scripts/image/gray2ind.m	Tue Jan 24 09:51:48 2012 -0800
@@ -17,10 +17,13 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} {[@var{img}, @var{map}] =} gray2ind (@var{I}, @var{n})
+## @deftypefn  {Function File} {[@var{img} =} gray2ind (@var{I})
+## @deftypefnx {Function File} {[@var{img} =} gray2ind (@var{I}, @var{n})
+## @deftypefnx {Function File} {[@var{img}, @var{map} =} gray2ind (@dots{})
 ## Convert a gray scale intensity image to an Octave indexed image.
-## The indexed image will consist of @var{n} different intensity values.  If not
-## given @var{n} will default to 64.
+## The indexed image will consist of @var{n} different intensity values.
+## If not given @var{n} defaults to 64.
+## @seealso{ind2gray, rgb2ind} 
 ## @end deftypefn
 
 ## Author: Tony Richardson <arichard@stark.cc.oh.us>
--- a/scripts/image/hsv2rgb.m	Tue Jan 24 08:53:42 2012 -0800
+++ b/scripts/image/hsv2rgb.m	Tue Jan 24 09:51:48 2012 -0800
@@ -17,9 +17,11 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} {@var{rgb_map} =} hsv2rgb (@var{hsv_map})
-## Transform a colormap or image from the HSV space to the RGB space.
-## @seealso{rgb2hsv}
+## @deftypefn  {Function File} {@var{rgb_map} =} hsv2rgb (@var{hsv_map})
+## @deftypefnx {Function File} {@var{rgb_img} =} hsv2rgb (@var{hsv_img})
+## Transform a colormap or image from hue-saturation-value (HSV) space to
+## red-green-blue (RGB) space.
+## @seealso{rgb2hsv, ind2rgb, ntsc2rgb}
 ## @end deftypefn
 
 ## Author: Kai Habel <kai.habel@gmx.de>
@@ -27,10 +29,10 @@
 
 function rgb_map = hsv2rgb (hsv_map)
 
-## Each color value x = (r,g,b) is calculated with
-## x = (1-sat)*val+sat*val*f_x(hue)
-## where f_x(hue) is a piecewise defined function for
-## each color with f_r(hue-2/3) = f_g(hue) = f_b(hue-1/3).
+  ## Each color value x = (r,g,b) is calculated with
+  ## x = (1-sat)*val+sat*val*f_x(hue)
+  ## where f_x(hue) is a piecewise defined function for
+  ## each color with f_r(hue-2/3) = f_g(hue) = f_b(hue-1/3).
 
   if (nargin != 1)
     print_usage ();
--- a/scripts/image/image.m	Tue Jan 24 08:53:42 2012 -0800
+++ b/scripts/image/image.m	Tue Jan 24 09:51:48 2012 -0800
@@ -20,24 +20,24 @@
 ## @deftypefn  {Function File} {} image (@var{img})
 ## @deftypefnx {Function File} {} image (@var{x}, @var{y}, @var{img})
 ## @deftypefnx {Function File} {@var{h} =} image (@dots{})
-## Display a matrix as a color image.  The elements of @var{img} are indices
-## into the current colormap, and the colormap will be scaled so that the
-## extremes of @var{img} are mapped to the extremes of the colormap.
+## Display a matrix as a color image.
 ##
+## The elements of @var{img} are indices into the current colormap.
 ## The axis values corresponding to the matrix elements are specified in
-## @var{x} and @var{y}.  If you're not using gnuplot 4.2 or later, these
+## @var{x} and @var{y}.  If you are using gnuplot 4.1 or earlier, these
 ## variables are ignored.
 ##
+## The optional return value @var{h} is a graphics handle to the image.
+##
 ## Implementation Note: The origin (0, 0) for images is located in the
 ## upper left.  For ordinary plots, the origin is located in the lower
 ## left.  Octave handles this inversion by plotting the data normally,
 ## and then reversing the direction of the y-axis by setting the
-## @code{ydir} property to @code{"reverse"}.  This has implications whenever
+## @code{ydir} property to "reverse".  This has implications whenever
 ## an image and an ordinary plot need to be overlaid.  The recommended
 ## solution is to display the image and then plot the reversed ydata
 ## using, for example, @code{flipud (ydata,1)}.
 ##
-## The optional return value @var{h} is a graphics handle to the image.
 ## @seealso{imshow, imagesc, colormap}
 ## @end deftypefn
 
@@ -90,7 +90,7 @@
 ## Generic image creation.
 ##
 ## The axis values corresponding to the matrix elements are specified in
-## @var{x} and @var{y}. If you're not using gnuplot 4.2 or later, these
+## @var{x} and @var{y}.  If you're not using gnuplot 4.2 or later, these
 ## variables are ignored.
 
 ## Author: Tony Richardson <arichard@stark.cc.oh.us>
--- a/scripts/image/ind2gray.m	Tue Jan 24 08:53:42 2012 -0800
+++ b/scripts/image/ind2gray.m	Tue Jan 24 09:51:48 2012 -0800
@@ -17,11 +17,12 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} {} ind2gray (@var{x}, @var{map})
-## Convert an Octave indexed image to a gray scale intensity image.
+## @deftypefn  {Function File} {} ind2gray (@var{x})
+## @deftypefnx {Function File} {} ind2gray (@var{x}, @var{map})
+## Convert a color indexed image to a gray scale intensity image.
 ## If @var{map} is omitted, the current colormap is used to determine the
 ## intensities.
-## @seealso{gray2ind, rgb2ntsc, image, colormap}
+## @seealso{gray2ind, ind2rgb}
 ## @end deftypefn
 
 ## Author: Tony Richardson <arichard@stark.cc.oh.us>
--- a/scripts/image/ind2rgb.m	Tue Jan 24 08:53:42 2012 -0800
+++ b/scripts/image/ind2rgb.m	Tue Jan 24 09:51:48 2012 -0800
@@ -17,13 +17,14 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn  {Function File} {@var{rgb} =} ind2rgb (@var{x}, @var{map})
-## @deftypefnx {Function File} {[@var{R}, @var{R}, @var{R}] =} ind2rgb (@var{x}, @var{map})
+## @deftypefn  {Function File} {@var{rgb} =} ind2rgb (@var{x})
+## @deftypefnx {Function File} {@var{rgb} =} ind2rgb (@var{x}, @var{map})
+## @deftypefnx {Function File} {[@var{R}, @var{G}, @var{B}] =} ind2rgb (@dots{})
 ## Convert an indexed image to red, green, and blue color components.
 ## If the colormap doesn't contain enough colors, pad it with the
 ## last color in the map.
 ## If @var{map} is omitted, the current colormap is used for the conversion.
-## @seealso{rgb2ind, image, imshow, ind2gray, gray2ind}
+## @seealso{rgb2ind, ind2gray, hsv2rgb, ntsc2rgb}
 ## @end deftypefn
 
 ## Author: Tony Richardson <arichard@stark.cc.oh.us>
--- a/scripts/image/ntsc2rgb.m	Tue Jan 24 08:53:42 2012 -0800
+++ b/scripts/image/ntsc2rgb.m	Tue Jan 24 09:51:48 2012 -0800
@@ -17,9 +17,11 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} {} ntsc2rgb (@var{yiq})
-## Transform a colormap or image from NTSC to RGB.
-## @seealso{rgb2ntsc}
+## @deftypefn  {Function File} {@var{rgb_map} =} ntsc2rgb (@var{yiq_map})
+## @deftypefnx {Function File} {@var{rgb_img} =} ntsc2rgb (@var{yiq_img})
+## Transform a colormap or image from luminance-chrominance (NTSC) space to
+## red-green-blue (RGB) space.
+## @seealso{rgb2ntsc, hsv2rgb, ind2rgb}
 ## @end deftypefn
 
 ## Author: Tony Richardson <arichard@stark.cc.oh.us>
--- a/scripts/image/ocean.m	Tue Jan 24 08:53:42 2012 -0800
+++ b/scripts/image/ocean.m	Tue Jan 24 09:51:48 2012 -0800
@@ -23,6 +23,7 @@
 ## of blue.
 ## The argument @var{n} must be a scalar.
 ## If unspecified, the length of the current colormap, or 64, is used.
+## @seealso{colormap}
 ## @end deftypefn
 
 ## Author: Tony Richardson <arichard@stark.cc.oh.us>
--- a/scripts/image/rgb2hsv.m	Tue Jan 24 08:53:42 2012 -0800
+++ b/scripts/image/rgb2hsv.m	Tue Jan 24 09:51:48 2012 -0800
@@ -17,16 +17,18 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} {@var{hsv_map} =} rgb2hsv (@var{rgb})
-## Transform a colormap or image from the RGB space to the HSV space.
-##
-## A color in the RGB space consists of the red, green and blue intensities.
+## @deftypefn  {Function File} {@var{hsv_map} =} rgb2hsv (@var{rgb})
+## @deftypefnx {Function File} {@var{hsv_map} =} rgb2hsv (@var{rgb})
+## Transform a colormap or image from red-green-blue (RGB) space to
+## hue-saturation-value (HSV) space.
 ##
-## In the HSV space each color is represented by their hue, saturation
-## and value (brightness).  Value gives the amount of light in the color.
-## Hue describes the dominant wavelength.
-## Saturation is the amount of hue mixed into the color.
-## @seealso{hsv2rgb}
+## A color in the RGB space consists of red, green, and blue intensities.
+##
+## A color in HSV space is represented by hue, saturation and value
+## (brightness) levels.  Value gives the amount of light in the color.  Hue
+## describes the dominant wavelength.  Saturation is the amount of hue mixed
+## into the color.
+## @seealso{hsv2rgb, rgb2ind, rgb2ntsc}
 ## @end deftypefn
 
 ## Author: Kai Habel <kai.habel@gmx.de>
--- a/scripts/image/rgb2ind.m	Tue Jan 24 08:53:42 2012 -0800
+++ b/scripts/image/rgb2ind.m	Tue Jan 24 09:51:48 2012 -0800
@@ -19,8 +19,8 @@
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {[@var{x}, @var{map}] =} rgb2ind (@var{rgb})
 ## @deftypefnx {Function File} {[@var{x}, @var{map}] =} rgb2ind (@var{R}, @var{G}, @var{B})
-## Convert an RGB image to an Octave indexed image.
-## @seealso{ind2rgb, rgb2ntsc}
+## Convert an image in red-green-blue (RGB) space to an indexed image.
+## @seealso{ind2rgb, rgb2hsv, rgb2ntsc}
 ## @end deftypefn
 
 ## Bugs: The color map may have duplicate entries.
--- a/scripts/image/rgb2ntsc.m	Tue Jan 24 08:53:42 2012 -0800
+++ b/scripts/image/rgb2ntsc.m	Tue Jan 24 09:51:48 2012 -0800
@@ -17,9 +17,11 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} {} rgb2ntsc (@var{rgb})
-## Transform a colormap or image from RGB to NTSC.
-## @seealso{ntsc2rgb}
+## @deftypefn  {Function File} {@var{yiq_map} =} rgb2ntsc (@var{rgb_map})
+## @deftypefnx {Function File} {@var{yiq_img} =} rgb2ntsc (@var{rgb_img})
+## Transform a colormap or image from red-green-blue (RGB) space to
+## luminance-chrominance (NTSC) space.
+## @seealso{ntsc2rgb, rgb2hsv, rgb2ind}
 ## @end deftypefn
 
 ## Author: Tony Richardson <arichard@stark.cc.oh.us>