@@ -2535,24 +2535,27 @@ Image Enhancement / Restoration
25352535
25362536 Examples:
25372537
2538- .. tabs ::
2539-
2540- .. code-tab :: c++
2538+ .. tabs ::
25412539
2542- ImageBuf Src ("tahoe.exr");
2543- int pixelsFixed = 0;
2544- ImageBufAlgo::fixNonFinite (Src, Src, ImageBufAlgo::NONFINITE_BOX3,
2545- &pixelsFixed);
2546- std::cout << "Repaired " << pixelsFixed << " non-finite pixels\n ";
2540+ .. tab :: C++
2541+ .. literalinclude :: ../../testsuite/docs-examples-cpp/src/docs-examples-imagebufalgo.cpp
2542+ :language: c++
2543+ :start-after: BEGIN-imagebufalgo-fixNonFinite
2544+ :end-before: END-imagebufalgo-fixNonFinite
2545+ :dedent: 4
25472546
2548- .. code-tab :: py
2547+ .. tab :: Python
2548+ .. literalinclude :: ../../testsuite/docs-examples-python/src/docs-examples-imagebufalgo.py
2549+ :language: py
2550+ :start-after: BEGIN-imagebufalgo-fixNonFinite
2551+ :end-before: END-imagebufalgo-fixNonFinite
2552+ :dedent: 4
25492553
2550- Src = ImageBuf("tahoe.exr")
2551- ImageBufAlgo.fixNonFinite (Src, Src, "box3", oiio.NONFINITE_BOX3)
2554+ .. tab :: oiiotool
2555+ .. sourcecode :: bash
25522556
2553- .. code-tab :: bash oiiotool
2557+ oiiotool with_nans.tif --fixnan box3 -o with_nans_fixed.tif
25542558
2555- oiiotool tahoe.exr --fixnan box3 -o fixed.exr
25562559
25572560|
25582561
@@ -2564,21 +2567,27 @@ Image Enhancement / Restoration
25642567
25652568 Examples:
25662569
2567- .. tabs ::
25682570
2569- .. code-tab :: c++
2570-
2571- ImageBuf Src ("holes.exr");
2572- ImageBuf Filled = ImageBufAlgo::fillholes_pushpull (Src);
2571+ .. tabs ::
25732572
2574- .. code-tab :: py
2573+ .. tab :: C++
2574+ .. literalinclude :: ../../testsuite/docs-examples-cpp/src/docs-examples-imagebufalgo.cpp
2575+ :language: c++
2576+ :start-after: BEGIN-imagebufalgo-fillholes_pushpull
2577+ :end-before: END-imagebufalgo-fillholes_pushpull
2578+ :dedent: 4
25752579
2576- Src = ImageBuf("holes.exr")
2577- Filled = ImageBufAlgo.fillholes_pushpull (Src)
2580+ .. tab :: Python
2581+ .. literalinclude :: ../../testsuite/docs-examples-python/src/docs-examples-imagebufalgo.py
2582+ :language: py
2583+ :start-after: BEGIN-imagebufalgo-fillholes_pushpull
2584+ :end-before: END-imagebufalgo-fillholes_pushpull
2585+ :dedent: 4
25782586
2579- .. code-tab :: bash oiiotool
2587+ .. tab :: oiiotool
2588+ .. sourcecode :: bash
25802589
2581- oiiotool holes .exr --fillholes -o filled .exr
2590+ oiiotool checker_with_alpha .exr --fillholes -o checker_with_alpha_filled .exr
25822591
25832592|
25842593
@@ -2590,21 +2599,27 @@ Image Enhancement / Restoration
25902599
25912600 Examples:
25922601
2593- .. tabs ::
2594-
2595- .. code-tab :: c++
25962602
2597- ImageBuf Noisy ("tahoe.exr");
2598- ImageBuf Clean = ImageBufAlgo::median_filter (Noisy, 3, 3);
2603+ .. tabs ::
25992604
2600- .. code-tab :: py
2605+ .. tab :: C++
2606+ .. literalinclude :: ../../testsuite/docs-examples-cpp/src/docs-examples-imagebufalgo.cpp
2607+ :language: c++
2608+ :start-after: BEGIN-imagebufalgo-median_filter
2609+ :end-before: END-imagebufalgo-median_filter
2610+ :dedent: 4
26012611
2602- Noisy = ImageBuf("tahoe.exr")
2603- Clean = ImageBufAlgo.median_filter (Noisy, 3, 3)
2612+ .. tab :: Python
2613+ .. literalinclude :: ../../testsuite/docs-examples-python/src/docs-examples-imagebufalgo.py
2614+ :language: py
2615+ :start-after: BEGIN-imagebufalgo-median_filter
2616+ :end-before: END-imagebufalgo-median_filter
2617+ :dedent: 4
26042618
2605- .. code-tab :: bash oiiotool
2619+ .. tab :: oiiotool
2620+ .. sourcecode :: bash
26062621
2607- oiiotool tahoe.exr --median 3x3 -o clean.exr
2622+ oiiotool tahoe.tif --median 3x3 -o tahoe_median_filter.tif
26082623
26092624..
26102625
@@ -2633,21 +2648,26 @@ Image Enhancement / Restoration
26332648
26342649 Examples:
26352650
2636- .. tabs ::
2637-
2638- .. code-tab :: c++
2639-
2640- ImageBuf Blurry ("tahoe.exr");
2641- ImageBuf Sharp = ImageBufAlgo::unsharp_mask (Blurry, "gaussian", 5.0f);
2651+ .. tabs ::
26422652
2643- .. code-tab :: py
2653+ .. tab :: C++
2654+ .. literalinclude :: ../../testsuite/docs-examples-cpp/src/docs-examples-imagebufalgo.cpp
2655+ :language: c++
2656+ :start-after: BEGIN-imagebufalgo-unsharp_mask
2657+ :end-before: END-imagebufalgo-unsharp_mask
2658+ :dedent: 4
26442659
2645- Blurry ImageBuf("tahoe.exr")
2646- Sharp = ImageBufAlgo.unsharp_mask (Blurry, "gaussian", 5.0)
2660+ .. tab :: Python
2661+ .. literalinclude :: ../../testsuite/docs-examples-python/src/docs-examples-imagebufalgo.py
2662+ :language: py
2663+ :start-after: BEGIN-imagebufalgo-unsharp_mask
2664+ :end-before: END-imagebufalgo-unsharp_mask
2665+ :dedent: 4
26472666
2648- .. code-tab :: bash oiiotool
2667+ .. tab :: oiiotool
2668+ .. sourcecode :: bash
26492669
2650- oiiotool tahoe.exr --unsharp:kernel=gaussian: width=5 -o sharp.exr
2670+ oiiotool tahoe.tif --unsharp:kernel=gaussian: width=5 -o tahoe_unsharp_mask.tif
26512671
26522672|
26532673
0 commit comments