Skip to content

Commit

Permalink
refactor(text-canvas): apply thi.ng/pixel changes
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Nov 4, 2021
1 parent 96b50be commit abf29c1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/text-canvas/src/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,12 @@ export const imageBraille = (
* @param format
*/
export const imageCanvasBraille = (
src: { width: number; height: number; pixels: UIntArray },
src: { width: number; height: number; data: UIntArray },
thresh: number,
format = 0
) => {
const dest = canvas(src.width >> 1, src.height >> 2);
imageBraille(dest, 0, 0, src.width, src.height, src.pixels, thresh, format);
imageBraille(dest, 0, 0, src.width, src.height, src.data, thresh, format);
return dest;
};

Expand All @@ -294,7 +294,7 @@ export const imageCanvasBraille = (
* @param thresh
*/
export const imageStringBraille = (
src: { width: number; height: number; pixels: UIntArray },
src: { width: number; height: number; data: UIntArray },
thresh: number
) => formatCanvas(imageCanvasBraille(src, thresh, 0));

Expand All @@ -307,11 +307,11 @@ export const imageStringBraille = (
* @param char
*/
export const imageCanvas565 = (
src: { width: number; height: number; pixels: UIntArray },
src: { width: number; height: number; data: UIntArray },
char?: string
) => {
const dest = canvas(src.width, src.height);
imageRaw(dest, 0, 0, src.width, src.height, src.pixels, char);
imageRaw(dest, 0, 0, src.width, src.height, src.data, char);
return dest;
};

Expand All @@ -323,7 +323,7 @@ export const imageCanvas565 = (
* @param char
*/
export const imageString565 = (
src: { width: number; height: number; pixels: UIntArray },
src: { width: number; height: number; data: UIntArray },
char?: string,
fmt = FMT_ANSI565
) => formatCanvas(imageCanvas565(src, char), fmt);
Expand Down

0 comments on commit abf29c1

Please sign in to comment.