Skip to content

Commit

Permalink
fixed bug where +y is along down
Browse files Browse the repository at this point in the history
  • Loading branch information
Suk Hyun Sung committed Feb 9, 2024
1 parent 06bdc09 commit 64db42a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Binary file added .DS_Store
Binary file not shown.
8 changes: 4 additions & 4 deletions ronch_calc.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ function drawGrayscaleBitmap2( ctx, input, numPx ) {
for (let i = 0; i < numPx; i++ ){
for (let j = 0; j <numPx; j++ ){
red = i * (numPx * 4) + j * 4

data[red] = input[i][j]
data[red+1] = input[i][j]
data[red+2] = input[i][j]
y_index = (numPx-1)-i // To flip y
data[red] = input[y_index][j]
data[red+1] = input[y_index][j]
data[red+2] = input[y_index][j]
data[red+3] = 255
}

Expand Down
Binary file added vasco/.DS_Store
Binary file not shown.
8 changes: 4 additions & 4 deletions vasco/ronch_calc.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ function drawGrayscaleBitmap2( ctx, input, numPx ) {
for (let i = 0; i < numPx; i++ ){
for (let j = 0; j <numPx; j++ ){
red = i * (numPx * 4) + j * 4;

data[red] = input[i][j];
data[red + 1] = input[i][j];
data[red + 2] = input[i][j];
y_index = (numPx-1)-i // To flip y
data[red] = input[y_index][j]
data[red+1] = input[y_index][j]
data[red+2] = input[y_index][j]
data[red + 3] = 255;
}
}
Expand Down

0 comments on commit 64db42a

Please sign in to comment.