Package com.openinventor.imageviz.nodes.images

Data conversion conventions in ImageViz

Open Inventor supports some data types that are not supported in ImageViz and vice versa. For example, Open Inventor supports 32-bit unsigned integer values, but ImageViz does not. Likewise, ImageViz supports label types, which is an unknown notion in Open Inventor.

Given the diversity of types, the following rules are used to allow type conversions when the data are accessed by the application or by an engine.

  1. Values outside the destination range are clamped.
  2. For binary type, values equal to 0 are set to INACTIVE and those are different from 0 are set to ACTIVE.
  3. For color types, transparency is not supported by ImageViz and must be removed.
  4. For floating point types to integer types conversion, the floating point value is truncated. Example: 1.8f becomes 1.
  5. Double precision floating point type is not supported by ImageViz. It must be casted to simple precision floating point type with the suitable loss of precision.
  6. Conversion from signed to unsigned types and other downcasts respect rule #1.

The conversion conventions are mentioned here because no warning is issued when data is converted. This is necessary to avoid an avalanche of warning messages.