Class OpenCLAlgorithmVolumeNormals

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.awt.event.WindowListener, java.lang.Runnable, java.util.EventListener

    public class OpenCLAlgorithmVolumeNormals
    extends OpenCLAlgorithmBase
    OpenCL Algorithm implementation calculate the volume normals of a 3D image. Two methods for the normal calculation are provided. One reads the ModelImage data and creates OpenCL Buffers for the data. The other method reads the volume data from a shared OpenGL Texture
    • Field Detail

      • m_kTextureID

        private WildMagic.LibRenderers.OpenGLRenderer.TextureID m_kTextureID
        OpenGL Texture ID containing the volume data.
    • Constructor Detail

      • OpenCLAlgorithmVolumeNormals

        public OpenCLAlgorithmVolumeNormals​(ModelImage srcImg,
                                            ModelImage destImg,
                                            long type)
        Create an OpenCL Algorithm for calculating the volume normals. Does not use OpenGL Shared texture.
        Parameters:
        srcImg - source image
        type - OpenCL Platform type, may be CL.CL_DEVICE_TYPE_GPU to specify the GPU or CL.CL_DEVICE_TYPE_CPU to specify the CPU.
    • Method Detail

      • calcNormals

        private void calcNormals()
        Calculates the volume normals from the input source ModelImage. Creates the kernels, command queue, and OpenCL buffers. Execute the kernels on the command queue and saves the result into a new ModelImage.