public PdfSubByteSampleModel(int w, int h, int numComponents, int bitsPerComponent)
    {
        super(DataBuffer.TYPE_BYTE, w, h, numComponents);
        assert bitsPerComponent < 8 : "This is designed just for use with per-component sizes of less than 8 bits; " +
                "you should probably use PixelInterleavedSampleModel";
        assert bitsPerComponent == 1 || bitsPerComponent == 2 || bitsPerComponent == 4 :
                "we don't want to grab components across byte boundaries";
        transferBytesPerPixel = (numComponents * bitsPerComponent + 7) / 8;
        storageBitsPerPixel = numComponents * bitsPerComponent;
        // account for possible bits of padding on the end
        bitsPerLine = 8 * ((storageBitsPerPixel * w + 7) / 8);
        this.bitsPerBand = bitsPerComponent;
        componentMask = (1 << this.bitsPerBand) - 1;

        sampleSize = new int[numComponents];
        for (int i = 0; i < sampleSize.length; ++i) {
            sampleSize[i] = bitsPerComponent;
        }
        ignoredBitsPerComponentPerByte = 8 - bitsPerBand;
    }