Simple GIS

GISプログラムの練習

color

package hada;


public class catchcolor {
    
    int r1,g1,b1;
    int memor=new int[1000][1000]; 
int memog=new int[1000][1000]; 
int memob=new int[1000][1000];
int card=new int[1000][1000];
    int w,h,s,sx;
    int xx,h1;
    
    
    void makedata(int cx,int cy){
    
     xx=80;
        
    r1=memor[cy][cx];
    g1=memog[cy][cx];
    b1=memob[cy][cx];  
    
     for(s=1;s<w;s++){
     for(sx=1;sx<h;sx++){
         h1=0;
    if(memor[sx][s]>r1-xx)h1=h1+1;
       if(memor[sx][s]<r1+xx)h1=h1+1;     
      if(memog[sx][s]>g1-xx)h1=h1+1;
       if(memog[sx][s]<g1+xx)h1=h1+1;
     if(memob[sx][s]>b1-xx)h1=h1+1;
       if(memob[sx][s]<b1+xx)h1=h1+1;
     if(h1==6)card[sx][s]=100;
     }
     }
    
    
    
    
    }
}