Java Code Examples for javax.imageio.IIOImage#hasRaster()

The following examples show how to use javax.imageio.IIOImage#hasRaster() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GIFImageWriter.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
public void writeToSequence(IIOImage image, ImageWriteParam param)
  throws IOException {
    if (stream == null) {
        throw new IllegalStateException("output == null!");
    }
    if (image == null) {
        throw new IllegalArgumentException("image == null!");
    }
    if (image.hasRaster()) {
        throw new UnsupportedOperationException("canWriteRasters() == false!");
    }
    if (!isWritingSequence) {
        throw new IllegalStateException("prepareWriteSequence() was not invoked!");
    }

    write(!wroteSequenceHeader, false, theStreamMetadata,
          image, param);

    if (!wroteSequenceHeader) {
        wroteSequenceHeader = true;
    }

    this.imageIndex++;
}
 
Example 2
Source File: GIFImageWriter.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
public void writeToSequence(IIOImage image, ImageWriteParam param)
  throws IOException {
    if (stream == null) {
        throw new IllegalStateException("output == null!");
    }
    if (image == null) {
        throw new IllegalArgumentException("image == null!");
    }
    if (image.hasRaster()) {
        throw new UnsupportedOperationException("canWriteRasters() == false!");
    }
    if (!isWritingSequence) {
        throw new IllegalStateException("prepareWriteSequence() was not invoked!");
    }

    write(!wroteSequenceHeader, false, theStreamMetadata,
          image, param);

    if (!wroteSequenceHeader) {
        wroteSequenceHeader = true;
    }

    this.imageIndex++;
}
 
Example 3
Source File: GIFImageWriter.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public void writeToSequence(IIOImage image, ImageWriteParam param)
  throws IOException {
    if (stream == null) {
        throw new IllegalStateException("output == null!");
    }
    if (image == null) {
        throw new IllegalArgumentException("image == null!");
    }
    if (image.hasRaster()) {
        throw new UnsupportedOperationException("canWriteRasters() == false!");
    }
    if (!isWritingSequence) {
        throw new IllegalStateException("prepareWriteSequence() was not invoked!");
    }

    write(!wroteSequenceHeader, false, theStreamMetadata,
          image, param);

    if (!wroteSequenceHeader) {
        wroteSequenceHeader = true;
    }

    this.imageIndex++;
}
 
Example 4
Source File: GIFImageWriter.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public void write(IIOMetadata sm,
                  IIOImage iioimage,
                  ImageWriteParam p) throws IOException {
    if (stream == null) {
        throw new IllegalStateException("output == null!");
    }
    if (iioimage == null) {
        throw new IllegalArgumentException("iioimage == null!");
    }
    if (iioimage.hasRaster()) {
        throw new UnsupportedOperationException("canWriteRasters() == false!");
    }

    resetLocal();

    GIFWritableStreamMetadata streamMetadata;
    if (sm == null) {
        streamMetadata =
            (GIFWritableStreamMetadata)getDefaultStreamMetadata(p);
    } else {
        streamMetadata =
            (GIFWritableStreamMetadata)convertStreamMetadata(sm, p);
    }

    write(true, true, streamMetadata, iioimage, p);
}
 
Example 5
Source File: GIFImageWriter.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
public void writeToSequence(IIOImage image, ImageWriteParam param)
  throws IOException {
    if (stream == null) {
        throw new IllegalStateException("output == null!");
    }
    if (image == null) {
        throw new IllegalArgumentException("image == null!");
    }
    if (image.hasRaster()) {
        throw new UnsupportedOperationException("canWriteRasters() == false!");
    }
    if (!isWritingSequence) {
        throw new IllegalStateException("prepareWriteSequence() was not invoked!");
    }

    write(!wroteSequenceHeader, false, theStreamMetadata,
          image, param);

    if (!wroteSequenceHeader) {
        wroteSequenceHeader = true;
    }

    this.imageIndex++;
}
 
Example 6
Source File: GIFImageWriter.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
public void write(IIOMetadata sm,
                  IIOImage iioimage,
                  ImageWriteParam p) throws IOException {
    if (stream == null) {
        throw new IllegalStateException("output == null!");
    }
    if (iioimage == null) {
        throw new IllegalArgumentException("iioimage == null!");
    }
    if (iioimage.hasRaster()) {
        throw new UnsupportedOperationException("canWriteRasters() == false!");
    }

    resetLocal();

    GIFWritableStreamMetadata streamMetadata;
    if (sm == null) {
        streamMetadata =
            (GIFWritableStreamMetadata)getDefaultStreamMetadata(p);
    } else {
        streamMetadata =
            (GIFWritableStreamMetadata)convertStreamMetadata(sm, p);
    }

    write(true, true, streamMetadata, iioimage, p);
}
 
Example 7
Source File: GIFImageWriter.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public void write(IIOMetadata sm,
                  IIOImage iioimage,
                  ImageWriteParam p) throws IOException {
    if (stream == null) {
        throw new IllegalStateException("output == null!");
    }
    if (iioimage == null) {
        throw new IllegalArgumentException("iioimage == null!");
    }
    if (iioimage.hasRaster()) {
        throw new UnsupportedOperationException("canWriteRasters() == false!");
    }

    resetLocal();

    GIFWritableStreamMetadata streamMetadata;
    if (sm == null) {
        streamMetadata =
            (GIFWritableStreamMetadata)getDefaultStreamMetadata(p);
    } else {
        streamMetadata =
            (GIFWritableStreamMetadata)convertStreamMetadata(sm, p);
    }

    write(true, true, streamMetadata, iioimage, p);
}
 
Example 8
Source File: GIFImageWriter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public void write(IIOMetadata sm,
                  IIOImage iioimage,
                  ImageWriteParam p) throws IOException {
    if (stream == null) {
        throw new IllegalStateException("output == null!");
    }
    if (iioimage == null) {
        throw new IllegalArgumentException("iioimage == null!");
    }
    if (iioimage.hasRaster()) {
        throw new UnsupportedOperationException("canWriteRasters() == false!");
    }

    resetLocal();

    GIFWritableStreamMetadata streamMetadata;
    if (sm == null) {
        streamMetadata =
            (GIFWritableStreamMetadata)getDefaultStreamMetadata(p);
    } else {
        streamMetadata =
            (GIFWritableStreamMetadata)convertStreamMetadata(sm, p);
    }

    write(true, true, streamMetadata, iioimage, p);
}
 
Example 9
Source File: GIFImageWriter.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
public void write(IIOMetadata sm,
                  IIOImage iioimage,
                  ImageWriteParam p) throws IOException {
    if (stream == null) {
        throw new IllegalStateException("output == null!");
    }
    if (iioimage == null) {
        throw new IllegalArgumentException("iioimage == null!");
    }
    if (iioimage.hasRaster()) {
        throw new UnsupportedOperationException("canWriteRasters() == false!");
    }

    resetLocal();

    GIFWritableStreamMetadata streamMetadata;
    if (sm == null) {
        streamMetadata =
            (GIFWritableStreamMetadata)getDefaultStreamMetadata(p);
    } else {
        streamMetadata =
            (GIFWritableStreamMetadata)convertStreamMetadata(sm, p);
    }

    write(true, true, streamMetadata, iioimage, p);
}
 
Example 10
Source File: GIFImageWriter.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public void write(IIOMetadata sm,
                  IIOImage iioimage,
                  ImageWriteParam p) throws IOException {
    if (stream == null) {
        throw new IllegalStateException("output == null!");
    }
    if (iioimage == null) {
        throw new IllegalArgumentException("iioimage == null!");
    }
    if (iioimage.hasRaster()) {
        throw new UnsupportedOperationException("canWriteRasters() == false!");
    }

    resetLocal();

    GIFWritableStreamMetadata streamMetadata;
    if (sm == null) {
        streamMetadata =
            (GIFWritableStreamMetadata)getDefaultStreamMetadata(p);
    } else {
        streamMetadata =
            (GIFWritableStreamMetadata)convertStreamMetadata(sm, p);
    }

    write(true, true, streamMetadata, iioimage, p);
}
 
Example 11
Source File: GIFImageWriter.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
public void write(IIOMetadata sm,
                  IIOImage iioimage,
                  ImageWriteParam p) throws IOException {
    if (stream == null) {
        throw new IllegalStateException("output == null!");
    }
    if (iioimage == null) {
        throw new IllegalArgumentException("iioimage == null!");
    }
    if (iioimage.hasRaster()) {
        throw new UnsupportedOperationException("canWriteRasters() == false!");
    }

    resetLocal();

    GIFWritableStreamMetadata streamMetadata;
    if (sm == null) {
        streamMetadata =
            (GIFWritableStreamMetadata)getDefaultStreamMetadata(p);
    } else {
        streamMetadata =
            (GIFWritableStreamMetadata)convertStreamMetadata(sm, p);
    }

    write(true, true, streamMetadata, iioimage, p);
}
 
Example 12
Source File: GIFImageWriter.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public void writeToSequence(IIOImage image, ImageWriteParam param)
  throws IOException {
    if (stream == null) {
        throw new IllegalStateException("output == null!");
    }
    if (image == null) {
        throw new IllegalArgumentException("image == null!");
    }
    if (image.hasRaster()) {
        throw new UnsupportedOperationException("canWriteRasters() == false!");
    }
    if (!isWritingSequence) {
        throw new IllegalStateException("prepareWriteSequence() was not invoked!");
    }

    write(!wroteSequenceHeader, false, theStreamMetadata,
          image, param);

    if (!wroteSequenceHeader) {
        wroteSequenceHeader = true;
    }

    this.imageIndex++;
}
 
Example 13
Source File: GIFImageWriter.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public void writeToSequence(IIOImage image, ImageWriteParam param)
  throws IOException {
    if (stream == null) {
        throw new IllegalStateException("output == null!");
    }
    if (image == null) {
        throw new IllegalArgumentException("image == null!");
    }
    if (image.hasRaster()) {
        throw new UnsupportedOperationException("canWriteRasters() == false!");
    }
    if (!isWritingSequence) {
        throw new IllegalStateException("prepareWriteSequence() was not invoked!");
    }

    write(!wroteSequenceHeader, false, theStreamMetadata,
          image, param);

    if (!wroteSequenceHeader) {
        wroteSequenceHeader = true;
    }

    this.imageIndex++;
}
 
Example 14
Source File: GIFImageWriter.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public void write(IIOMetadata sm,
                  IIOImage iioimage,
                  ImageWriteParam p) throws IOException {
    if (stream == null) {
        throw new IllegalStateException("output == null!");
    }
    if (iioimage == null) {
        throw new IllegalArgumentException("iioimage == null!");
    }
    if (iioimage.hasRaster()) {
        throw new UnsupportedOperationException("canWriteRasters() == false!");
    }

    resetLocal();

    GIFWritableStreamMetadata streamMetadata;
    if (sm == null) {
        streamMetadata =
            (GIFWritableStreamMetadata)getDefaultStreamMetadata(p);
    } else {
        streamMetadata =
            (GIFWritableStreamMetadata)convertStreamMetadata(sm, p);
    }

    write(true, true, streamMetadata, iioimage, p);
}
 
Example 15
Source File: GIFImageWriter.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public void writeToSequence(IIOImage image, ImageWriteParam param)
  throws IOException {
    if (stream == null) {
        throw new IllegalStateException("output == null!");
    }
    if (image == null) {
        throw new IllegalArgumentException("image == null!");
    }
    if (image.hasRaster()) {
        throw new UnsupportedOperationException("canWriteRasters() == false!");
    }
    if (!isWritingSequence) {
        throw new IllegalStateException("prepareWriteSequence() was not invoked!");
    }

    write(!wroteSequenceHeader, false, theStreamMetadata,
          image, param);

    if (!wroteSequenceHeader) {
        wroteSequenceHeader = true;
    }

    this.imageIndex++;
}
 
Example 16
Source File: GIFImageWriter.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public void write(IIOMetadata sm,
                  IIOImage iioimage,
                  ImageWriteParam p) throws IOException {
    if (stream == null) {
        throw new IllegalStateException("output == null!");
    }
    if (iioimage == null) {
        throw new IllegalArgumentException("iioimage == null!");
    }
    if (iioimage.hasRaster()) {
        throw new UnsupportedOperationException("canWriteRasters() == false!");
    }

    resetLocal();

    GIFWritableStreamMetadata streamMetadata;
    if (sm == null) {
        streamMetadata =
            (GIFWritableStreamMetadata)getDefaultStreamMetadata(p);
    } else {
        streamMetadata =
            (GIFWritableStreamMetadata)convertStreamMetadata(sm, p);
    }

    write(true, true, streamMetadata, iioimage, p);
}
 
Example 17
Source File: GIFImageWriter.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
public void writeToSequence(IIOImage image, ImageWriteParam param)
  throws IOException {
    if (stream == null) {
        throw new IllegalStateException("output == null!");
    }
    if (image == null) {
        throw new IllegalArgumentException("image == null!");
    }
    if (image.hasRaster()) {
        throw new UnsupportedOperationException("canWriteRasters() == false!");
    }
    if (!isWritingSequence) {
        throw new IllegalStateException("prepareWriteSequence() was not invoked!");
    }

    write(!wroteSequenceHeader, false, theStreamMetadata,
          image, param);

    if (!wroteSequenceHeader) {
        wroteSequenceHeader = true;
    }

    this.imageIndex++;
}
 
Example 18
Source File: GIFImageWriter.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
public void write(IIOMetadata sm,
                  IIOImage iioimage,
                  ImageWriteParam p) throws IOException {
    if (stream == null) {
        throw new IllegalStateException("output == null!");
    }
    if (iioimage == null) {
        throw new IllegalArgumentException("iioimage == null!");
    }
    if (iioimage.hasRaster()) {
        throw new UnsupportedOperationException("canWriteRasters() == false!");
    }

    resetLocal();

    GIFWritableStreamMetadata streamMetadata;
    if (sm == null) {
        streamMetadata =
            (GIFWritableStreamMetadata)getDefaultStreamMetadata(p);
    } else {
        streamMetadata =
            (GIFWritableStreamMetadata)convertStreamMetadata(sm, p);
    }

    write(true, true, streamMetadata, iioimage, p);
}
 
Example 19
Source File: GIFImageWriter.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public void write(IIOMetadata sm,
                  IIOImage iioimage,
                  ImageWriteParam p) throws IOException {
    if (stream == null) {
        throw new IllegalStateException("output == null!");
    }
    if (iioimage == null) {
        throw new IllegalArgumentException("iioimage == null!");
    }
    if (iioimage.hasRaster()) {
        throw new UnsupportedOperationException("canWriteRasters() == false!");
    }

    resetLocal();

    GIFWritableStreamMetadata streamMetadata;
    if (sm == null) {
        streamMetadata =
            (GIFWritableStreamMetadata)getDefaultStreamMetadata(p);
    } else {
        streamMetadata =
            (GIFWritableStreamMetadata)convertStreamMetadata(sm, p);
    }

    write(true, true, streamMetadata, iioimage, p);
}
 
Example 20
Source File: J2KImageWriteParamJava.java    From healthcare-dicom-dicomweb-adapter with Apache License 2.0 4 votes vote down vote up
/** Constructor to set locales. */
public J2KImageWriteParamJava(IIOImage image,  ImageWriteParam param) {
    super(param.getLocale());
    if(image != null) {
        if (image.hasRaster())
            setDefaults(image.getRaster());
        else
            setDefaults(image.getRenderedImage());
    }

    setSourceRegion(param.getSourceRegion());
    setSourceBands(param.getSourceBands());
    try {
        setTiling(param.getTileWidth(), param.getTileHeight(),
                  param.getTileGridXOffset(), param.getTileGridYOffset());
    } catch (IllegalStateException e) {
        // tileing is not set do nothing.
    }

    setDestinationOffset(param.getDestinationOffset());
    setSourceSubsampling(param.getSourceXSubsampling(),
                         param.getSourceYSubsampling(),
                         param.getSubsamplingXOffset(),
                         param.getSubsamplingYOffset());
    setDestinationType(param.getDestinationType());

    J2KImageWriteParam j2kParam;
    if(param instanceof J2KImageWriteParam) {
        j2kParam = (J2KImageWriteParam)param;
    } else {
        j2kParam = new J2KImageWriteParam();
    }

    setDecompositionLevel(""+j2kParam.getNumDecompositionLevels());
    setEncodingRate(j2kParam.getEncodingRate());
    setLossless(j2kParam.getLossless());
    setFilters(j2kParam.getFilter());
    setEPH("" + j2kParam.getEPH());
    setSOP("" + j2kParam.getSOP());
    setProgressionName(j2kParam.getProgressionType());
    int[] size = j2kParam.getCodeBlockSize();
    setCodeBlockSize("" + size[0] +" " + size[1]);
    enableCT = j2kParam.getComponentTransformation();
    setComponentTransformation("" + enableCT);
}