@Override public int getBitsPerComponent() { if (isStencil()) { return 1; } else { return parameters.getInt(COSName.BPC, COSName.BITS_PER_COMPONENT, -1); } }
@Override public BufferedImage getStencilImage(Paint paint) throws IOException { if (!isStencil()) { throw new IllegalStateException("Image is not a stencil"); } return SampledImageReader.getStencilImage(this, paint); }
@Override public PDColorSpace getColorSpace() throws IOException { COSBase cs = parameters.getDictionaryObject(COSName.CS, COSName.COLORSPACE); if (cs != null) { return createColorSpace(cs); } else if (isStencil()) { // stencil mask color space must be gray, it is often missing return PDDeviceGray.INSTANCE; } else { // an image without a color space is always broken throw new IOException("could not determine inline image color space"); } }
if (inlineImage.isStencil())
@Override public BufferedImage getStencilImage(Paint paint) throws IOException { if (!isStencil()) { throw new IllegalStateException("Image is not a stencil"); } return SampledImageReader.getStencilImage(this, paint); }
@Override public BufferedImage getStencilImage(Paint paint) throws IOException { if (!isStencil()) { throw new IllegalStateException("Image is not a stencil"); } return SampledImageReader.getStencilImage(this, paint); }
@Override public int getBitsPerComponent() { if (isStencil()) { return 1; } else { return parameters.getInt(COSName.BPC, COSName.BITS_PER_COMPONENT, -1); } }
@Override public int getBitsPerComponent() { if (isStencil()) { return 1; } else { return parameters.getInt(COSName.BPC, COSName.BITS_PER_COMPONENT, -1); } }
@Override public PDColorSpace getColorSpace() throws IOException { COSBase cs = parameters.getDictionaryObject(COSName.CS, COSName.COLORSPACE); if (cs != null) { return createColorSpace(cs); } else if (isStencil()) { // stencil mask color space must be gray, it is often missing return PDDeviceGray.INSTANCE; } else { // an image without a color space is always broken throw new IOException("could not determine inline image color space"); } }
@Override public PDColorSpace getColorSpace() throws IOException { COSBase cs = parameters.getDictionaryObject(COSName.CS, COSName.COLORSPACE); if (cs != null) { return createColorSpace(cs); } else if (isStencil()) { // stencil mask color space must be gray, it is often missing return PDDeviceGray.INSTANCE; } else { // an image without a color space is always broken throw new IOException("could not determine inline image color space"); } }
if (inlineImage.isStencil())
if (inlineImage.isStencil())