public Raster getRaster(int x, int y, int w, int h) {
        WritableRaster rast = cm.createCompatibleWritableRaster(w, h);

        int[] buf = ((DataBufferInt)rast.getDataBuffer()).getData();

        int c = x * dy - y * dx - delta;
        int cx = dy;
        int cy = - w * dy - dx;
        int k = 0;

        if (cyclic) {
            for(int j = 0; j < h; j++) {
                for(int i = 0; i < w; i++) {
                    buf[k++] = table[(c >> 8) & LOOKUP_MASK];
                    c += cx;
                }
                c += cy;
            }
        } else {
            for(int j = 0; j < h; j++) {
                for(int i = 0; i < w; i++) {
                    int index = c >> 8;
                    buf[k++] = index < 0 ? c1 : index >= LOOKUP_SIZE ? c2 : table[index];
                    c += cx;
                }
                c += cy;
            }
        }

        return rast;
    }