Package net.paulhertz.pixelaudio

# Class MultiGen

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

public class MultiGen extends PixelMapGen
A PixelMapGen child class that combines multiple PixelMapGen instances with a single signal path. The signal path is not necessarily continuous over a 4-connected grid, i.e., the bitmap used by a PixelAudioMapper instance initialized with a MultiGen, but it may be.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `int`
  `columns`
  `static final String`
  `description`
  `ArrayList<PixelMapGen>`
  `genList`
  `ArrayList<int[]>`
  `offsetList`
  `int`
  `rows`

  ### Fields inherited from class net.paulhertz.pixelaudio.PixelMapGen

  `coords, flipx, flipy, fx270, fx90, h, nada, pixelMap, r180, r270, r90, sampleMap, size, transArray, transformType, w`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MultiGen(int width, int height)`
  `MultiGen(int width, int height, int rows, int columns, ArrayList<PixelMapGen> genList)`
  `MultiGen(int width, int height, ArrayList<int[]> offsetList, ArrayList<PixelMapGen> genList)`
  `MultiGen(int width, int height, AffineTransformType transform)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `describe()`
  `int[]`
  `generate()`
  Initialize this.coords, this.pixelMap, this.sampleMap.
  `private ArrayList<int[]>`
  `generateCoordinates()`
  Generically-named method that calls the custom coordinate generation method (here, generateMultiCoordinates).
  `private ArrayList<int[]>`
  `generateMultiCoordinates(int width, int height)`
  The coordinate generation method for this class.
  `int`
  `getColumns()`
  `ArrayList<PixelMapGen>`
  `getGenList()`
  `ArrayList<int[]>`
  `getOffsetList()`
  `int`
  `getRows()`
  `static MultiGen`
  `hilbertZigzagLoop6x4(int genW, int genH)`
  This method creates a MultiGen consisting of a mix of zigzag and Hilbert curves in 6 columns and 4 rows arranged to provide a continuous loop.
  `ArrayList<int[]>`
  `translateCoords(ArrayList<int[]> coordList, int tx, int ty)`
  `boolean`
  `validate(int width, int height)`

  ### Methods inherited from class net.paulhertz.pixelaudio.PixelMapGen

  `findNearestPowerOfTwoLessThan, findPowerOfTwo, getCoordinates, getCoordinatesCopy, getHeight, getInversMapFromPixelArray, getPixelMap, getPixelMapCopy, getPixelMapFromCoordinates, getSampleMap, getSampleMapCopy, getSize, getTransformType, getWidth, isPowerOfTwo, loadIndexMaps, randomTransform, setMapsFromCoords, setTransformType, transformCoords`

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

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

- ## Field Details

  - ### rows

    public int rows

  - ### columns

    public int columns

  - ### genList

    public ArrayList<PixelMapGen> genList

  - ### offsetList

    public ArrayList<int[]> offsetList

  - ### description

    public static final String description
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### MultiGen

    public MultiGen(int width, int height, AffineTransformType transform)
    Parameters:
      `width` -
      `height` -
      `transform` -

  - ### MultiGen

    public MultiGen(int width, int height)

  - ### MultiGen

    public MultiGen(int width, int height, int rows, int columns, ArrayList<PixelMapGen> genList)

  - ### MultiGen

    public MultiGen(int width, int height, ArrayList<int[]> offsetList, ArrayList<PixelMapGen> genList)

- ## 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)
    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, generateMultiCoordinates). 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.

  - ### generateMultiCoordinates

    private ArrayList<int[]> generateMultiCoordinates(int width, int height)
    The coordinate generation method for this class. Both lookup tables are derived from the coordinate list created by this method.
    Parameters:
      `width` - width of the 2D bitmap pixel array
      `height` - height of the 2D bitmap pixel array
    Returns:
      an array of coordinate pairs

  - ### translateCoords

    public ArrayList<int[]> translateCoords(ArrayList<int[]> coordList, int tx, int ty)

  - ### getRows

    public int getRows()

  - ### getColumns

    public int getColumns()

  - ### getGenList

    public ArrayList<PixelMapGen> getGenList()

  - ### getOffsetList

    public ArrayList<int[]> getOffsetList()

  - ### hilbertZigzagLoop6x4

    public static MultiGen hilbertZigzagLoop6x4(int genW, int genH)
    This method creates a MultiGen consisting of a mix of zigzag and Hilbert curves in 6 columns and 4 rows arranged to provide a continuous loop.
    Parameters:
      `genW` -
      `genH` -
    Returns: