Class DiagonalZigzagGen

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

public class DiagonalZigzagGen extends PixelMapGen
  • Field Details

  • Constructor Details

    • DiagonalZigzagGen

      public DiagonalZigzagGen(int width, int height, AffineTransformType type)
    • DiagonalZigzagGen

      public DiagonalZigzagGen(int width, int height)
  • Method Details

    • describe

      public String describe()
      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)
      Always returns true for width and height greater than 1.
      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()
      Initialize this.coords, this.pixelMap, this.sampleMap.
      Specified by:
      generate in class PixelMapGen
      Returns:
      this.pixelMap, the value for PixelAudioMapper.signalToImageLUT.
    • generateCoordinates

      private ArrayList<int[]> generateCoordinates()
      Generically-named method that calls the custom coordinate generation method (here, generateZigzagDiagonalCoordinates). Consider putting additional initializations here, if required by your coordinate generation method, rather than in the generate() method, which will then only handle coords initialization and the built-in pixelMap and sampleMap initializations.
      Returns:
      An ArrayList<int[]> of bitmap coordinates in the order the signal mapping would visit them.
    • generateZigzagDiagonalCoordinates

      private ArrayList<int[]> generateZigzagDiagonalCoordinates(int width, int height)
      The coordinate generation method for this class. Both lookup tables are derived from the coordinate list created by this method. The initial step in the algorithm is down (y--).
      Parameters:
      width - width of the 2D bitmap pixel array
      height - height of the 2D bitmap pixel array
      Returns:
      an array of coordinate pairs
    • zigzagLoop6x4

      public static MultiGen zigzagLoop6x4(int genW, int genH)
      Parameters:
      genW - width of each zigzag gen
      genH - height of each zigzag gen
      Returns:
      a looping MultiGen with 6 rows x 4 columns of DiagonalZigzagGen instances