Skip to content

Commit 75e6906

Browse files
committed
improve morph docs
1 parent 9713a71 commit 75e6906

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

libvips/morphology/morphology.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,19 +80,23 @@
8080
* mask must have odd length sides --- the origin of the mask is taken to be
8181
* the centre value. For example, the mask:
8282
*
83-
* 3 3
84-
* 128 255 128
85-
* 255 0 255
86-
* 128 255 128
83+
* VipsImage *mask = vips_image_new_matrixv( 3, 3,
84+
* 128.0, 255.0, 128.0,
85+
* 255.0, 255.0, 255.0,
86+
* 128.0, 255.0, 128.0 );
8787
*
88-
* applied to an image with vips_morph() #VIPS_OPERATION_MORPHOLOGY_ERODE, will
89-
* find all black pixels
90-
* 4-way connected with white pixels. Essentially, dilate
91-
* sets pixels in the output if any part of the mask matches, whereas
88+
* applied to an image with vips_morph() #VIPS_OPERATION_MORPHOLOGY_DILATE will
89+
* do a 4-connected dilation.
90+
*
91+
* Dilate sets pixels in the output if any part of the mask matches, whereas
9292
* erode sets pixels only if all of the mask matches.
9393
*
9494
* See vips_andimage(), vips_orimage() and vips_eorimage()
9595
* for analogues of the usual set difference and set union operations.
96+
*
97+
* Use vips_image_new_matrixv() to create a mask in source, vips_matrixload()
98+
* to load a mask from a simple text file, vips_mask_ideal() and friends to
99+
* create squarem circular and ring masks of specific sizes.
96100
*/
97101

98102
G_DEFINE_ABSTRACT_TYPE( VipsMorphology, vips_morphology,

0 commit comments

Comments
 (0)