Skip to content

Commit

Permalink
remove dup merge image in sim/image.ts (#1455)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwunderl authored Aug 9, 2023
1 parent 47c24cc commit ffb70d8
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions libs/screen/sim/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -933,40 +933,6 @@ namespace pxsim.ImageMethods {
}
return false;
}

export function _mergeImage(dst: RefImage, src: RefImage, xy: number) {
mergeImage(dst, src, XX(xy), YY(xy));
}

function mergeImage(dst: RefImage, src: RefImage, x0: number, y0: number) {
for (let x = 0; x < src._width; x++) {
for (let y = 0; y < src._height; y++) {
setPixel(
dst,
x0 + x,
y0 + y,
Math.min(getPixel(dst, x0 + x, y0 + y), getPixel(src, x, y))
)
}
}
}

export function _mapImage(dst: RefImage, src: RefImage, xy: number, buf: RefBuffer) {
mapImage(dst, src, XX(xy), YY(xy), buf);
}

function mapImage(dst: RefImage, src: RefImage, x0: number, y0: number, buf: RefBuffer) {
for (let x = 0; x < src._width; x++) {
for (let y = 0; y < src._height; y++) {
setPixel(
dst,
x0 + x,
y0 + y,
buf.data[getPixel(dst, x0 + x, y0 + y) + (getPixel(src, x, y) << 4)]
)
}
}
}
}


Expand Down

0 comments on commit ffb70d8

Please sign in to comment.