Skip to content

Commit

Permalink
fix: setMatrix() return this object (#621)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaceee committed Jun 14, 2023
1 parent 8700b25 commit b4ca38e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export declare class Image {
getRow(row: number, channel?: number): Array<number>;
getColumn(row: number, channel?: number): Array<number>;
getMatrix(options?: { channel?: number }): Matrix;
setMatrix(matrix: Matrix, options?: { channel?: number });
setMatrix(matrix: Matrix, options?: { channel?: number }): this;
getPixelsArray(): Array<Array<number>>;
getIntersection(mask2: Image): object;
getClosestCommonParent(mask: Image): Image;
Expand Down
4 changes: 4 additions & 0 deletions src/image/utility/setMatrix.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { Matrix } from 'ml-matrix';
* @param {Matrix} matrix
* @param {object} [options]
* @param {number} [options.channel]
*
* @return {this}
*/
export default function setMatrix(matrix, options = {}) {
matrix = new Matrix(matrix);
Expand Down Expand Up @@ -35,4 +37,6 @@ export default function setMatrix(matrix, options = {}) {
this.setValueXY(y, x, channel, matrix.get(x, y));
}
}

return this;
}

0 comments on commit b4ca38e

Please sign in to comment.