!752

static int w = 45, h = 45;

!include #1004681 // Concepts

sconcept Corner {
  bool left;
  RGBImage image;
  S md5;
}

sconcept Program {}

sconcept Chrome extends Program {}
sconcept Desktop extends Program {}
sconcept Other extends Program {}
sconcept Unknown extends Program {}

p {
  loadAndAutoSaveConcepts();
  RGBImage left = shootTopLeftCorner(w, h);
  RGBImage right = shootTopRightCorner(w, h);
  Corner cleft = getCorner(true, left);
  Corner cright = getCorner(false, right);
  //showImage(left);
  //showImage(right);
}

static Corner getCorner(bool left, RGBImage image) {
  S md5 = md5OfRGBImage(image);
  Corner c = findWhere(list(Corner.class), "left", left, "md5", md5);
  if (c == null) {
    c = new Corner;
    c.left = left;
    c.image = image;
    c.md5 = md5;
    change();
  }
  ret c;
}