Skip to content

Commit 4a56261

Browse files
committed
revise docs in histogram
1 parent 0407285 commit 4a56261

File tree

10 files changed

+45
-38
lines changed

10 files changed

+45
-38
lines changed

doc/rename.sed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ s/vips_\(stats\)()/[method@Image.\1]/g
396396
s/vips_\(stdif\)()/[method@Image.\1]/g
397397
s/vips_\(subsample\)()/[method@Image.\1]/g
398398
s/vips_\(subtract\)()/[method@Image.\1]/g
399+
s/vips_\(switch\)()/[func@Image.\1]/g
399400
s/vips_\(tanh\)()/[method@Image.\1]/g
400401
s/vips_\(tan\)()/[method@Image.\1]/g
401402
s/vips_\(text\)()/[ctor@Image.\1]/g

libvips/histogram/case.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,11 @@ vips_casev(VipsImage *index, VipsImage **cases, VipsImage **out, int n,
290290
* The output image is the same size as @index. Images in @cases are
291291
* expanded to the smallest common format and number of bands.
292292
*
293-
* Combine this with vips_switch() to make something like a case statement or
294-
* a multi-way vips_ifthenelse().
293+
* Combine this with [method@Image.switch] to make something like a case statement or
294+
* a multi-way [method@Image.ifthenelse].
295295
*
296-
* See also: vips_maplut(), vips_switch(), vips_ifthenelse().
296+
* ::: seealso
297+
* [method@Image.maplut], [method@Image.switch], [method@Image.ifthenelse].
297298
*
298299
* Returns: 0 on success, -1 on error
299300
*/

libvips/histogram/hist_cum.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@ vips_hist_cum_init(VipsHistCum *hist_cum)
174174
*
175175
* Form cumulative histogram.
176176
*
177-
* See also: vips_hist_norm().
177+
* ::: seealso
178+
* [method@Image.hist_norm].
178179
*
179180
* Returns: 0 on success, -1 on error
180181
*/

libvips/histogram/hist_equal.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,14 @@ vips_hist_equal_init(VipsHistEqual *equal)
142142
* @out: (out): output image
143143
* @...: %NULL-terminated list of optional named arguments
144144
*
145-
* Optional arguments:
145+
* Histogram-equalise @in.
146146
*
147-
* * @band: band to equalise
148-
*
149-
* Histogram-equalise @in. Equalise using band @bandno, or if @bandno is -1,
147+
* Equalise using band @bandno, or if @bandno is -1,
150148
* equalise bands independently. The output format is always the same as the
151149
* input format.
152150
*
153-
* See also:
151+
* ::: tip "Optional arguments"
152+
* * @band: %gint, band to equalise
154153
*
155154
* Returns: 0 on success, -1 on error
156155
*/

libvips/histogram/hist_local.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -404,10 +404,6 @@ vips_hist_local_init(VipsHistLocal *local)
404404
* @height: height of region
405405
* @...: %NULL-terminated list of optional named arguments
406406
*
407-
* Optional arguments:
408-
*
409-
* * @max_slope: maximum brightening
410-
*
411407
* Performs local histogram equalisation on @in using a
412408
* window of size @width by @height centered on the input pixel.
413409
*
@@ -419,7 +415,11 @@ vips_hist_local_init(VipsHistLocal *local)
419415
* performed. A value of 3 is often used. Local histogram equalization with
420416
* contrast limiting is usually called CLAHE.
421417
*
422-
* See also: vips_hist_equal().
418+
* ::: tip "Optional arguments"
419+
* * @max_slope: %gint, maximum brightening
420+
*
421+
* ::: seealso
422+
* [method@Image.hist_equal].
423423
*
424424
* Returns: 0 on success, -1 on error
425425
*/

libvips/histogram/hist_match.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,9 @@ vips_hist_match_init(VipsHistMatch *match)
186186
* cumulative histograms, @out will be a LUT that adjusts the PDF of the image
187187
* from which @in was made to match the PDF of @ref's image.
188188
*
189-
* See also: vips_maplut(), vips_hist_find(), vips_hist_norm(),
190-
* vips_hist_cum().
189+
* ::: seealso
190+
* [method@Image.maplut], [method@Image.hist_find], [method@Image.hist_norm],
191+
* [method@Image.hist_cum].
191192
*
192193
* Returns: 0 on success, -1 on error
193194
*/

libvips/histogram/hist_norm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ vips_hist_norm_init(VipsHistNorm *hist_norm)
165165
* index, so for example the max for a uchar image becomes 255.
166166
* Normalise each band separately.
167167
*
168-
* See also: vips_hist_cum().
168+
* ::: seealso
169+
* [method@Image.hist_cum].
169170
*
170171
* Returns: 0 on success, -1 on error
171172
*/

libvips/histogram/maplut.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -779,10 +779,6 @@ vips_maplut_init(VipsMaplut *maplut)
779779
* @lut: look-up table
780780
* @...: %NULL-terminated list of optional named arguments
781781
*
782-
* Optional arguments:
783-
*
784-
* * @band: apply one-band @lut to this band of @in
785-
*
786782
* Map an image through another image acting as a LUT (Look Up Table).
787783
* The lut may have any type and the output image will be that type.
788784
*
@@ -804,7 +800,11 @@ vips_maplut_init(VipsMaplut *maplut)
804800
* separately. If @in has one band, then @lut may have many bands and
805801
* the output will have the same number of bands as @lut.
806802
*
807-
* See also: vips_hist_find(), vips_identity().
803+
* ::: tip "Optional arguments"
804+
* * @band: %gint, apply one-band @lut to this band of @in
805+
*
806+
* ::: seealso
807+
* [method@Image.hist_find], [ctor@Image.identity].
808808
*
809809
* Returns: 0 on success, -1 on error
810810
*/

libvips/histogram/percent.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ vips_percent_init(VipsPercent *percent)
138138
* @threshold: (out): output threshold value
139139
* @...: %NULL-terminated list of optional named arguments
140140
*
141-
* vips_percent() returns (through the @threshold parameter) the threshold
141+
* [method@Image.percent] returns (through the @threshold parameter) the threshold
142142
* below which there are @percent values of @in. For example:
143143
*
144144
* |[
@@ -151,7 +151,8 @@ vips_percent_init(VipsPercent *percent)
151151
* The function works for uchar and ushort images only. It can be used
152152
* to threshold the scaled result of a filtering operation.
153153
*
154-
* See also: vips_hist_find(), vips_profile().
154+
* ::: seealso
155+
* [method@Image.hist_find], [method@Image.profile].
155156
*
156157
* Returns: 0 on success, -1 on error
157158
*/

libvips/histogram/stdif.c

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -366,25 +366,20 @@ vips_stdif_init(VipsStdif *stdif)
366366
* @height: height of region
367367
* @...: %NULL-terminated list of optional named arguments
368368
*
369-
* Optional arguments:
369+
* [method@Image.stdif] performs statistical differencing according to the
370+
* formula given in page 45 of the book "An Introduction to Digital Image
371+
* Processing" by Wayne Niblack.
370372
*
371-
* * @a: weight of new mean
372-
* * @m0: target mean
373-
* * @b: weight of new deviation
374-
* * @s0: target deviation
375-
*
376-
* vips_stdif() performs statistical differencing according to the formula
377-
* given in page 45 of the book "An Introduction to Digital Image
378-
* Processing" by Wayne Niblack. This transformation emphasises the way in
373+
* This transformation emphasises the way in
379374
* which a pel differs statistically from its neighbours. It is useful for
380375
* enhancing low-contrast images with lots of detail, such as X-ray plates.
381376
*
382377
* At point (i,j) the output is given by the equation:
383378
*
384-
* |[
379+
* ```
385380
* vout(i,j) = @a * @m0 + (1 - @a) * meanv +
386381
* (vin(i,j) - meanv) * (@b * @s0) / (@s0 + @b * stdv)
387-
* ]|
382+
* ```
388383
*
389384
* Values @a, @m0, @b and @s0 are entered, while meanv and stdv are the values
390385
* calculated over a moving window of size @width, @height centred on pixel
@@ -393,15 +388,22 @@ vips_stdif_init(VipsStdif *stdif)
393388
*
394389
* Try:
395390
*
396-
* |[
391+
* ```
397392
* vips stdif $VIPSHOME/pics/huysum.v fred.v 0.5 128 0.5 50 11 11
398-
* ]|
393+
* ```
399394
*
400395
* The operation works on one-band uchar images only, and writes a one-band
401396
* uchar image as its result. The output image has the same size as the
402397
* input.
403398
*
404-
* See also: vips_hist_local().
399+
* ::: tip "Optional arguments"
400+
* * @a: %gdouble, weight of new mean
401+
* * @m0: %gdouble, target mean
402+
* * @b: %gdouble, weight of new deviation
403+
* * @s0: %gdouble, target deviation
404+
*
405+
* ::: seealso
406+
* [method@Image.hist_local].
405407
*
406408
* Returns: 0 on success, -1 on error
407409
*/

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy