jvx.numeric

## Class PnLIC

- java.lang.Object
- - jvx.numeric.PnLIC

-     public class PnLIC
      extends java.lang.Object

  Line Integral Convolution for vector field visualization.

  After constructing an instance of this class one can immediately get the resulting LIC texture size by methods `getTextureWidth()` and `getTextureHeight()`.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PnLIC()` Creates a new LIC processor.
    `PnLIC(PgElementSet geom)` Creates a new LIC processor for given geometry.
    `PnLIC(PgElementSet geom, int size, PnGeodesicRK rk)` Creates a new LIC processor for given geometry.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `getCoarseness()`
    `int` | `getConvolutionWidth()` Deprecated. Use `getWorldConvolutionWidth()`.
    `int` | `getMinConvolutionWidth()`
    `int[]` | `getPixArray(int[] pix)`
    `int[]` | `getPixArray(int[] pix, double contrast)` Puts actual LIC texture line by line with offset 0 and scan width 'texturewidth' into given alphaRGB pixel array.
    `double` | `getStepSize()`
    `int` | `getTextureHeight()` Call this to get information about the actual height of the texture image that is used for the LIC image.
    `int` | `getTextureWidth()` Call this to get information about the actual width of the texture image that is used for the LIC image.
    `double` | `getWorldConvolutionWidth()` Normal (one-velocity) convolution width along integral lines in world coordinates.
    `void` | `makeElement(int elemIndex)` Computes Line Integral Convolution texture along all integral lines that begin in given element.
    `void` | `makeFastElement(int elem, PdVector[] texvector, PdBaryDir[] baryvector, double[] veclen, PdVector[] pixTexCoord, boolean[] computedVec, boolean[] computedCoord)` First try to make LIC *VERY* fast :-), experimental.
    `void` | `makeFastLIC()` First try to make LIC *VERY* fast :-), experimental.
    `void` | `makeLIC()` Computes LIC texture for all elements of geometry.
    `void` | `reset()` Initialize pixel array with zeroes.
    `boolean` | `setCoarseness(double coarse)` Sets the coarseness of noise that is convoluted to create the LIC image.
    `boolean` | `setConvolutionWidth(int numPixels)` Deprecated. Use `setWorldConvolutionWidth(double)`.
    `void` | `setGeometry(PgElementSet geom)` Set the size of the LIC texture.
    `boolean` | `setMinConvolutionWidth(int numPixels)` At every point their is a minimal number of pixels that are convoluted, even if `convolutionwidth*(velocity of vector field)` is less than this number (`minconvolutionwidth`).
    `void` | `setRungeKutta(PnGeodesicRK rk)` Sets the vector field for integration and the integration method.
    `void` | `setSize(int size)` Set the size of the LIC texture.
    `void` | `setStepSize(double h)` Sets the stepsize of the runge-kutta integration method.
    `boolean` | `setWorldConvolutionWidth(double width)` Sets normal (one-velocity) convolution width along integral lines in world coordinates.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PnLIC

          public PnLIC()

      Creates a new LIC processor. Later geometry, size and ode solver must be assigned.
      Since:
        JavaView 3.98.005

    - #### PnLIC

          public PnLIC(PgElementSet geom)

      Creates a new LIC processor for given geometry.
      Parameters:
        `geom` - underlying geometry

    - #### PnLIC

          public PnLIC(PgElementSet geom,
               int size,
               PnGeodesicRK rk)

      Creates a new LIC processor for given geometry. The vector field that shall be visualized is implicitly given by the geodesic Runge-Kutta class.
      Parameters:
        `geom` - underlying geometry
        `size` - width in pixels of longest edge of the geometry
        `rk` - geodesic Runge-Kutta method with vector field.
      See Also:
        `PnGeodesicRK`

  - ### Method Detail

    - #### setGeometry

          public void setGeometry(PgElementSet geom)

      Set the size of the LIC texture. Method allocates element texture in geometry based on size parameter.
      Parameters:
        `geom` - Geometry on which we operate.
      Since:
        JavaView 3.98.005

    - #### setSize

          public void setSize(int size)

      Set the size of the LIC texture. Method allocates element texture in geometry based on size parameter.
      Parameters:
        `size` - length in pixels of longest edge of the geometry.

    - #### setRungeKutta

          public void setRungeKutta(PnGeodesicRK rk)

      Sets the vector field for integration and the integration method.
      Parameters:
        `rk` - geodesic runge-kutta method that contains the vector field that shall be visualized
      See Also:
        `PnGeodesicRK`

    - #### getTextureWidth

          public int getTextureWidth()

      Call this to get information about the actual width of the texture image that is used for the LIC image.
      Returns:
        width of the texture image in pixels

    - #### getTextureHeight

          public int getTextureHeight()

      Call this to get information about the actual height of the texture image that is used for the LIC image.
      Returns:
        height of the texture image in pixels

    - #### setCoarseness

          public boolean setCoarseness(double coarse)

      Sets the coarseness of noise that is convoluted to create the LIC image.
      Parameters:
        `coarse` - 0 = fine; 1 = constant

    - #### getCoarseness

          public double getCoarseness()

    - #### setConvolutionWidth

          public boolean setConvolutionWidth(int numPixels)

      Deprecated. Use `setWorldConvolutionWidth(double)`.
      Sets normal (one-velocity) convolution width along integral lines in pixels. This value is only synchronized with `getWorldConvolutionWidth()` after `makeElement(int)` or `makeLIC()` is called. If worldConvolutionWidth has a value > 0, then the value of convolutionWidth is ignored!
      Parameters:
        `numPixels` - new width given in texture pixels

    - #### getConvolutionWidth

          public int getConvolutionWidth()

      Deprecated. Use `getWorldConvolutionWidth()`.
      This value is only synchronized with `getWorldConvolutionWidth()` after `makeElement(int)` or `makeLIC()` is called. If worldConvolutionWidth has a value > 0, then the value of convolutionWidth is ignored!

    - #### setWorldConvolutionWidth

          public boolean setWorldConvolutionWidth(double width)

      Sets normal (one-velocity) convolution width along integral lines in world coordinates. This value is only synchronized with `getConvolutionWidth()` after `makeElement(int)` or `makeLIC()` is called. If worldConvolutionWidth has a value > 0, then the value of convolutionWidth is ignored!
      The given length is only used approximately - in fact it is transformed to a number of texture pixels.
      Parameters:
        `width` - new width given in world coordinate length
      Returns:
        true if worldConvolutionWidth is set, false if convolutionWidth will be used (caused by invalid parameter 'width')
      Since:
        JavaView 2.49.009

    - #### getWorldConvolutionWidth

          public double getWorldConvolutionWidth()

      Normal (one-velocity) convolution width along integral lines in world coordinates. This value is only synchronized with `getConvolutionWidth()` after `makeElement(int)` or `makeLIC()` is called. If worldConvolutionWidth has a value > 0, then the value of convolutionWidth is ignored!
      The given length is only used approximately - in fact it is transformed to a number of texture pixels.
      Since:
        JavaView 2.49.009

    - #### setMinConvolutionWidth

          public boolean setMinConvolutionWidth(int numPixels)

      At every point their is a minimal number of pixels that are convoluted, even if `convolutionwidth*(velocity of vector field)` is less than this number (`minconvolutionwidth`). Of course this number may be zero. `minconvolutionwidth` may not be less than `convolutionwidth`.

    - #### getMinConvolutionWidth

          public int getMinConvolutionWidth()

    - #### setStepSize

          public void setStepSize(double h)

      Sets the stepsize of the runge-kutta integration method.
      Parameters:
        `h` - stepsize

    - #### getStepSize

          public double getStepSize()

    - #### makeElement

          public void makeElement(int elemIndex)

      Computes Line Integral Convolution texture along all integral lines that begin in given element. These integral lines may leave the element.
      Parameters:
        `elemIndex` - global element index in underlying geometry

    - #### getPixArray

          public int[] getPixArray(int[] pix)

      See Also:
        `getPixArray(int[], double)`

    - #### getPixArray

          public int[] getPixArray(int[] pix,
                          double contrast)

      Puts actual LIC texture line by line with offset 0 and scan width 'texturewidth' into given alphaRGB pixel array. It also performs a histogram transformation (boosting the contrast of image), so you should avoid calling this method if the LIC texture did not change since last call. The given integer array should be of sufficient size width*height, see `getTextureWidth()` and `getTextureHeight()`, or may be `null`. If parameter is `null` then a new integer array of the correct size is returned.
      Parameters:
        `pix` - output: actual LIC texture; should be of size texturewidth*textureheight
      Returns:
        the same as in parameter `pix`, or a new integer array that contains the results if `pix` is `null`
      Since:
        JavaView 2.48.005
      See Also:
        `getTextureWidth()`, `getTextureHeight()`

    - #### makeLIC

          public void makeLIC()

      Computes LIC texture for all elements of geometry. Method `getPixArray(int[])` returns the texture image. You need to call `setSize` before.
      See Also:
        `getPixArray(int[])`, `getPixArray(int[],double)`

    - #### reset

          public void reset()

      Initialize pixel array with zeroes.

    - #### makeFastLIC

          public void makeFastLIC()

      First try to make LIC *VERY* fast :-), experimental. You need to call `setSize(int)` before.
      Since:
        JavaView 2.65.000

    - #### makeFastElement

          public void makeFastElement(int elem,
                             PdVector[] texvector,
                             PdBaryDir[] baryvector,
                             double[] veclen,
                             PdVector[] pixTexCoord,
                             boolean[] computedVec,
                             boolean[] computedCoord)

      First try to make LIC *VERY* fast :-), experimental. You need to call `setSize(int)` before.
      Since:
        JavaView 2.65.000

"

The software JavaView? is copyright protected. All Rights Reserved.
"