Package sun.awt.image.codec

Examples of sun.awt.image.codec.JPEGParam


    *        match the data in the raster.
    */
  public static JPEGEncodeParam getDefaultJPEGEncodeParam(Raster ras,
                                                          int colorID)
  {
    JPEGParam ret = new JPEGParam(colorID, ras.getNumBands());
    ret.setWidth(ras.getWidth());
    ret.setHeight(ras.getHeight());
 
    return ret;
  }
View Full Code Here


    */
  public static JPEGEncodeParam getDefaultJPEGEncodeParam(int numBands,
                                                                int colorID)
            throws ImageFormatException
  {
    return new JPEGParam(colorID, numBands);
  }
View Full Code Here

   * @param jdp The JPEGDecodeParam object to copy.
   */

  public static JPEGEncodeParam getDefaultJPEGEncodeParam(JPEGDecodeParam jdp)
      throws ImageFormatException {
      return new JPEGParam(jdp);
  }
View Full Code Here

        if(sm == null)
            return null ;

        int nbands = sm.getNumBands() ;

        JPEGParam j2dJP = createDefaultJ2DJPEGEncodeParam(nbands) ;

        int[] hSubSamp
            = (int[])paramList.getObjectParameter("horizontalSubsampling") ;
        int[] vSubSamp
            = (int[])paramList.getObjectParameter("verticalSubsampling") ;
        int[] qTabSlot
            = (int[])paramList.getObjectParameter("quantizationTableMapping") ;

        for(int i=0; i<nbands; i++) {
            j2dJP.setHorizontalSubsampling(i, hSubSamp[i]) ;
            j2dJP.setVerticalSubsampling(i, vSubSamp[i]) ;

            int[] qTab
                 = (int[]) paramList.getObjectParameter("quantizationTable"+i) ;
      if(qTab != null &&
         qTab.equals(ParameterListDescriptor.NO_PARAMETER_DEFAULT)){
    j2dJP.setQTableComponentMapping(i, qTabSlot[i]) ;
    j2dJP.setQTable(qTabSlot[i], new JPEGQTable(qTab)) ;
      }
        }

        if(paramList.getBooleanParameter("qualitySet")) {
            float quality = paramList.getFloatParameter("quality") ;
            j2dJP.setQuality(quality, true) ;
        }

        int rInt = paramList.getIntParameter("restartInterval") ;
        j2dJP.setRestartInterval(rInt) ;

        j2dJP.setImageInfoValid(paramList.getBooleanParameter("writeImageInfo")) ;
        j2dJP.setTableInfoValid(paramList.getBooleanParameter("writeTableInfo")) ;

        if(paramList.getBooleanParameter("writeJFIFHeader")) {
            j2dJP.setMarkerData(JPEGEncodeParam.APP0_MARKER, null) ;
        }

        return (JPEGEncodeParam)j2dJP ;
    }
View Full Code Here

        return (JPEGEncodeParam)j2dJP ;
    }

    private JPEGParam createDefaultJ2DJPEGEncodeParam(int nbands){
        if(nbands == 1)
            return new JPEGParam(JPEGEncodeParam.COLOR_ID_GRAY, 1) ;
        if(nbands == 3)
            return new JPEGParam(JPEGEncodeParam.COLOR_ID_YCbCr, 3) ;
        if(nbands == 4)
            return new JPEGParam(JPEGEncodeParam.COLOR_ID_CMYK, 4) ;
  return null ;
    }
View Full Code Here

          */
        public static JPEGEncodeParam getDefaultJPEGEncodeParam(int numBands,
                                                                int colorID)
            throws ImageFormatException
        {
        return new JPEGParam(colorID, numBands);
        }
View Full Code Here

         * @param jdp The JPEGDecodeParam object to copy.
         */

        public static JPEGEncodeParam getDefaultJPEGEncodeParam(JPEGDecodeParam jdp)
            throws ImageFormatException {
            return new JPEGParam(jdp);
        }
View Full Code Here

        return (JPEGEncodeParam)j2dJP ;
    }

    private JPEGParam createDefaultJ2DJPEGEncodeParam(int nbands){
        if(nbands == 1)
            return new JPEGParam(JPEGEncodeParam.COLOR_ID_GRAY, 1) ;
        if(nbands == 3)
            return new JPEGParam(JPEGEncodeParam.COLOR_ID_YCbCr, 3) ;
        if(nbands == 4)
            return new JPEGParam(JPEGEncodeParam.COLOR_ID_CMYK, 4) ;
  return null ;
    }
View Full Code Here

        if(sm == null)
            return null ;

        int nbands = sm.getNumBands() ;

        JPEGParam j2dJP = createDefaultJ2DJPEGEncodeParam(nbands) ;

        int[] hSubSamp
            = (int[])paramList.getObjectParameter("horizontalSubsampling") ;
        int[] vSubSamp
            = (int[])paramList.getObjectParameter("verticalSubsampling") ;
        int[] qTabSlot
            = (int[])paramList.getObjectParameter("quantizationTableMapping") ;

        for(int i=0; i<nbands; i++) {
            j2dJP.setHorizontalSubsampling(i, hSubSamp[i]) ;
            j2dJP.setVerticalSubsampling(i, vSubSamp[i]) ;

            int[] qTab
                 = (int[]) paramList.getObjectParameter("quantizationTable"+i) ;
      if(qTab != null &&
         qTab.equals(ParameterListDescriptor.NO_PARAMETER_DEFAULT)){
    j2dJP.setQTableComponentMapping(i, qTabSlot[i]) ;
    j2dJP.setQTable(qTabSlot[i], new JPEGQTable(qTab)) ;
      }
        }

        if(paramList.getBooleanParameter("qualitySet")) {
            float quality = paramList.getFloatParameter("quality") ;
            j2dJP.setQuality(quality, true) ;
        }

        int rInt = paramList.getIntParameter("restartInterval") ;
        j2dJP.setRestartInterval(rInt) ;

        j2dJP.setImageInfoValid(paramList.getBooleanParameter("writeImageInfo")) ;
        j2dJP.setTableInfoValid(paramList.getBooleanParameter("writeTableInfo")) ;

        if(paramList.getBooleanParameter("writeJFIFHeader")) {
            j2dJP.setMarkerData(JPEGEncodeParam.APP0_MARKER, null) ;
        }

        return (JPEGEncodeParam)j2dJP ;
    }
View Full Code Here

/* 119 */     if (sm == null) {
/* 120 */       return null;
/*     */     }
/* 122 */     int nbands = sm.getNumBands();
/*     */
/* 124 */     JPEGParam j2dJP = createDefaultJ2DJPEGEncodeParam(nbands);
/*     */
/* 126 */     int[] hSubSamp = (int[])paramList.getObjectParameter("horizontalSubsampling");
/*     */
/* 128 */     int[] vSubSamp = (int[])paramList.getObjectParameter("verticalSubsampling");
/*     */
/* 130 */     int[] qTabSlot = (int[])paramList.getObjectParameter("quantizationTableMapping");
/*     */
/* 133 */     for (int i = 0; i < nbands; i++) {
/* 134 */       j2dJP.setHorizontalSubsampling(i, hSubSamp[i]);
/* 135 */       j2dJP.setVerticalSubsampling(i, vSubSamp[i]);
/*     */
/* 137 */       int[] qTab = (int[])paramList.getObjectParameter("quantizationTable" + i);
/*     */
/* 139 */       if ((qTab != null) && (qTab.equals(ParameterListDescriptor.NO_PARAMETER_DEFAULT)))
/*     */       {
/* 141 */         j2dJP.setQTableComponentMapping(i, qTabSlot[i]);
/* 142 */         j2dJP.setQTable(qTabSlot[i], new JPEGQTable(qTab));
/*     */       }
/*     */     }
/*     */
/* 146 */     if (paramList.getBooleanParameter("qualitySet")) {
/* 147 */       float quality = paramList.getFloatParameter("quality");
/* 148 */       j2dJP.setQuality(quality, true);
/*     */     }
/*     */
/* 151 */     int rInt = paramList.getIntParameter("restartInterval");
/* 152 */     j2dJP.setRestartInterval(rInt);
/*     */
/* 154 */     j2dJP.setImageInfoValid(paramList.getBooleanParameter("writeImageInfo"));
/* 155 */     j2dJP.setTableInfoValid(paramList.getBooleanParameter("writeTableInfo"));
/*     */
/* 157 */     if (paramList.getBooleanParameter("writeJFIFHeader")) {
/* 158 */       j2dJP.setMarkerData(224, (byte[][])null);
/*     */     }
/*     */
/* 161 */     return j2dJP;
/*     */   }
View Full Code Here

TOP

Related Classes of sun.awt.image.codec.JPEGParam

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.