Mercurial > hg > octave-image
changeset 790:ea9c98b3ae20
doc: bugfixes for Texinfo 5 when using deftypefnx in the middle of text.
* strel.m, colfilt.m, imnoise.m: since Texinfo, the @deftypefnx macro can
only be used right after a @deftypefn. When needed in the middle of the
text, we need to end the deftypefn and start a new one.
author | Carnë Draug <carandraug@octave.org> |
---|---|
date | Mon, 30 Sep 2013 16:47:58 +0100 |
parents | e02815bb7a54 |
children | faa1945e2d2b |
files | inst/@strel/strel.m inst/colfilt.m inst/imnoise.m |
diffstat | 3 files changed, 48 insertions(+), 27 deletions(-) [+] |
line wrap: on
line diff
--- a/inst/@strel/strel.m +++ b/inst/@strel/strel.m @@ -21,7 +21,8 @@ ## The structuring element can have any type of shape as specified by ## @var{shape}, each one with its @var{parameters}. ## -## @deftypefnx {Function File} {} strel ("arbitrary", @var{nhood}) +## @end deftypefn +## @deftypefn {Function File} {} strel ("arbitrary", @var{nhood}) ## @deftypefnx {Function File} {} strel ("arbitrary", @var{nhood}, @var{height}) ## Create arbitrary shaped structuring elements. ## @@ -45,65 +46,77 @@ ## @end group ## @end example ## -## @deftypefnx {Function File} {} strel ("ball", @var{radius}, @var{height}) +## @end deftypefn +## @deftypefn {Function File} {} strel ("ball", @var{radius}, @var{height}) ## Create ball shaped @var{nonflat} structuring element. @var{radius} must be a ## nonnegative integer that specifies the ray of a circle in X-Y plane. @var{height} ## is a real number that specifies the height of the center of the circle. ## -## @deftypefnx {Function File} {} strel ("cube", @var{edge}) +## @end deftypefn +## @deftypefn {Function File} {} strel ("cube", @var{edge}) ## Create cube shaped @var{flat} structuring element. @var{edge} must be a ## positive integer that specifies the length of its edges. This shape meant to ## perform morphology operations in volumes, see the square shape for 2 ## dimensional images. ## -## @deftypefnx {Function File} {} strel ("diamond", @var{radius}) +## @end deftypefn +## @deftypefn {Function File} {} strel ("diamond", @var{radius}) ## Create diamond shaped flat structuring element. @var{radius} must be a ## positive integer. ## -## @deftypefnx {Function File} {} strel ("disk", @var{radius}) +## @end deftypefn +## @deftypefn {Function File} {} strel ("disk", @var{radius}) ## Create disk shaped flat structuring element. @var{radius} must be a positive ## integer. ## -## @deftypefnx {Function File} {} strel ("hypercube", @var{n}, @var{edge}) +## @end deftypefn +## @deftypefn {Function File} {} strel ("hypercube", @var{n}, @var{edge}) ## Create @var{n} dimensional cube (n-cube) shaped @var{flat} structuring ## element. @var{edge} must be a positive integer that specifies the length ## of its edges. ## -## @deftypefnx {Function File} {} strel ("hyperrectangle", @var{dimensions}) +## @end deftypefn +## @deftypefn {Function File} {} strel ("hyperrectangle", @var{dimensions}) ## Create @var{n} dimensional hyperrectangle (or orthotope) shaped flat ## structuring element. @var{dimensions} must be a vector of positive ## integers with its lengtht at each of the dimensions. - -## @deftypefnx {Function File} {} strel ("line", @var{len}, @var{deg}) +## +## @end deftypefn +## @deftypefn {Function File} {} strel ("line", @var{len}, @var{deg}) ## Create line shaped flat structuring element. @var{len} must be a positive ## real number. @var{deg} must be a 1 or 2 elements real number, for a line in ## in 2D or 3D space. The first element of @var{deg} is the angle from X-axis ## to X-Y projection of the line while the second is the angle from Z-axis to ## the line. ## -## @deftypefnx {Function File} {} strel ("octagon", @var{apothem}) +## @end deftypefn +## @deftypefn {Function File} {} strel ("octagon", @var{apothem}) ## Create octagon shaped flat structuring element. @var{apothem} must be a ## positive integer that specifies the distance from the origin to the sides of ## the octagon. ## -## @deftypefnx {Function File} {} strel ("pair", @var{offset}) +## @end deftypefn +## @deftypefn {Function File} {} strel ("pair", @var{offset}) ## Create flat structuring element with two members. One member is placed ## at the origin while the other is placed with @var{offset} in relation to the ## origin. @var{offset} must then be a 2 element vector for the coordinates. ## -## @deftypefnx {Function File} {} strel ("periodicline", @var{p}, @var{v}) +## @end deftypefn +## @deftypefn {Function File} {} strel ("periodicline", @var{p}, @var{v}) ## Create periodic line shaped flat structuring element. A periodic line will ## be built with 2*@var{p}+1 points around the origin included. These points will ## be displaced in accordance with the offset @var{v} at distances: 1*@var{v}, ## -1*@var{v}, 2*@var{v}, -2*@var{v}, ..., @var{p}*@var{v}, -@var{p}*@var{v}. ## Therefore @var{v} must be a 2 element vector for the coordinates. ## -## @deftypefnx {Function File} {} strel ("rectangle", @var{dimensions}) +## @end deftypefn +## @deftypefn {Function File} {} strel ("rectangle", @var{dimensions}) ## Create rectangular shaped flat structuring element. @var{dimensions} must ## be a two element vector of positive integers with the number of rows and ## columns of the rectangle. ## -## @deftypefnx {Function File} {} strel ("square", @var{edge}) +## @end deftypefn +## @deftypefn {Function File} {} strel ("square", @var{edge}) ## Create square shaped flat structuring element. @var{edge} must be a positive ## integer that specifies the length of its edges. For use in volumes, see the ## cube shape.
--- a/inst/colfilt.m +++ b/inst/colfilt.m @@ -2,17 +2,14 @@ ## This program is granted to the public domain. ## -*- texinfo -*- -## @deftypefn {Function File} colfilt(@var{A}, [@var{r}, @var{c}], [@var{m}, @var{n}], 'sliding', @var{f},@dots{}) +## @deftypefn {Function File} {} colfilt (@var{A}, [@var{r} @var{c}], [@var{m} @var{n}], "sliding", @var{f}, @dots{}) +## @deftypefnx {Function File} {} colfilt (@var{A}, [@var{r} @var{c}], [@var{m} @var{n}], "sliding", @var{f}, @dots{}) +## @deftypefnx {Function File} {} colfilt (@var{A}, [@var{r} @var{c}], [@var{m} @var{n}], "sliding", @var{f}, @dots{}) ## Apply filter to matrix blocks ## ## For each @var{r} x @var{c} overlapping subblock of @var{A}, add a column in matrix @var{C} ## @var{f}(@var{C},@dots{}) should return a row vector which is then reshaped into a ## a matrix of size @var{A} and returned. @var{A} is processed in chunks of size @var{m} x @var{n}. -## @deftypefnx{Function File} colfilt(@var{A}, [@var{r}, @var{c}], [@var{m}, @var{n}], 'distinct', @var{f},@dots{}) -## For each @var{r} x @var{c} non-overlapping subblock of @var{A}, add a column in matrix @var{C} -## @var{f}(@var{C},@dots{}) should return a matrix of size @var{C} each column of which is -## placed back into the subblock from whence it came. @var{A} is processed -## in chunks of size @var{m} x @var{n}. ## ## The present version requires that [@var{m}, @var{n}] divide size(@var{A}), but for ## compatibility it should work even if [@var{m}, @var{n}] does not divide @var{A}. Use @@ -25,9 +22,16 @@ ## B = B(1:r,1:c); ## @end example ## -## The present version does not handle 'distinct' +## @seealso{bestblk, blockproc, col2im, im2col} ## @end deftypefn +## FIXME: distinct is not yet implemented +## @deftypefn {Function File} {} colfilt (@var{A}, [@var{r}, @var{c}], [@var{m}, @var{n}], 'distinct', @var{f},@dots{}) +## For each @var{r} x @var{c} non-overlapping subblock of @var{A}, add a column in matrix @var{C} +## @var{f}(@var{C},@dots{}) should return a matrix of size @var{C} each column of which is +## placed back into the subblock from whence it came. @var{A} is processed +## in chunks of size @var{m} x @var{n}. + function B = colfilt(A,filtsize,blksize,blktype,f,varargin) ## Input checking real_nargin = nargin - length(varargin);
--- a/inst/imnoise.m +++ b/inst/imnoise.m @@ -17,23 +17,27 @@ ## this program; if not, see <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @deftypefn {Function File} {@var{B} =} imnoise (@var{A}, @var{type}) -## @deftypefnx {Function File} {@var{B} =} imnoise (@dots{}, @var{options}) +## @deftypefn {Function File} {} imnoise (@var{A}, @var{type}) +## @deftypefnx {Function File} {} imnoise (@dots{}, @var{options}) ## Add noise to image. ## -## @deftypefnx {Function File} {@var{B} =} imnoise (@var{A}, "gaussian", @var{mean}, @var{variance}) +## @end deftypefn +## @deftypefn {Function File} {} imnoise (@var{A}, "gaussian", @var{mean}, @var{variance}) ## Additive gaussian noise with @var{mean} and @var{variance} defaulting to 0 ## and 0.01. ## -## @deftypefnx {Function File} {@var{B} =} imnoise (@var{A}, "poisson") +## @end deftypefn +## @deftypefn {Function File} {} imnoise (@var{A}, "poisson") ## Creates poisson noise in the image using the intensity value of each pixel as ## mean. ## -## @deftypefnx {Function File} {@var{B} =} imnoise (@var{A}, "salt & pepper", @var{density}) +## @end deftypefn +## @deftypefn {Function File} {} imnoise (@var{A}, "salt & pepper", @var{density}) ## Create "salt and pepper"/"lost pixels" in @var{density}*100 percent of the ## image. @var{density} defaults to 0.05. ## -## @deftypefnx {Function File} {@var{B} =} imnoise (@var{A}, "speckle", @var{variance}) +## @end deftypefn +## @deftypefn {Function File} {} imnoise (@var{A}, "speckle", @var{variance}) ## Multiplicative gaussian noise with @var{B} = @var{A} + @var{A} * noise with ## mean 0 and @var{variance} defaulting to 0.04. ##