Skip to content

Commit b3882e0

Browse files
committed
revise doc comments in draw
1 parent b7cc42c commit b3882e0

File tree

9 files changed

+83
-66
lines changed

9 files changed

+83
-66
lines changed

doc/rename.sed

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,7 @@ s/vips_\(zoom\)()/[method@Image.\1]/g
409409
s/vips_\([^(]*\)()/[func@\1]/g
410410

411411
s/#Vips\(SdfShape\)/[enum@\1]/g
412+
s/#Vips\(CombineMode\)/[enum@\1]/g
412413
s/#Vips\(Access\)/[enum@\1]/g
413414
s/#Vips\(BandFormat\)/[enum@\1]/g
414415
s/#Vips\(Interpretation\)/[enum@\1]/g
@@ -445,6 +446,7 @@ s/#Vips\(ThreadpoolAllocateFn\)/[callback@\1]/g
445446
s/#Vips\(ThreadpoolWorkFn\)/[callback@\1]/g
446447
s/#Vips\(ThreadpoolProgressFn\)/[callback@\1]/g
447448

449+
s/#VIPS_COMBINE_MODE_\([^ ,.]*\)/[enum@Vips.CombineMode.\1]/g
448450
s/#VIPS_SDF_SHAPE_\([^ ,.]*\)/[enum@Vips.SdfShape.\1]/g
449451
s/#VIPS_OPERATION_MATH_\([^ ,.]*\)/[enum@Vips.OperationMath.\1]/g
450452
s/#VIPS_OPERATION_MATH2_\([^ ,.]*\)/[enum@Vips.OperationMath2.\1]/g

libvips/draw/draw.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,13 @@
5050
* @VIPS_COMBINE_MODE_SET: set pixels to the new value
5151
* @VIPS_COMBINE_MODE_ADD: add pixels
5252
*
53-
* See vips_draw_image() and so on.
53+
* See [method@Image.draw_image] and so on.
5454
*
55-
* Operations like vips_draw_image() need to be told how to combine images
55+
* Operations like [method@Image.draw_image] need to be told how to combine images
5656
* from two sources.
5757
*
58-
* See also: vips_join().
58+
* ::: seealso
59+
* [method@Image.join].
5960
*/
6061

6162
G_DEFINE_ABSTRACT_TYPE(VipsDraw, vips_draw, VIPS_TYPE_OPERATION);

libvips/draw/draw_circle.c

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -290,16 +290,18 @@ vips_draw_circlev(VipsImage *image,
290290
* @radius: draw_circle radius
291291
* @...: %NULL-terminated list of optional named arguments
292292
*
293-
* Optional arguments:
293+
* Draws a circle on @image.
294294
*
295-
* * @fill: fill the draw_circle
296-
*
297-
* Draws a circle on @image. If @fill is %TRUE then the circle is filled,
295+
* If @fill is %TRUE then the circle is filled,
298296
* otherwise a 1-pixel-wide perimeter is drawn.
299297
*
300298
* @ink is an array of double containing values to draw.
301299
*
302-
* See also: vips_draw_circle1(), vips_draw_line().
300+
* ::: tip "Optional arguments"
301+
* * @fill: %gboolean, fill the draw_circle
302+
*
303+
* ::: seealso
304+
* [method@Image.draw_circle1], [method@Image.draw_line].
303305
*
304306
* Returns: 0 on success, or -1 on error.
305307
*/
@@ -326,13 +328,13 @@ vips_draw_circle(VipsImage *image,
326328
* @radius: draw_circle radius
327329
* @...: %NULL-terminated list of optional named arguments
328330
*
329-
* Optional arguments:
330-
*
331-
* * @fill: fill the draw_circle
331+
* As [method@Image.draw_circle], but just takes a single double for @ink.
332332
*
333-
* As vips_draw_circle(), but just takes a single double for @ink.
333+
* ::: tip "Optional arguments"
334+
* * @fill: %gboolean, fill the draw_circle
334335
*
335-
* See also: vips_draw_circle().
336+
* ::: seealso
337+
* [method@Image.draw_circle].
336338
*
337339
* Returns: 0 on success, or -1 on error.
338340
*/

libvips/draw/draw_flood.c

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ typedef struct _Buffer {
103103
} Buffer;
104104

105105
/* What we track during a flood. We have this in a separate struct so that we
106-
* can support vips__draw_flood_direct() ... a fast path for
107-
* vips_labelregions() that avoids all of the GObject call overhead. This
106+
* can support [func@_draw_flood_direct] ... a fast path for
107+
* [method@Image.labelregions] that avoids all of the GObject call overhead. This
108108
* gives a huge speedup, >x10 in many cases.
109109
*/
110110
typedef struct _Flood {
@@ -623,7 +623,7 @@ vips_draw_flood_init(VipsDrawFlood *draw_flood)
623623
{
624624
}
625625

626-
/* Direct path to flood for vips_labelregions(). We need to avoid the function
626+
/* Direct path to flood for [method@Image.labelregions]. We need to avoid the function
627627
* dispatch system for speed.
628628
*
629629
* Equivalent to:
@@ -696,16 +696,9 @@ vips_draw_floodv(VipsImage *image,
696696
* @y: centre of circle
697697
* @...: %NULL-terminated list of optional named arguments
698698
*
699-
* Optional arguments:
699+
* Flood-fill @image with @ink, starting at position @x, @y.
700700
*
701-
* * @test: test this image
702-
* * @equal: fill while equal to edge
703-
* * @left: output left edge of bounding box of modified area
704-
* * @top: output top edge of bounding box of modified area
705-
* * @width: output width of bounding box of modified area
706-
* * @height: output height of bounding box of modified area
707-
*
708-
* Flood-fill @image with @ink, starting at position @x, @y. The filled area is
701+
* The filled area is
709702
* bounded by pixels that are equal to the ink colour, in other words, it
710703
* searches for pixels enclosed by an edge of @ink.
711704
*
@@ -719,9 +712,18 @@ vips_draw_floodv(VipsImage *image,
719712
* @left, @top, @width, @height output the bounding box of the modified
720713
* pixels.
721714
*
715+
* ::: tip "Optional arguments"
716+
* * @test: [class@Image], test this image
717+
* * @equal: %gboolean, fill while equal to edge
718+
* * @left: %gint, output left edge of bounding box of modified area
719+
* * @top: %gint, output top edge of bounding box of modified area
720+
* * @width: %gint, output width of bounding box of modified area
721+
* * @height: %gint, output height of bounding box of modified area
722+
*
722723
* @ink is an array of double containing values to draw.
723724
*
724-
* See also: vips_draw_flood1().
725+
* ::: seealso
726+
* [method@Image.draw_flood1].
725727
*
726728
* Returns: 0 on success, or -1 on error.
727729
*/
@@ -747,18 +749,18 @@ vips_draw_flood(VipsImage *image,
747749
* @y: centre of circle
748750
* @...: %NULL-terminated list of optional named arguments
749751
*
750-
* Optional arguments:
751-
*
752-
* * @test: test this image
753-
* * @equal: fill while equal to edge
754-
* * @left: output left edge of bounding box of modified area
755-
* * @top: output top edge of bounding box of modified area
756-
* * @width: output width of bounding box of modified area
757-
* * @height: output height of bounding box of modified area
752+
* As [method@Image.draw_flood], but just takes a single double for @ink.
758753
*
759-
* As vips_draw_flood(), but just takes a single double for @ink.
754+
* ::: tip "Optional arguments"
755+
* * @test: [class@Image], test this image
756+
* * @equal: %gboolean, fill while equal to edge
757+
* * @left: %gint, output left edge of bounding box of modified area
758+
* * @top: %gint, output top edge of bounding box of modified area
759+
* * @width: %gint, output width of bounding box of modified area
760+
* * @height: %gint, output height of bounding box of modified area
760761
*
761-
* See also: vips_draw_flood().
762+
* ::: seealso
763+
* [method@Image.draw_flood].
762764
*
763765
* Returns: 0 on success, or -1 on error.
764766
*/

libvips/draw/draw_image.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -307,19 +307,21 @@ vips_draw_image_init(VipsDrawImage *draw_image)
307307
* @y: draw @sub here
308308
* @...: %NULL-terminated list of optional named arguments
309309
*
310-
* Optional arguments:
310+
* Draw @sub on top of @image at position @x, @y.
311311
*
312-
* * @mode: how to combine pixels
313-
*
314-
* Draw @sub on top of @image at position @x, @y. The two images must have the
312+
* The two images must have the
315313
* same Coding. If @sub has 1 band, the bands will be duplicated to match the
316314
* number of bands in @image. @sub will be converted to @image's format, see
317-
* vips_cast().
315+
* [method@Image.cast].
318316
*
319317
* Use @mode to set how pixels are combined. If you use
320-
* #VIPS_COMBINE_MODE_ADD, both images muct be uncoded.
318+
* [enum@Vips.CombineMode.ADD], both images must be uncoded.
319+
*
320+
* ::: tip "Optional arguments"
321+
* * @mode: [enum@CombineMode], how to combine pixels
321322
*
322-
* See also: vips_draw_mask(), vips_insert().
323+
* ::: seealso
324+
* [method@Image.draw_mask], [method@Image.insert].
323325
*
324326
* Returns: 0 on success, or -1 on error.
325327
*/

libvips/draw/draw_line.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,8 @@ vips_draw_linev(VipsImage *image,
344344
*
345345
* @ink is an array of double containing values to draw.
346346
*
347-
* See also: vips_draw_line1(), vips_draw_circle(), vips_draw_mask().
347+
* ::: seealso
348+
* [method@Image.draw_line1], [method@Image.draw_circle], [method@Image.draw_mask].
348349
*
349350
* Returns: 0 on success, or -1 on error.
350351
*/
@@ -372,9 +373,10 @@ vips_draw_line(VipsImage *image,
372373
* @y2: end of draw_line
373374
* @...: %NULL-terminated list of optional named arguments
374375
*
375-
* As vips_draw_line(), but just take a single double for @ink.
376+
* As [method@Image.draw_line], but just take a single double for @ink.
376377
*
377-
* See also: vips_draw_line().
378+
* ::: seealso
379+
* [method@Image.draw_line].
378380
*
379381
* Returns: 0 on success, or -1 on error.
380382
*/

libvips/draw/draw_mask.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -381,12 +381,13 @@ vips_draw_maskv(VipsImage *image,
381381
*
382382
* Draw @mask on the image. @mask is a monochrome 8-bit image with 0/255
383383
* for transparent or @ink coloured points. Intermediate values blend the ink
384-
* with the pixel. Use with vips_text() to draw text on an image. Use in a
385-
* vips_draw_line() subclass to draw an object along a line.
384+
* with the pixel. Use with [ctor@Image.text] to draw text on an image. Use in a
385+
* [method@Image.draw_line] subclass to draw an object along a line.
386386
*
387387
* @ink is an array of double containing values to draw.
388388
*
389-
* See also: vips_text(), vips_draw_line().
389+
* ::: seealso
390+
* [ctor@Image.text], [method@Image.draw_line].
390391
*
391392
* Returns: 0 on success, or -1 on error.
392393
*/
@@ -413,9 +414,10 @@ vips_draw_mask(VipsImage *image,
413414
* @y: draw mask here
414415
* @...: %NULL-terminated list of optional named arguments
415416
*
416-
* As vips_draw_mask(), but just takes a single double for @ink.
417+
* As [method@Image.draw_mask], but just takes a single double for @ink.
417418
*
418-
* See also: vips_draw_mask().
419+
* ::: seealso
420+
* [method@Image.draw_mask].
419421
*
420422
* Returns: 0 on success, or -1 on error.
421423
*/

libvips/draw/draw_rect.c

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -237,14 +237,15 @@ vips_draw_rectv(VipsImage *image,
237237
* @height: area to paint
238238
* @...: %NULL-terminated list of optional named arguments
239239
*
240-
* Optional arguments:
240+
* Paint pixels within @left, @top, @width, @height in @image with @ink.
241241
*
242-
* * @fill: fill the rect
242+
* If @fill is zero, just paint a 1-pixel-wide outline.
243243
*
244-
* Paint pixels within @left, @top, @width, @height in @image with @ink. If
245-
* @fill is zero, just paint a 1-pixel-wide outline.
244+
* ::: tip "Optional arguments"
245+
* * @fill: %gboolean, fill the rect
246246
*
247-
* See also: vips_draw_circle().
247+
* ::: seealso
248+
* [method@Image.draw_circle].
248249
*
249250
* Returns: 0 on success, or -1 on error.
250251
*/
@@ -273,13 +274,13 @@ vips_draw_rect(VipsImage *image,
273274
* @height: area to paint
274275
* @...: %NULL-terminated list of optional named arguments
275276
*
276-
* Optional arguments:
277+
* As [method@Image.draw_rect], but just take a single double for @ink.
277278
*
278-
* * @fill: fill the rect
279+
* ::: tip "Optional arguments"
280+
* * @fill: %gboolean, fill the rect
279281
*
280-
* As vips_draw_rect(), but just take a single double for @ink.
281-
*
282-
* See also: vips_draw_rect().
282+
* ::: seealso
283+
* [method@Image.draw_rect].
283284
*
284285
* Returns: 0 on success, or -1 on error.
285286
*/
@@ -310,9 +311,10 @@ vips_draw_rect1(VipsImage *image,
310311
* @y: point to paint
311312
* @...: %NULL-terminated list of optional named arguments
312313
*
313-
* As vips_draw_rect(), but draw a single pixel at @x, @y.
314+
* As [method@Image.draw_rect], but draw a single pixel at @x, @y.
314315
*
315-
* See also: vips_draw_rect().
316+
* ::: seealso
317+
* [method@Image.draw_rect].
316318
*
317319
* Returns: 0 on success, or -1 on error.
318320
*/
@@ -337,9 +339,10 @@ vips_draw_point(VipsImage *image, double *ink, int n, int x, int y, ...)
337339
* @y: point to draw
338340
* @...: %NULL-terminated list of optional named arguments
339341
*
340-
* As vips_draw_point(), but just take a single double for @ink.
342+
* As [method@Image.draw_point], but just take a single double for @ink.
341343
*
342-
* See also: vips_draw_point().
344+
* ::: seealso
345+
* [method@Image.draw_point].
343346
*
344347
* Returns: 0 on success, or -1 on error.
345348
*/

libvips/draw/draw_smudge.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,8 @@ vips_draw_smudge_init(VipsDrawSmudge *draw_smudge)
257257
* Smudge a section of @image. Each pixel in the area @left, @top, @width,
258258
* @height is replaced by the average of the surrounding 3x3 pixels.
259259
*
260-
* See also: vips_draw_line().
260+
* ::: seealso
261+
* [method@Image.draw_line].
261262
*
262263
* Returns: 0 on success, or -1 on error.
263264
*/

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