HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
(Maximum, minimum, clamping)

Functions

ImageBuf OIIO_API ImageBufAlgo::max (Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
 
bool OIIO_API ImageBufAlgo::max (ImageBuf &dst, Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
 Write to an existing image dst (allocating if it is uninitialized). More...
 
ImageBuf OIIO_API ImageBufAlgo::min (Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
 
bool OIIO_API ImageBufAlgo::min (ImageBuf &dst, Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
 Write to an existing image dst (allocating if it is uninitialized). More...
 
ImageBuf OIIO_API ImageBufAlgo::clamp (const ImageBuf &src, cspan< float > min=-std::numeric_limits< float >::max(), cspan< float > max=std::numeric_limits< float >::max(), bool clampalpha01=false, ROI roi={}, int nthreads=0)
 
bool OIIO_API ImageBufAlgo::clamp (ImageBuf &dst, const ImageBuf &src, cspan< float > min=-std::numeric_limits< float >::max(), cspan< float > max=std::numeric_limits< float >::max(), bool clampalpha01=false, ROI roi={}, int nthreads=0)
 Write to an existing image dst (allocating if it is uninitialized). More...
 

Detailed Description

max() and min() take the pixel-by-pixel, channel-by-channel maximum and minimum of two images, or of an image and a constant.

clamp() restricts values of an image to the range between per-channel minimum and maximum constant values.

Function Documentation

ImageBuf OIIO_API ImageBufAlgo::clamp ( const ImageBuf src,
cspan< float min = -std::numeric_limits< float >::max(),
cspan< float max = std::numeric_limits< float >::max(),
bool  clampalpha01 = false,
ROI  roi = {},
int  nthreads = 0 
)

Return pixels of src with pixel values clamped as follows:

Parameters
minThe minimum clamp value for each channel. If min is empty, no minimum clamping is performed.
maxThe maximum clamp value for each channel. If max is empty, no maximum clamping is performed.
clampalpha01If true, then additionally any alpha channel is clamped to the 0-1 range.
bool OIIO_API ImageBufAlgo::clamp ( ImageBuf dst,
const ImageBuf src,
cspan< float min = -std::numeric_limits< float >::max(),
cspan< float max = std::numeric_limits< float >::max(),
bool  clampalpha01 = false,
ROI  roi = {},
int  nthreads = 0 
)

Write to an existing image dst (allocating if it is uninitialized).

ImageBuf OIIO_API ImageBufAlgo::max ( Image_or_Const  A,
Image_or_Const  B,
ROI  roi = {},
int  nthreads = 0 
)

Compute per-pixel max(A, B), returning the result image.

Either both A and B are images, or one is an image and the other is a cspan<float> giving a per-channel constant or a single constant used for all channels.

Examples:
alligator/alligator.C, packedshareddata/GU_PackedSharedData.C, packedshareddata/GU_PackedSharedData.h, packedsphere/GU_PackedSphere.C, packedsphere/GU_PackedSphere.h, PDG/PDG_ProcessorRandom.C, RAY/RAY_DemoSprite.C, SIM/SNOW_Solver.C, SIM/SNOW_Solver.h, TS/TS_cosKernel.C, and VOP/VOP_Switch.C.
bool OIIO_API ImageBufAlgo::max ( ImageBuf dst,
Image_or_Const  A,
Image_or_Const  B,
ROI  roi = {},
int  nthreads = 0 
)

Write to an existing image dst (allocating if it is uninitialized).

ImageBuf OIIO_API ImageBufAlgo::min ( Image_or_Const  A,
Image_or_Const  B,
ROI  roi = {},
int  nthreads = 0 
)

Compute per-pixel min(A, B), returning the result image.

Either both A and B are images, or one is an image and the other is a cspan<float> giving a per-channel constant or a single constant used for all channels.

Examples:
packedshareddata/GU_PackedSharedData.C, packedshareddata/GU_PackedSharedData.h, packedsphere/GU_PackedSphere.C, packedsphere/GU_PackedSphere.h, PDG/PDG_ProcessorRandom.C, RAY/RAY_DemoSprite.C, and TS/TS_cosKernel.C.
bool OIIO_API ImageBufAlgo::min ( ImageBuf dst,
Image_or_Const  A,
Image_or_Const  B,
ROI  roi = {},
int  nthreads = 0 
)

Write to an existing image dst (allocating if it is uninitialized).