Examples of ParameterListDescriptor


Examples of com.lightcrafts.mediax.jai.ParameterListDescriptor

  } 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) {
    throw new IllegalArgumentException(
          JaiI18N.getString("TileDecoderImpl6"));
      }
  }
View Full Code Here

Examples of com.lightcrafts.mediax.jai.ParameterListDescriptor

  } 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"));
      }

      // 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) {
    throw new IllegalArgumentException(
          JaiI18N.getString("TileDecoderImpl6"));
      }
  }
View Full Code Here

Examples of javax.media.jai.ParameterListDescriptor

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

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

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

      // Set parameters on TileCodecParameterList only if there are any
      // parameters defined.
      if (pld != null) {

    String paramNames[] = pld.getParamNames();
    String currParam;
    Object currValue;
    if (paramNames != null) {
        for (int i=0; i<paramNames.length; i++) {
      currParam = paramNames[i];
View Full Code Here

Examples of javax.media.jai.ParameterListDescriptor

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

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

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

      if (pld != null) {

    String paramNames[] = pld.getParamNames();
    String currParam;
    Object currValue;

    if (paramNames != null) {
        for (int i=0; i<paramNames.length; i++) {
View Full Code Here

Examples of javax.media.jai.ParameterListDescriptor

    public NegotiableCapability getDecodeCapability() {
 
  Vector generators = new Vector();
  generators.add(JPEGTileDecoderFactory.class);

  ParameterListDescriptor jpegPld = JAI.getDefaultInstance().getOperationRegistry().getDescriptor("tileDecoder", "jpeg").getParameterListDescriptor("tileDecoder");
 
  Class paramClasses[] = {
      NegotiableNumericRange.class,
      NegotiableCollection.class,
      // XXX Find a way to create a negotiable representing integer
      // arrays
      // integer array,  horizontal subsampling
      // integer array,  vertical subsampling
      // integer array,  quantization table mapping
      // integer array,  quantizationTable0
      // integer array,  quantizationTable1
      // integer array,  quantizationTable2
      // integer array,  quantizationTable3
      NegotiableNumericRange.class,
      NegotiableCollection.class,
      NegotiableCollection.class,
      NegotiableCollection.class
  };

  String paramNames[] = {
      "quality",
      "qualitySet",
      "restartInterval",
      "writeImageInfo",
      "writeTableInfo",
      "writeJFIFHeader"
  };

  // A collection containing the valid values for a boolean valued
  // parameters
  Vector v = new Vector();
  v.add(new Boolean(true));
  v.add(new Boolean(false));
  NegotiableCollection negCollection = new NegotiableCollection(v);

  NegotiableNumericRange nnr1 =
      new NegotiableNumericRange(
          jpegPld.getParamValueRange(paramNames[0]));

  NegotiableNumericRange nnr2 =
      new NegotiableNumericRange(
          jpegPld.getParamValueRange(paramNames[2]));

  // The default values
  Object defaults[] = {
      nnr1,
      negCollection,
View Full Code Here

Examples of javax.media.jai.ParameterListDescriptor

    JPEGQTable table = jdp.getQTable(i);
    paramList.setParameter("quantizationTable"+i,
        (table == null) ? null : table.getTable());
      }
  else {
      ParameterListDescriptor pld
    = paramList.getParameterListDescriptor();
      for (int i = 0; i < 4; i++) {
    paramList.setParameter("quantizationTable"+i,
        pld.getParamDefaultValue("quantizationTable"+i));
      }
  }

  // extract the quantizationTableMapping
  int[] quanTableMapping = new int[bandNum];
View Full Code Here

Examples of javax.media.jai.ParameterListDescriptor

    public NegotiableCapability getEncodeCapability() {

  Vector generators = new Vector();
  generators.add(JPEGTileEncoderFactory.class);

  ParameterListDescriptor jpegPld =
      JAI.getDefaultInstance().getOperationRegistry().getDescriptor("tileEncoder", "jpeg").getParameterListDescriptor("tileEncoder");

  Class paramClasses[] = {
      javax.media.jai.remote.NegotiableNumericRange.class,
      javax.media.jai.remote.NegotiableCollection.class,
      // XXX How should a negotiable be created to represent int arrays
      // integer array,  horizontal subsampling
      // integer array,  vertical subsampling
      // integer array,  quantization table mapping
      // integer array,  quantizationTable0
      // integer array,  quantizationTable1
      // integer array,  quantizationTable2
      // integer array,  quantizationTable3
      javax.media.jai.remote.NegotiableNumericRange.class,
      javax.media.jai.remote.NegotiableCollection.class,
      javax.media.jai.remote.NegotiableCollection.class,
      javax.media.jai.remote.NegotiableCollection.class
  };

  String paramNames[] = {
      "quality",
      "qualitySet",
      "restartInterval",
      "writeImageInfo",
      "writeTableInfo",
      "writeJFIFHeader"
  };

  // A collection containing the valid values for a boolean valued
  // parameters
  Vector v = new Vector();
  v.add(new Boolean(true));
  v.add(new Boolean(false));
  NegotiableCollection negCollection = new NegotiableCollection(v);

  NegotiableNumericRange nnr1 =
      new NegotiableNumericRange(
          jpegPld.getParamValueRange(paramNames[0]));

  NegotiableNumericRange nnr2 =
      new NegotiableNumericRange(
          jpegPld.getParamValueRange(paramNames[2]));

  // The default values
  Object defaults[] = {
      nnr1,
      negCollection,
View Full Code Here

Examples of javax.media.jai.ParameterListDescriptor

  // If the supplied registryModeName is "remoteRendered" or
  // "remoteRenderable", in order to get the OperationDescriptor's
  // ParameterListDescriptor, we need to actually use the "rendered"
  // or "renderable" mode respectively.
  ParameterListDescriptor oldPLD = null;
  if (registryModeName.equalsIgnoreCase("remoteRendered")) {
      oldPLD = oldOD.getParameterListDescriptor("rendered");
  } else if (registryModeName.equalsIgnoreCase("remoteRenderable")) {
      oldPLD = oldOD.getParameterListDescriptor("renderable");
  } else {
      oldPLD = oldOD.getParameterListDescriptor(registryModeName);
  }

  int numParams = oldPLD.getNumParameters();

  // If the serverNames are same, nothing to be done for that
  if (oldServerName != newServerName) {

      // Check whether they both support the supplied operation name

      OperationDescriptor newDescs[] =
    getServerSupportedOperationList(newServerName);
      OperationDescriptor newOD;

      if ((newOD = getOperationDescriptor(newDescs,
            operationName)) == null)
    throw new IllegalArgumentException(
               JaiI18N.getString("JAIRMIDescriptor2"));

      // Check the OperationDescriptor equivalence

      // Sources
      if (numSources != newOD.getNumSources())
    throw new IllegalArgumentException(
               JaiI18N.getString("JAIRMIDescriptor3"));

      // Parameters
      ParameterListDescriptor newPLD =
    newOD.getParameterListDescriptor(registryModeName);

      if (numParams != newPLD.getNumParameters())
    throw new IllegalArgumentException(
              JaiI18N.getString("JAIRMIDescriptor4"));

      // Param names
      String oldParamNames[] = oldPLD.getParamNames();
      if (oldParamNames == null)
    oldParamNames = new String[0];
      String newParamNames[] = newPLD.getParamNames();
      if (newParamNames == null)
    newParamNames = new String[0];

      Hashtable oldHash = hashNames(oldParamNames);
      Hashtable newHash = hashNames(newParamNames);

      // The same names should be present in both in the same order.
            if (containsAll(oldHash, newHash) == false)
    throw new IllegalArgumentException(
               JaiI18N.getString("JAIRMIDescriptor8"));

      // Param class types
            Class thisParamClasses[] = oldPLD.getParamClasses();
            Class otherParamClasses[] = newPLD.getParamClasses();
            for (int i=0; i<oldParamNames.length; i++) {
                if (thisParamClasses[i] !=
                    otherParamClasses[getIndex(newHash, oldParamNames[i])])
                    throw new IllegalArgumentException(
               JaiI18N.getString("JAIRMIDescriptor9"));
View Full Code Here

Examples of javax.media.jai.ParameterListDescriptor

      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();

    if (names != null)
        for (int i = 0; i < names.length; i++)
      decodingParam.setParameter(names[i],
               temp.getObjectParameter(names[i]));
View Full Code Here

Examples of javax.media.jai.ParameterListDescriptor

  if (capabilityName == null) {
      throw new IllegalArgumentException(
        JaiI18N.getString("NegotiableCapability1"));
  }

  ParameterListDescriptor desc = getParameterListDescriptor();
  int numParams = desc.getNumParameters();
  String names[] = desc.getParamNames();
  Class classes[] = desc.getParamClasses();
  Object defaults[] = desc.getParamDefaults();

  for (int i=0; i<numParams; i++) {

      // Check that all paramClasses implement Negotiable.
      if (Negotiable.class.isAssignableFrom(classes[i]) == false) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.