Class RayCastColorComposite

  • All Implemented Interfaces:
    RendererInterfaceColor

    public class RayCastColorComposite
    extends RayCastColor
    Ray traced rendering of the volume using composition of colors and alpha values at each voxel.
    • Constructor Detail

      • RayCastColorComposite

        public RayCastColorComposite​(ModelImage kImage,
                                     int iRBound,
                                     int[] aiRImage)
        The constructor for the ray tracer. Currently, the only client of this class is MjVolumeRenderer.
        Parameters:
        kImage - the 3D image
        iRBound - the dimension of the square 2D renderer image
        aiRImage - The rendered image data stored in row-major order. Each integer pixel represents an RGB color in the format B | (G
    • Method Detail

      • disposeLocal

        public void disposeLocal​(boolean flag)
        Clean memory.
        Overrides:
        disposeLocal in class RayCastColor
        Parameters:
        flag - is true call the super.disposeLocal
      • usesNormals

        public boolean usesNormals()
        Return indication as to whether or not the particular renderer uses normal vectors as part of its implementation.
        Specified by:
        usesNormals in class Renderer
        Returns:
        boolean True if the implementation uses normals.
      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Calls dispose.
        Overrides:
        finalize in class RayCastColor
        Throws:
        java.lang.Throwable - DOCUMENT ME!
      • processRay

        protected void processRay​(javax.vecmath.Point3f p0,
                                  javax.vecmath.Point3f p1,
                                  int iIndex,
                                  int rayTraceStepSize)
        Process a ray that has intersected the oriented bounding box of the 3D image. The method is only called if there is a line segment of intersection. The 'intersectsBox' stores the end points of the line segment in the class members P0 and P1 in image coordinates. This method uses the Trapezoid Rule to numerically integrates the image along the line segment. The number of integration samples is chosen to be proportional to the length of the line segment. P0 and P1 are used for multi-thread rendering.

        The function sets the color of the pixel corresponding to the processed ray. The RGB value is stored as an integer in the format B | (G

        Specified by:
        processRay in class RayCastRenderer
        Parameters:
        p0 - ray trace starting point
        p1 - ray trace stopping point
        iIndex - int the index of the pixel corresponding to the processed ray
        rayTraceStepSize - int size of steps to take along ray being traced
      • processRay

        protected void processRay​(int iIndex,
                                  int rayTraceStepSize)
        Process a ray that has intersected the oriented bounding box of the 3D image. The method is only called if there is a line segment of intersection. The 'intersectsBox' stores the end points of the line segment in the class members m_kP0 and m_kP1 in image coordinates. This method uses the Trapezoid Rule to numerically integrates the image along the line segment. The number of integration samples is chosen to be proportional to the length of the line segment.

        The function sets the color of the pixel corresponding to the processed ray. The RGB value is stored as an integer in the format B | (G

        Specified by:
        processRay in class RayCastRenderer
        Parameters:
        iIndex - int the index of the pixel corresponding to the processed ray
        rayTraceStepSize - int size of steps to take along ray being traced
      • traceInit

        protected void traceInit()
        Called at the beginning of the trace methods.
        Overrides:
        traceInit in class Renderer