Package com.sun.media.imageio.plugins.jpeg2000

Examples of com.sun.media.imageio.plugins.jpeg2000.J2KImageWriteParam


                             param.getSubsamplingXOffset(),
                             param.getSubsamplingYOffset());
        setDestinationType(param.getDestinationType());

        // J2K settings.
        J2KImageReadParam j2kParam;
        if(param instanceof J2KImageReadParam) {
            j2kParam = (J2KImageReadParam)param;
        } else {
            j2kParam = new J2KImageReadParam();
        }
        setDecodingRate(j2kParam.getDecodingRate());
        setResolution(j2kParam.getResolution());
    }
View Full Code Here


        }
        return null;
    }

    public ImageReadParam getDefaultReadParam() {
        return new J2KImageReadParam();
    }
View Full Code Here

                             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);
    }
View Full Code Here

        } else
            this.stream = null;
    }

    public ImageWriteParam getDefaultWriteParam() {
        return new J2KImageWriteParam();
    }
View Full Code Here

    BufferedImage bitmap = pngTransformation(((BitmapBufferedImageImpl)inputbitmap).getImage());
//    BufferedImage bitmap = ((BitmapBufferedImageImpl)inputbitmap).getImage();
   
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    J2KImageWriter writer = (J2KImageWriter) ImageIO.getImageWritersByFormatName("jpeg2000").next();
    J2KImageWriteParam iwp = (J2KImageWriteParam)writer.getDefaultWriteParam();
   
    iwp.setLossless(lossless);
////    //list of all types, only one seems to exist
//    String[] ct = iwp.getCompressionTypes();
//    for(int i=0;i < ct.length; i++)
//      System.out.println("compression type : "+ct[0]);
//   
    iwp.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
//    iwp.setCompressionType(ct[0]);
//    iwp.setCompressionQuality(0.01f);
////    iwp.setEncodingRate(0.01);
    //TODO Experiment
    iwp.setFilter(J2KImageWriteParam.FILTER_97);
    iwp.setProgressionType("layer");
    //Following is must to generate j2k JPEG 2000 stream
    iwp.setWriteCodeStreamOnly(true);
   
    iwp.setNumDecompositionLevels(5);
    FileCacheImageOutputStream fileImageOutputStream = new FileCacheImageOutputStream(baos, null);
    writer.setOutput(fileImageOutputStream);

    //TODO changed
//    writer.write(null, new IIOImage(bitmap, null, null), iwp);
View Full Code Here

TOP

Related Classes of com.sun.media.imageio.plugins.jpeg2000.J2KImageWriteParam

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.