Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

[visad] [Fwd: Help!!! Domain of Image]


--- Begin Message ---
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


--- End Message ---
 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690