public ShortPixmap(int w, int h, short[] pixels) throws IllegalArgumentException {
        super(w, h);
        if (pixels == null) {
            pixels = new short[w * h];
        }
        if (pixels.length != w * h) {
            throw new IllegalArgumentException("bad dimensions");
        }
        data = pixels;
    }