Esempio n. 1
0
    private void setArray(final Object obj) {

      if (accessor == null) {
        final Class arrayType = obj.getClass().getComponentType();
        if (arrayType.equals(int[].class)) {
          accessor = new IntArray();
        } else if (arrayType.equals(double[].class)) {
          accessor = new DoubleArray();
        } else if (arrayType.equals(float[].class)) {
          accessor = new FloatArray();
        } else if (arrayType.equals(long[].class)) {
          accessor = new LongArray();
        } else if (arrayType.equals(short[].class)) {
          accessor = new ShortArray();
        } else if (arrayType.equals(byte[].class)) {
          accessor = new ByteArray();
        } else {
          throw new RuntimeException("Illegal raster pixel type");
        }
      }

      accessor.setArray(obj);
    }
Esempio n. 2
0
    public void setValue(final int x, final int y, final double dValue) {

      accessor.setValue(x - this.x, y - this.y, dValue);
    }
Esempio n. 3
0
    public double getValue(final int x, final int y) throws IOException {

      return accessor.getValue(x - this.x, y - this.y);
    }
Esempio n. 4
0
 public void writePixel(final int x, final int y, final double val) throws IOException {
   accessor.setValue(x - this.x, y - this.y, val);
 }