Class RandomContinousGen

java.lang.Object
net.paulhertz.pixelaudio.PixelMapGen
net.paulhertz.pixelaudio.RandomContinousGen

@Deprecated public class RandomContinousGen extends PixelMapGen
Deprecated.
  • Field Details

  • Constructor Details

    • RandomContinousGen

      public RandomContinousGen(int width, int height, AffineTransformType type)
      Deprecated.
    • RandomContinousGen

      public RandomContinousGen(int width, int height)
      Deprecated.
  • Method Details

    • describe

      public String describe()
      Deprecated.
      Specified by:
      describe in class PixelMapGen
      Returns:
      A String describing the mapping generated by your class and any initialization requirements.
    • validate

      public boolean validate(int width, int height)
      Deprecated.
      Specified by:
      validate in class PixelMapGen
      Returns:
      true if the width and height parameters are valid for creating a mapping with this generator, otherwise, false.
    • generate

      public int[] generate()
      Deprecated.
      Initializes this.coords, this.pixelMap, this.sampleMap: this is handled by a call to PixelMapGen's setMapsFromCoords() method.
      Specified by:
      generate in class PixelMapGen
      Returns:
      this.pixelMap, the value for PixelAudioMapper.signalToImageLUT.
    • generateCoordinates

      private ArrayList<int[]> generateCoordinates()
      Deprecated.
      Generically-named method that calls the custom coordinate generation method for a particular PixelMapGen child class. Here the method is generateBouCoordinates(). Additional initializations belong here, if required by your coordinate generation method, rather than in the generate() method.
      Returns:
      An ArrayList<int[]> of bitmap coordinates in the order the signal mapping would visit them.
    • generateHamiltonianPath

      public ArrayList<int[]> generateHamiltonianPath(int width, int height, int maxAttempts)
      Deprecated.
      Generated by ChatGPT, not quite a solution to a non-trivial problem. ChatGPT: " Thanks for the clarification — and you're absolutely right: generating a truly continuous, non-repeating, 4-connected path that visits every pixel exactly once is a classic problem. What you're asking for is essentially a Hamiltonian path over a grid graph, restricted to 4-connected neighbors. Requirements Recap: Starts at (0, 0) Visits every pixel exactly once Moves only up/down/left/right (4-connected) Never repeats, never jumps Has some randomness in the generated path " This is an NP-Complete computational problem: https://www.researchgate.net/publication/220616693_Hamilton_Paths_in_Grid_Graphs
      Parameters:
      width -
      height -
      Returns:
    • dfs

      private boolean dfs(int x, int y, int width, int height, boolean[][] visited, ArrayList<int[]> path, int endX, int endY)
      Deprecated.
    • inBounds

      private boolean inBounds(int x, int y, int width, int height)
      Deprecated.
    • shuffledDirections

      private int[][] shuffledDirections()
      Deprecated.
    • generateBoustrophedonPath

      private ArrayList<int[]> generateBoustrophedonPath(int width, int height)
      Deprecated.
    • generateRandomContinuousCoordinates

      private ArrayList<int[]> generateRandomContinuousCoordinates(int width, int height)
      Deprecated.