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); }
public void setValue(final int x, final int y, final double dValue) { accessor.setValue(x - this.x, y - this.y, dValue); }
public double getValue(final int x, final int y) throws IOException { return accessor.getValue(x - this.x, y - this.y); }
public void writePixel(final int x, final int y, final double val) throws IOException { accessor.setValue(x - this.x, y - this.y, val); }