Expand description
Functions and filters for the sampling of pixels.
Structs§
- Filter 🔒A Representation of a separable filter.
- Local struct for keeping track of pixel sums for fast thumbnail averaging
Enums§
- Available Sampling Filters.
Functions§
- Performs a Gaussian blur on the supplied image.
sigma
is a measure of how much to blur by. - Calculate the box kernel. Only pixels inside the box should be considered, and those contribute equally. So this method simply returns 1.
- Calculate the Catmull-Rom cubic spline. Also known as a form of
BiCubic
sampling in two dimensions. - Perform a 3x3 box filter on the supplied image.
kernel
is an array of the filter weights of length 9. - gaussian 🔒The Gaussian Function.
r
is the standard deviation. - Calculate the gaussian function with a standard deviation of 0.5
- Linearly sample from an image using coordinates in [0, w-1] and [0, h-1].
- Sample from an image using coordinates in [0, w-1] and [0, h-1], taking the nearest pixel.
- lanczos 🔒
- Calculate the lanczos kernel with a window of 3
- Resize the supplied image to the specified dimensions.
nwidth
andnheight
are the new dimensions.filter
is the sampling filter to use. - Linearly sample from an image using coordinates in [0, 1].
- Sample from an image using coordinates in [0, 1], taking the nearest coordinate.
- sinc 🔒
- Resize the supplied image to the specific dimensions.
- Get a pixel for a thumbnail where the input window encloses at least a full pixel.
- Get a single pixel for a thumbnail where the input window does not enclose any full pixel.
- Get a thumbnail pixel where the input window encloses at least a vertical pixel.
- Get a thumbnail pixel where the input window encloses at least a horizontal pixel.
- Calculate the triangle function. Also known as
BiLinear
sampling in two dimensions. - Performs an unsharpen mask on the supplied image.
sigma
is the amount to blur the image by.threshold
is the threshold for minimal brightness change that will be sharpened.