Пример #1
0
 private HashSet<String> collectTileNames() {
   HashSet<String> names = new HashSet<String>();
   for (ImagePyramidBin bin : bins) {
     names.addAll(bin.getNames());
   }
   return names;
 }
Пример #2
0
  public void setLocationInBin(int x, int y) throws IOException {

    if (x > bin.getImageWidth() || y > bin.getImageHeight())
      throw new IOException("Tile location not in bin.");

    this.x = x;
    this.y = y;
  }
Пример #3
0
 private String collectBinTilesByName(String name) {
   String binsString = "";
   for (ImagePyramidBin bin : bins) {
     PyramidBinTile tile = bin.getTile(name);
     if (tile != null) {
       binsString += tile.toString();
     }
   }
   return binsString;
 }
Пример #4
0
 public String toString() {
   return String.format(
       "{%d,%d,%d,%d,%d,%d,%d,%d,%d}",
       bin.getScale(),
       bin.getRow(),
       bin.getCol(),
       bin.getImageWidth(),
       bin.getImageHeight(),
       x,
       y,
       width,
       height);
 }
Пример #5
0
  public static PyramidBinTile fromString(String str, String name) throws IOException {
    int[] paras = parseString(str, ",");

    int scale = paras[0];
    int row = paras[1];
    int col = paras[2];
    int binWidth = paras[3];
    int binHeight = paras[4];
    int x = paras[5];
    int y = paras[6];
    int width = paras[7];
    int height = paras[8];

    ImagePyramidBin bin = new ImagePyramidBin(scale, row, col);
    bin.setImageArea(binWidth, binHeight);

    PyramidBinTile tile = new PyramidBinTile(bin, name);
    tile.setLocationInBin(x, y);
    tile.setScaledDims(width, height);

    return tile;
  }
Пример #6
0
 public int getTileHeightInBin() {
   Rectangle binrect = new Rectangle(0, 0, bin.getImageWidth(), bin.getImageHeight());
   Rectangle tilerect = new Rectangle(x, y, getScaledWidth(), getScaledHeight());
   return binrect.intersection(tilerect).height;
 }
Пример #7
0
 public int getRawHeight() {
   return height * bin.getScale();
 }
Пример #8
0
 public int getRawWidth() {
   return width * bin.getScale();
 }