Class Bvv.Keyframe

java.lang.Object
sc.fiji.snt.viewer.Bvv.Keyframe
Enclosing class:
Bvv

public static class Bvv.Keyframe extends Object
A snapshot of the BVV viewer state at a particular moment, used as a keyframe for movie recording. Captures the viewer transform, camera/slab parameters (dCam, nearClip, farClip), and which "actors" (volume channels, paths, annotations) are visible.

Keyframes are serialized/deserialized via toString() and fromString(String) so they can be dumped to the console with the K hotkey and pasted into scripts.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    int
    Easing type for the transition into this keyframe (0-5).
    final double
    Camera depth parameter (perspective).
    final double
    Far clipping distance (slab back).
    int
    Number of frames for the transition from the previous keyframe into this one.
    final double
    Near clipping distance (slab front).
    final net.imglib2.realtransform.AffineTransform3D
    Viewer transform (camera position + zoom + rotation).
    final Set<String>
    Names of visible actors (e.g.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Keyframe(String serialized)
    Convenience constructor that deserializes a keyframe from a string.
    Keyframe(net.imglib2.realtransform.AffineTransform3D transform, double dCam, double nearClip, double farClip, Set<String> visibleActors, int accelType)
     
    Keyframe(net.imglib2.realtransform.AffineTransform3D transform, double dCam, double nearClip, double farClip, Set<String> visibleActors, int accelType, int frames)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Deserializes a keyframe from the string produced by toString().
    Returns the current easing type as a human-readable name.
    void
    Sets the easing type by name.
    Serializes this keyframe to a single-line string: transform=d0,d1,...,d11|cam=dCam,near,far|visible=a;b;c|accel=N

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • transform

      public final net.imglib2.realtransform.AffineTransform3D transform
      Viewer transform (camera position + zoom + rotation).
    • dCam

      public final double dCam
      Camera depth parameter (perspective).
    • nearClip

      public final double nearClip
      Near clipping distance (slab front).
    • farClip

      public final double farClip
      Far clipping distance (slab back).
    • visibleActors

      public final Set<String> visibleActors
      Names of visible actors (e.g. "vol:Sample#1", "paths", "annotations").
    • accelType

      public int accelType
      Easing type for the transition into this keyframe (0-5). Can be set by name via setAccel(String).
      See Also:
    • ACCEL_SYMMETRIC

      public static final int ACCEL_SYMMETRIC
      See Also:
    • ACCEL_SLOW_START

      public static final int ACCEL_SLOW_START
      See Also:
    • ACCEL_SLOW_END

      public static final int ACCEL_SLOW_END
      See Also:
    • ACCEL_SOFT_SYMMETRIC

      public static final int ACCEL_SOFT_SYMMETRIC
      See Also:
    • ACCEL_SOFT_SLOW_START

      public static final int ACCEL_SOFT_SLOW_START
      See Also:
    • ACCEL_SOFT_SLOW_END

      public static final int ACCEL_SOFT_SLOW_END
      See Also:
    • frames

      public int frames
      Number of frames for the transition from the previous keyframe into this one. Ignored for the first keyframe in a sequence. Defaults to 60 (~2 s at 30 fps).
  • Constructor Details

    • Keyframe

      public Keyframe(String serialized)
      Convenience constructor that deserializes a keyframe from a string. Equivalent to fromString(String) but usable as new Keyframe("transform=...|cam=...|...") in scripts.
      Parameters:
      serialized - the string produced by toString()
      Throws:
      IllegalArgumentException - if parsing fails
    • Keyframe

      public Keyframe(net.imglib2.realtransform.AffineTransform3D transform, double dCam, double nearClip, double farClip, Set<String> visibleActors, int accelType)
    • Keyframe

      public Keyframe(net.imglib2.realtransform.AffineTransform3D transform, double dCam, double nearClip, double farClip, Set<String> visibleActors, int accelType, int frames)
  • Method Details

    • setAccel

      public void setAccel(String name)
      Sets the easing type by name. Accepted values (case-insensitive, spaces or underscores): "symmetric", "slow_start" / "slow start", "slow_end", "soft_symmetric", "soft_slow_start", "soft_slow_end".
      Parameters:
      name - the easing name
      Throws:
      IllegalArgumentException - if the name is not recognized
    • getAccelName

      public String getAccelName()
      Returns the current easing type as a human-readable name.
      Returns:
      the easing name, e.g. "slow start"
    • toString

      public String toString()
      Serializes this keyframe to a single-line string: transform=d0,d1,...,d11|cam=dCam,near,far|visible=a;b;c|accel=N
      Overrides:
      toString in class Object
    • fromString

      public static Bvv.Keyframe fromString(String s)
      Deserializes a keyframe from the string produced by toString().
      Parameters:
      s - the serialised keyframe string
      Returns:
      a new Keyframe, or null if parsing fails