Package com.lightcrafts.mediax.jai.tilecodec

Examples of com.lightcrafts.mediax.jai.tilecodec.TileEncoder


    }
      }

      Raster r = getSource(id).getTile(x, y);
      ByteArrayOutputStream stream = new ByteArrayOutputStream();
      TileEncoder encoder = tef.createEncoder(stream, tcpl,
                r.getSampleModel());

      try {
    encoder.encode(r);
      } catch (java.io.IOException ioe) {
    throw new RuntimeException(ioe.getMessage());
      }

      return stream.toByteArray();
View Full Code Here


     * When useTileCodec is set, encode the provided raster into
     * a byte array.
     */
    private byte[] encodeRasterToByteArray(Raster raster) {
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        TileEncoder encoder =
            tileEncoderFactory.createEncoder(bos,
                                             encodingParam,
                                             raster.getSampleModel());
        try {
            encoder.encode(raster);
            return bos.toByteArray();
        } catch (IOException e) {
            sendExceptionToListener(JaiI18N.getString("SerializableRenderedImage15"),
                                    new ImagingException(JaiI18N.getString("SerializableRenderedImage15"), e));
//            throw new RuntimeException(e.getMessage());
View Full Code Here

            Raster raster,
            OutputStream output,
            TileCodecParameterList param)
  throws IOException {

  TileEncoder encoder = create(registry,
             formatName,
             output,
             param,
             raster.getSampleModel());

  if (encoder != null)
      encoder.encode(raster);
    }
View Full Code Here

TOP

Related Classes of com.lightcrafts.mediax.jai.tilecodec.TileEncoder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.