Previous Next        Current Page: NeXtMidas Training / Primitives / Introduction to DSP / Using the Data Class (ctd.)
back
Start Here   
Background   
Common Midas Concepts   
Getting Started - Part 1   
Getting Started - Part 2   
Working with Files   
Option Trees   
Macros - Part 1 (Basics)   
Macros - Part 2 (Graphics)   
NetBeans - Part 1 (Setup)   
NetBeans - Part 2 (GUIs)   
NetBeans - Part 3 (Profiler)   
Eclipse - Part 1 (Setup)   
Eclipse - Part 2 (GUIs)   
Primitives   
   + Overview   
   + Open, Process, Close   
   + Building   
   + The NeXtMidas API   
   + Lab 1   
   + Special Variables   
   + Lab 2   
   + Lab 3*   
   + Files in a Primitive   
   + Lab 4   
   + Lab 5*   
   + Test Macros   
   + Lab 6   
   + Real Time Controls   
   + Lab 7   
   + Working with Messages   
   + Lab 8   
   + Primitive Restarts   
   - Introduction to DSP   
      - Using the Data Class   
      - Using the Data Class (ctd.)   
   + Lab 9   
WebStart   
Maps & Imagery   
X-Midas Interoperability   
RMIF & Remoting   
Installing NeXtMidas   
Support & Maintenance   
File Handlers   


  • The Data Class:
    • Casting and uncasting arrays:
      • This is one of the two places where NeXtMidas uses native C code (if available).
        • For large arrays, doing the type conversion/cast in native code is faster.
        • For small arrays, the difference between Java and C code is negligable.
        • A complete Java implementation is available that is automatically used when NeXtMidas runs as an applet or via WebStart.
        • If you use the methods in the Data class, NeXtMidas will automatically choose between the C or Java code, using the fastest option available.
      • If you follow the following rules, your code will work all the time:
        • If you cast an array, you must uncast it.
        • Always cast and uncast within the process() method.
        • The copy parameter to the cast and uncast methods indicates if a data copy is required.
          • Input array: Use true for the cast and false for the uncast.
          • Output array: Use false for the cast and true for the uncast.
          • In/out array: Use true for the cast and true for the uncast.
          Setting the copy flag to false allows NeXtMidas to skip the data copy if doing so would be faster.
        • The docs for the nxm.sys.lib.Data class include multiple examples.

back