Package com.lightcrafts.mediax.jai.tilecodec

Examples of com.lightcrafts.mediax.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 (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

  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

TOP

Related Classes of com.lightcrafts.mediax.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.