diff --git a/src/doc/oiiotool.rst b/src/doc/oiiotool.rst index 2d1f5eb540..0e253d2500 100644 --- a/src/doc/oiiotool.rst +++ b/src/doc/oiiotool.rst @@ -3129,8 +3129,8 @@ current top image. match on aspect ratio and centering (partial pixel shift if necessary), whereas the default (0) will only preserve aspect ratio and centering to the precision of a whole pixel. - - `wrap=` *w* : For "exact" aspect ratio fitting, this determines the - wrap mode used for the resizing kernel (default: `black`, other + - `wrap=` *wrapmode* : For "exact" aspect ratio fitting, this determines + the wrap mode used for the resizing kernel (default: `black`, other choices include `clamp`, `periodic`, `mirror`). Examples:: @@ -3256,6 +3256,10 @@ current top image. If nonzero, recompute the pixel data window to exactly hold the transformed image (default=0). + `:wrap=` *wrapmode* + The wrap mode to use when sampling the image for the warp. The default + is `black`; other choices include `clamp`, `periodic`, `mirror`. + `:subimages=` *indices-or-names* Include/exclude subimages (see :ref:`sec-oiiotool-subimage-modifier`). diff --git a/src/oiiotool/oiiotool.cpp b/src/oiiotool/oiiotool.cpp index a3677969fa..309e25f794 100644 --- a/src/oiiotool/oiiotool.cpp +++ b/src/oiiotool/oiiotool.cpp @@ -3645,10 +3645,11 @@ OIIOTOOL_OP(warp, 1, [](OiiotoolOp& op, span img) { std::string filtername = op.options()["filter"]; bool highlightcomp = op.options().get_int("highlightcomp"); bool recompute_roi = op.options().get_int("recompute_roi"); + std::string wrapname = op.options().get_string("wrap", "default"); std::vector M(9); if (Strutil::extract_from_list_string(M, op.args(1)) != 9) { ot.error(op.opname(), - "expected 9 comma-separatd floats to form a 3x3 matrix"); + "expected 9 comma-separated floats to form a 3x3 matrix"); return false; } bool ok = true; @@ -3661,8 +3662,9 @@ OIIOTOOL_OP(warp, 1, [](OiiotoolOp& op, span img) { ok &= ImageBufAlgo::rangecompress(tmpimg, *src); src = &tmpimg; } + ImageBuf::WrapMode wrap = ImageBuf::WrapMode_from_string(wrapname); ok &= ImageBufAlgo::warp(*img[0], *src, *(Imath::M33f*)&M[0], filtername, - 0.0f, recompute_roi, ImageBuf::WrapDefault); + 0.0f, recompute_roi, wrap); if (highlightcomp && ok) { // re-expand the range in place ok &= ImageBufAlgo::rangeexpand(*img[0], *img[0]);