Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Crop ¶
Crop crops the provided region of the BMP found in the input stream to the output stream.
The input BMP must be bottom-up, no alpha, and uncompressed.
Thanks to the simplicity of the BMP format, crop uses a very small amount of memory (~8KiB).
If src is an io.ReadSeeker, then the cropper will seek to skip pixels that are outside the cropping region.
Cropping complexity scales primarily with number of cropped rows, not columns. Depending on the data and number of crops, it may make sense to rotate the image accordingly.
func Resize ¶
Resize a BMP image as a stream. Holds the smallest amount of pixels possible in memory. Amount of pixels held in memory is equal to the width of the image multiplied by the height of the resampling filter. Each pixel takes up 4 * 8 bytes.
Parts of this code are taken from or inspired by https://github.com/disintegration/imaging/blob/24d954dc01266ac1e8ba74cbe5e632c87fb0b38a/resize.go
Types ¶
type Header ¶
type ResizeOption ¶
type ResizeOption interface {
// contains filtered or unexported methods
}
func WithResizeFilter ¶
func WithResizeFilter(filter imaging.ResampleFilter) ResizeOption
Resampling filter used for resizing.
func WithResizeParallelBatchSize ¶
func WithResizeParallelBatchSize(chunk int) ResizeOption
Number of pixels in each job that the workers (go routines) take on.
func WithResizeParallelLimit ¶
func WithResizeParallelLimit(limit int) ResizeOption
Maximum number of parallel workers (go routines).