Package javax.media.jai.tilecodec

Examples of javax.media.jai.tilecodec.TileCodecDescriptor


      if (tef == null) {
    throw new RuntimeException(
             JaiI18N.getString("JAIRMIImageServer0"));
      }

      TileCodecDescriptor tcd =
    (TileCodecDescriptor)JAI.getDefaultInstance().
    getOperationRegistry().getDescriptor("tileEncoder",
                 capabilityName);

      if (tcd.includesSampleModelInfo() == false ||
    tcd.includesLocationInfo() == false) {
    throw new RuntimeException(
             JaiI18N.getString("JAIRMIImageServer1"));
      }

      ParameterListDescriptor pld =
    tcd.getParameterListDescriptor("tileEncoder");

      tcpl = new TileCodecParameterList(capabilityName,
                new String[] {"tileEncoder"},
                pld);
View Full Code Here


      if (tdf == null) {
    throw new RemoteImagingException(
             JaiI18N.getString("RMIServerProxy0"));
      }

      TileCodecDescriptor tcd =
    (TileCodecDescriptor)registry.getDescriptor("tileDecoder",
                  capabilityName);

      if (tcd.includesSampleModelInfo() == false ||
    tcd.includesLocationInfo() == false) {
    throw new RemoteImagingException(
             JaiI18N.getString("RMIServerProxy1"));
      }

      ParameterListDescriptor pld =
    tcd.getParameterListDescriptor("tileDecoder");

      tcpl = new TileCodecParameterList(capabilityName,
                new String[] {"tileDecoder"},
                pld);
View Full Code Here

      registry = JAI.getDefaultInstance().getOperationRegistry();
  this.registry = registry;

  // Fix 4640094: When the provided encodingParam is null, use the default one
  if (encodingParam == null) {
      TileCodecDescriptor tcd =
    getTileCodecDescriptor("tileEncoder", formatName);
      encodingParam = tcd.getDefaultParameters("tileEncoder");
  } else if (!formatName.equals(encodingParam.getFormatName())) {
            throw new IllegalArgumentException(JaiI18N.getString("UseTileCodec0"));
        }

  // Fix 4640094: When the provided decodingParam is null, use the default one
  if (decodingParam == null) {
      TileCodecDescriptor tcd =
    getTileCodecDescriptor("tileDecoder", formatName);
      decodingParam = tcd.getDefaultParameters("tileDecoder");
  } else if (!formatName.equals(decodingParam.getFormatName())) {
            throw new IllegalArgumentException(JaiI18N.getString("UseTileCodec1"));
        }

        tileEncoderFactory =
View Full Code Here

                  (TileDecoderFactory)registry.getFactory("tileDecoder", formatName);

      TileCodecParameterList temp = decodingParam;

      if (temp != null) {
    TileCodecDescriptor tcd =
        getTileCodecDescriptor("tileDecoder", formatName);
    ParameterListDescriptor pld =
        tcd.getParameterListDescriptor("tileDecoder");
    decodingParam =
        new TileCodecParameterList(formatName,
                 new String[]{"tileDecoder"},
                 pld);
    String[] names = pld.getParamNames();
View Full Code Here

  if (input == null) {
      throw new IllegalArgumentException(
        JaiI18N.getString("TileDecoderImpl0"));
  }

        TileCodecDescriptor tcd =
      TileCodecUtils.getTileCodecDescriptor("tileDecoder", formatName);

  // If param is null, get the default parameter list.
        if (param == null)
            param = tcd.getDefaultParameters("tileDecoder");

  if (param != null) {

      // Check whether the formatName from the param is the same as the
      // one supplied to this method.
      if (param.getFormatName().equalsIgnoreCase(formatName) == false) {
    throw new IllegalArgumentException(
            JaiI18N.getString("TileDecoderImpl1"));
      }
     
      // Check whether the supplied parameterList supports the
      // "tileDecoder" mode.
      if (param.isValidForMode("tileDecoder") == false) {
    throw new IllegalArgumentException(
            JaiI18N.getString("TileDecoderImpl2"));
      }

      // Check whether the ParameterListDescriptors are the same.
      if (param.getParameterListDescriptor().equals(
      tcd.getParameterListDescriptor("tileDecoder")) == false)
            throw new IllegalArgumentException(JaiI18N.getString("TileCodec0"));

      SampleModel sm = null;

      // Check whether a non-null samplemodel value is needed
      if (tcd.includesSampleModelInfo() == false) {
    try {
        sm = (SampleModel)param.getObjectParameter("sampleModel");
    } catch (IllegalArgumentException iae) {
        // There is no parameter named sampleModel defined on the
        // supplied parameter list
        throw new IllegalArgumentException(
            JaiI18N.getString("TileDecoderImpl3"));
    }

    if (sm == null ||
        sm == ParameterListDescriptor.NO_PARAMETER_DEFAULT) {
       
        if (tcd.getParameterListDescriptor("tileDecoder").
              getParamDefaultValue("sampleModel") == null) {
      // If a non-null value was not set on the parameter list
      // and wasn't available thru the descriptor either
      throw new IllegalArgumentException(
            JaiI18N.getString("TileDecoderImpl4"));
        }
    }
      }

  } else {

      // If the supplied parameterList is null and the default one is
      // null too, then check whether this format supports no parameters
      ParameterListDescriptor pld =
    tcd.getParameterListDescriptor("tileDecoder");

      // Check whether a non-null samplemodel value is needed
      if (tcd.includesSampleModelInfo() == false) {
    // SampleModel must be specified via the parameter list
    throw new IllegalArgumentException(
            JaiI18N.getString("TileDecoderImpl5"));
      }
View Full Code Here

  if (output == null) {
      throw new IllegalArgumentException(
        JaiI18N.getString("TileEncoderImpl0"));
  }

        TileCodecDescriptor tcd =
      TileCodecUtils.getTileCodecDescriptor("tileEncoder", formatName);

  // If param is null, get the default parameter list.
        if (param == null)
            param = tcd.getDefaultParameters("tileEncoder");

  if (param != null) {

      // Check whether the formatName from the param is the same as the
      // one supplied to this method.
      if (param.getFormatName().equalsIgnoreCase(formatName) == false) {
    throw new IllegalArgumentException(
            JaiI18N.getString("TileEncoderImpl1"));
      }
     
      // Check whether the supplied parameterList supports the
      // "tileDecoder" mode.
      if (param.isValidForMode("tileEncoder") == false) {
    throw new IllegalArgumentException(
            JaiI18N.getString("TileEncoderImpl2"));
      }

      // Check whether the ParameterListDescriptors are the same.
      if (param.getParameterListDescriptor().equals(
      tcd.getParameterListDescriptor("tileEncoder")) == false)
            throw new IllegalArgumentException(JaiI18N.getString("TileCodec0"));

  } else {

      // If the supplied parameterList is null and the default one is
      // null too, then check whether this format supports no parameters
      ParameterListDescriptor pld =
    tcd.getParameterListDescriptor("tileEncoder");

      // If the PLD is not null and says that there are supposed to
      // be some parameters (numParameters returns non-zero value)
      // throw an IllegalArgumentException
      if (pld != null && pld.getNumParameters() != 0) {
View Full Code Here

/*      */
/*  876 */       if (tdf == null) {
/*  877 */         throw new RemoteImagingException(JaiI18N.getString("RMIServerProxy0"));
/*      */       }
/*      */
/*  881 */       TileCodecDescriptor tcd = (TileCodecDescriptor)this.registry.getDescriptor("tileDecoder", capabilityName);
/*      */
/*  885 */       if ((!tcd.includesSampleModelInfo()) || (!tcd.includesLocationInfo()))
/*      */       {
/*  887 */         throw new RemoteImagingException(JaiI18N.getString("RMIServerProxy1"));
/*      */       }
/*      */
/*  891 */       ParameterListDescriptor pld = tcd.getParameterListDescriptor("tileDecoder");
/*      */
/*  894 */       tcpl = new TileCodecParameterList(capabilityName, new String[] { "tileDecoder" }, pld);
/*      */
/*  900 */       if (pld != null)
/*      */       {
View Full Code Here

/*  409 */     if (registry == null)
/*  410 */       registry = JAI.getDefaultInstance().getOperationRegistry();
/*  411 */     this.registry = registry;
/*      */
/*  414 */     if (encodingParam == null) {
/*  415 */       TileCodecDescriptor tcd = getTileCodecDescriptor("tileEncoder", formatName);
/*      */
/*  417 */       encodingParam = tcd.getDefaultParameters("tileEncoder");
/*  418 */     } else if (!formatName.equals(encodingParam.getFormatName())) {
/*  419 */       throw new IllegalArgumentException(JaiI18N.getString("UseTileCodec0"));
/*      */     }
/*      */
/*  423 */     if (decodingParam == null) {
/*  424 */       TileCodecDescriptor tcd = getTileCodecDescriptor("tileDecoder", formatName);
/*      */
/*  426 */       decodingParam = tcd.getDefaultParameters("tileDecoder");
/*  427 */     } else if (!formatName.equals(decodingParam.getFormatName())) {
/*  428 */       throw new IllegalArgumentException(JaiI18N.getString("UseTileCodec1"));
/*      */     }
/*      */
/*  431 */     this.tileEncoderFactory = ((TileEncoderFactory)registry.getFactory("tileEncoder", formatName));
View Full Code Here

/* 1225 */       this.tileDecoderFactory = ((TileDecoderFactory)this.registry.getFactory("tileDecoder", this.formatName));
/*      */
/* 1228 */       TileCodecParameterList temp = this.decodingParam;
/*      */
/* 1230 */       if (temp != null) {
/* 1231 */         TileCodecDescriptor tcd = getTileCodecDescriptor("tileDecoder", this.formatName);
/*      */
/* 1233 */         ParameterListDescriptor pld = tcd.getParameterListDescriptor("tileDecoder");
/*      */
/* 1235 */         this.decodingParam = new TileCodecParameterList(this.formatName, new String[] { "tileDecoder" }, pld);
/*      */
/* 1239 */         String[] names = pld.getParamNames();
/*      */
View Full Code Here

TOP

Related Classes of javax.media.jai.tilecodec.TileCodecDescriptor

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.