[visad] Help!!! Domain Image...

How do I amended the domain of an image?

I am using the following code to generate the image ...

My Code ...

          RealType longitude;
          RealType latitude;
          RealType redType;
          RealType greenType;
          RealType blueType;
          DataReferenceImpl data_ref;
          ScalarMap redMap;
          ScalarMap greenMap;
          ScalarMap blueMap;
          ScalarMap lonXMap;
          ScalarMap latYMap;

          GIFForm image = new GIFForm();
DataImpl imageData =image.open("/home/mneto/Desktop/teste5.jpg"); FunctionType functionType = (FunctionType) imageData.getType();

          RealTupleType domain = (RealTupleType) functionType.getDomain();
          RealTupleType range = (RealTupleType) functionType.getRange();

          longitude = (RealType) domain.getComponent(0);
          latitude = (RealType) domain.getComponent(1);

          redType = (RealType) range.getComponent(0);
          greenType = (RealType) range.getComponent(1);
          blueType = (RealType) range.getComponent(2);

          lonXMap = new ScalarMap(longitude, Display.XAxis);
          latYMap = new ScalarMap(latitude, Display.YAxis);

          redMap = new ScalarMap(redType, Display.Red);
          greenMap = new ScalarMap(greenType, Display.Green);
          blueMap = new ScalarMap(blueType, Display.Blue);


          display.addMap(lonXMap);
          display.addMap(latYMap);
          display.addMap(redMap);
          display.addMap(greenMap);
          display.addMap(blueMap);

          data_ref = new DataReferenceImpl("image_ref");

          data_ref.setData(imageData);

          display.addReference(data_ref);

I wonder as I do, for example, to use the function Linear2DSet to change the domain of image (position and size, for example).

Grateful

Marco


  • 2008 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: