Class: Resize

fabric.Image.filters.Resize

new Resize()

Resize image filter class
Source:
See:
Example
var filter = new fabric.Image.filters.Resize();
object.filters.push(filter);
object.applyFilters(canvas.renderAll.bind(canvas));

Extends

Members

lanczosLobes

LanczosLobes parameter for lanczos filter
Default Value:
  • 3
Source:

resizeType

Resize type
Default Value:
  • hermite
Source:

scaleX

Scale factor for resizing, x axis
Source:

scaleY

Scale factor for resizing, y axis
Source:

type

Filter type
Overrides:
Default Value:
  • Resize
Source:

Methods

applyTo(canvasEl, scaleX, scaleY)

Applies filter to canvas element
Parameters:
Name Type Description
canvasEl Object Canvas element to apply filter to
scaleX Number
scaleY Number
Source:

bilinearFiltering(canvasEl, oW, oH, dW, dH) → {ImageData}

bilinearFiltering
Parameters:
Name Type Description
canvasEl Object Canvas element to apply filter to
oW Number Original Width
oH Number Original Height
dW Number Destination Width
dH Number Destination Height
Source:
Returns:
Type
ImageData

hermiteFastResize(canvasEl, oW, oH, dW, dH) → {ImageData}

hermiteFastResize
Parameters:
Name Type Description
canvasEl Object Canvas element to apply filter to
oW Number Original Width
oH Number Original Height
dW Number Destination Width
dH Number Destination Height
Source:
Returns:
Type
ImageData

initialize(optionsopt)

Constructor
Parameters:
Name Type Attributes Description
options Object <optional>
Options object
Inherited From:
Source:

lanczosResize(canvasEl, oW, oH, dW, dH) → {ImageData}

Filter lanczosResize
Parameters:
Name Type Description
canvasEl Object Canvas element to apply filter to
oW Number Original Width
oH Number Original Height
dW Number Destination Width
dH Number Destination Height
Source:
Returns:
Type
ImageData

setOptions(optionsopt)

Sets filter's properties from options
Parameters:
Name Type Attributes Description
options Object <optional>
Options object
Inherited From:
Source:

sliceByTwo(canvasEl, oW, oH, dW, dH) → {ImageData}

Filter sliceByTwo
Parameters:
Name Type Description
canvasEl Object Canvas element to apply filter to
oW Number Original Width
oH Number Original Height
dW Number Destination Width
dH Number Destination Height
Source:
Returns:
Type
ImageData

toJSON() → {Object}

Returns a JSON representation of an instance
Inherited From:
Source:
Returns:
JSON
Type
Object

toObject() → {Object}

Returns object representation of an instance
Overrides:
Source:
Returns:
Object representation of an instance
Type
Object