Fix threshold checking, used dumb values
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
1a10316b37
commit
eee6185cdf
@ -64,7 +64,9 @@ public abstract class Reader{
|
|||||||
int X = i%width;
|
int X = i%width;
|
||||||
for (int x=-1;x<=1;x++) {
|
for (int x=-1;x<=1;x++) {
|
||||||
for (int y=-1;y<=1;y++) {
|
for (int y=-1;y<=1;y++) {
|
||||||
if (x>=0&&y>=0&&x<=width&&y<=arr.length/width) {
|
int newX=(i+x+y*width)%width;
|
||||||
|
int newY=(i+x+y*width)/width;
|
||||||
|
if (newX>=0&&newY>=0&&newX<=width&&newY<=arr.length/width) {
|
||||||
Color col = new Color(arr[i+x+y*width]);
|
Color col = new Color(arr[i+x+y*width]);
|
||||||
if (!col.equals(Color.MAGENTA)&&SEEKCOLOR.colorInRange(col)) {
|
if (!col.equals(Color.MAGENTA)&&SEEKCOLOR.colorInRange(col)) {
|
||||||
farthestRight=seek(arr,i+x+y*width,SEEKCOLOR,FINALCOLOR,width,farthestRight);
|
farthestRight=seek(arr,i+x+y*width,SEEKCOLOR,FINALCOLOR,width,farthestRight);
|
||||||
@ -83,7 +85,9 @@ public abstract class Reader{
|
|||||||
int X = i%width;
|
int X = i%width;
|
||||||
for (int x=-1;x<=1;x++) {
|
for (int x=-1;x<=1;x++) {
|
||||||
for (int y=-1;y<=1;y++) {
|
for (int y=-1;y<=1;y++) {
|
||||||
if (x>=0&&y>=0&&x<=width&&y<=arr.length/width) {
|
int newX=(i+x+y*width)%width;
|
||||||
|
int newY=(i+x+y*width)/width;
|
||||||
|
if (newX>=0&&newY>=0&&newX<=width&&newY<=arr.length/width) {
|
||||||
Color col = new Color(arr[i+x+y*width]);
|
Color col = new Color(arr[i+x+y*width]);
|
||||||
if (!col.equals(Color.MAGENTA)&&colorIsBright(col, threshold)) {
|
if (!col.equals(Color.MAGENTA)&&colorIsBright(col, threshold)) {
|
||||||
farthestRight=seekThreshold(arr,i+x+y*width,threshold,FINALCOLOR,width,farthestRight);
|
farthestRight=seekThreshold(arr,i+x+y*width,threshold,FINALCOLOR,width,farthestRight);
|
||||||
|
BIN
result.png
BIN
result.png
Binary file not shown.
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 40 KiB |
Loading…
x
Reference in New Issue
Block a user