c - An algorithm to group cells into rectangles -
imagine picture above represents 6*6 array of ints 0 black. there quick algorithm split non 0 cells rectangles? ideally check contained within loop, without creating other arrays.
for(x = 0; x < 6; x++) for(y = 0; y < 6; y++) if(cellisbottomrightofrect(x,y)) { left = getleft(x,y); top = gettop(x,y); printf("rect: %d,%d %d,%d \n", left, top, x, y); }
how using recursive method calls everytime encounters color different 1 trying group @ moment?
Comments
Post a Comment