Class: JimpProcessor
mugshot.JimpProcessor
Process screenshots using Jimp.
#
Implements#
Constructors#
constructor+ new JimpProcessor(): JimpProcessor
Returns: JimpProcessor
#
Methods#
crop▸ crop(img
: Buffer, x
: number, y
: number, w
: number, h
: number): Promise<Buffer>
Crop a screenshot to the specified dimensions.
Will throw OutOfBoundsError if trying to crop outside of the image.
#
Parameters:Name | Type |
---|---|
img | Buffer |
x | number |
y | number |
w | number |
h | number |
Returns: Promise<Buffer>
Implementation of: PNGProcessor.crop
Defined in: packages/mugshot/src/lib/jimp-processor.ts:8
#
paint▸ paint(img
: Buffer, x
: number, y
: number, w
: number, h
: number, c
: string): Promise<Buffer>
Draw a colored rectangle over the screenshot.
#
Parameters:Name | Type |
---|---|
img | Buffer |
x | number |
y | number |
w | number |
h | number |
c | string |
Returns: Promise<Buffer>
Implementation of: PNGProcessor.paint
Defined in: packages/mugshot/src/lib/jimp-processor.ts:18