Cropng
Constructor Summary
Public Constructor | ||
public |
constructor(image: Object | String) |
Member Summary
Public Members | ||
public |
our image |
Private Members | ||
private |
|
Method Summary
Public Methods | ||
public |
crop |
|
public |
scan scans a region of a bitmap and calls iter for each region |
Private Methods | ||
private |
_bufferizeImage turn an image into a buffer |
|
private |
_getMimeFromBuffer(buffer: Object): String _getMimeFromBuffer find the MIME type of a buffer |
|
private |
_getMimeFromPath(filePath: String): String _getMimeFromPath find the MIME type of a file |
|
private |
_pack packs the image to return the buffer to it's original format |
Public Constructors
Public Members
Private Members
Public Methods
public crop(measurements: Object, callback: function(err: Object, image: Object)) source
crop
Params:
Name | Type | Attribute | Description |
measurements | Object | the x,y,height and width to crop |
|
measurements.x | Number | the x coordinate to start from |
|
measurements.y | Number | the y coordinate to start from |
|
measurements.height | Number | the height of the crop |
|
measurements.width | Number | the width of the crop |
|
callback | function(err: Object, image: Object) |
public scan(x: Number, y: Number, h: Number, w: Number, iter: function(x: Number, y: Number, idx: Number)) source
scan scans a region of a bitmap and calls iter for each region
Private Methods
private _getMimeFromBuffer(buffer: Object): String source
_getMimeFromBuffer find the MIME type of a buffer
Params:
Name | Type | Attribute | Description |
buffer | Object | an image buffer |
private _getMimeFromPath(filePath: String): String source
_getMimeFromPath find the MIME type of a file
Params:
Name | Type | Attribute | Description |
filePath | String | the path to a file |