Interface LunaContentGenerator


public interface LunaContentGenerator
Interface for generative content providers in the Luna Video Mapping system.

This interface defines the contract for custom content generators that can be used as media sources within the Luna library. Generators create dynamic visual content programmatically rather than from static media files.

Implementing classes should provide:

  • Real-time content generation
  • Parameter customization for dynamic effects
  • Graphics buffer management for efficient rendering
  • Unique identification for UI integration

Implementation Notes:

  • Generators are discovered automatically through reflection
  • Each generator must be an inner class of the main sketch
  • The setup method is called once when the generator is assigned to a screen
  • The update method is called every frame for real-time content generation
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    processing.opengl.PGraphics2D
    Returns the current graphics buffer containing the generated content.
    Returns the display name of this content generator.
    Returns the list of customizable parameters for this generator.
    void
    setParameter(String name, float value)
    Sets the value of a specific parameter.
    void
    setup(int width, int height)
    Initializes the generator with the target display dimensions.
    void
    Updates the generator's internal state and renders content.
  • Method Details

    • getName

      String getName()
      Returns the display name of this content generator. This name is used in the UI for generator selection and identification.
      Returns:
      A unique, human-readable name for this generator
    • setup

      void setup(int width, int height)
      Initializes the generator with the target display dimensions. Called once when the generator is assigned to a screen. Use this method to set up graphics buffers, initialize variables, and prepare resources.
      Parameters:
      width - The width of the target display in pixels
      height - The height of the target display in pixels
    • update

      void update()
      Updates the generator's internal state and renders content. Called every frame to generate new content. Implementations should update animation states, calculate new visuals, and draw to their internal graphics buffer.
    • getGraphics

      processing.opengl.PGraphics2D getGraphics()
      Returns the current graphics buffer containing the generated content. This buffer is used by the video mapping system for homography transformation and final rendering. The generator should maintain its own PGraphics2D buffer and return it here.
      Returns:
      The PGraphics2D buffer containing the current generated frame
    • getParameters

      String[] getParameters()
      Returns the list of customizable parameters for this generator. These parameters are exposed in the UI for real-time adjustment. Each parameter should have a unique name that describes its function.
      Returns:
      Array of parameter names that can be adjusted
    • setParameter

      void setParameter(String name, float value)
      Sets the value of a specific parameter. Called when a parameter is adjusted in the UI. Implementations should update their internal state based on the new parameter value.
      Parameters:
      name - The name of the parameter to set
      value - The new value for the parameter