Expand description
Functions and filters for the sampling of pixels.
Structsยง
- Filter ๐
- A Representation of a separable filter.
- Float
Nearest ๐ - Thumbnail
Sum ๐ - Local struct for keeping track of pixel sums for fast thumbnail averaging
Enumsยง
- Filter
Type - Available Sampling Filters.
Functionsยง
- bc_
cubic_ ๐spline - blur
- Performs a Gaussian blur on the supplied image.
sigma
is a measure of how much to blur by. Usecrate::imageops::fast_blur()
for a faster but less accurate version. This method assumes alpha pre-multiplication for images that contain non-constant alpha. - box_
kernel ๐ - Calculate the box kernel. Only pixels inside the box should be considered, and those contribute equally. So this method simply returns 1.
- catmullrom_
kernel ๐ - Calculate the Catmull-Rom cubic spline.
Also known as a form of
BiCubic
sampling in two dimensions. - filter3x3
- 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. - gaussian_
kernel ๐ - Calculate the gaussian function with a standard deviation of 0.5
- horizontal_
sample ๐ - interpolate_
bilinear - Linearly sample from an image using coordinates in [0, w-1] and [0, h-1].
- interpolate_
nearest - Sample from an image using coordinates in [0, w-1] and [0, h-1], taking the nearest pixel.
- lanczos ๐
- lanczos3_
kernel ๐ - Calculate the lanczos kernel with a window of 3
- resize
- Resize the supplied image to the specified dimensions.
nwidth
andnheight
are the new dimensions.filter
is the sampling filter to use. This method assumes alpha pre-multiplication for images that contain non-constant alpha. - sample_
bilinear - Linearly sample from an image using coordinates in [0, 1].
- sample_
nearest - Sample from an image using coordinates in [0, 1], taking the nearest coordinate.
- sinc ๐
- thumbnail
- Resize the supplied image to the specific dimensions.
- thumbnail_
sample_ ๐block - Get a pixel for a thumbnail where the input window encloses at least a full pixel.
- thumbnail_
sample_ ๐fraction_ both - Get a single pixel for a thumbnail where the input window does not enclose any full pixel.
- thumbnail_
sample_ ๐fraction_ horizontal - Get a thumbnail pixel where the input window encloses at least a vertical pixel.
- thumbnail_
sample_ ๐fraction_ vertical - Get a thumbnail pixel where the input window encloses at least a horizontal pixel.
- triangle_
kernel ๐ - Calculate the triangle function.
Also known as
BiLinear
sampling in two dimensions. - unsharpen
- 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. - vertical_
sample ๐