Class MooreGen
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMooreGen(int depth) MooreGen(int width, int height) MooreGen(int width, int height, AffineTransformType type) MooreGen(int depth, AffineTransformType type) -
Method Summary
Modifier and TypeMethodDescriptiondescribe()int[]generate()Initialization method that setsthis.coords, and thenthis.pixelMapandthis.sampleMap:this.coordsis a list of coordinate pairs representing the signal path, the (x,y) pixel locations along a path that visits every pixel in a bitmap exactly once.private ArrayList<int[]>private ArrayList<int[]>generateMooreCoordinates(int n) booleanvalidate(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
-
Field Details
-
depth
public int depthrecursion depth -
description
- See Also:
-
-
Constructor Details
-
MooreGen
-
MooreGen
public MooreGen(int width, int height) -
MooreGen
public MooreGen(int depth) -
MooreGen
-
-
Method Details
-
describe
- Specified by:
describein classPixelMapGen- Returns:
- A String describing the mapping generated by your class and any initialization requirements.
-
validate
public boolean validate(int width, int height) - Specified by:
validatein classPixelMapGen- Returns:
- true if the width and height parameters are valid for creating a mapping with this generator, otherwise, false.
-
generate
public int[] generate()Description copied from class:PixelMapGenInitialization method that sets
this.coords, and thenthis.pixelMapandthis.sampleMap:this.coordsis a list of coordinate pairs representing the signal path, the (x,y) pixel locations along a path that visits every pixel in a bitmap exactly once. Once you have created it, you can callsetMapsFromCoords()to setthis.pixelMapandthis.sampleMapautomatically.generate()must be called from your class, so that you can initialize any local variables before generating coordinates and LUTs. The best place to call it is typically on the last line of the constructor for your class, after calling super() on the first line and after initializing any local variables needed to generate your coordinates and LUTs. You must initializethis.coords,this.pixelMap, andthis.sampleMapwithin generate(). SeeDiagonalZigzagGenorHilbertGenfor sample code.- Specified by:
generatein classPixelMapGen- Returns:
- this.pixelMap, the value for PixelAudioMapper.signalToImageLUT.
-
generateCoordinates
- Returns:
- an ArrayList<int[]> of x, y coordinate pairs that are the points traversed by a generalized space-filling curve over a bitmap of dimensions w * h.
-
generateMooreCoordinates
- Parameters:
n- the number of coordinate pairs to generate.- Returns:
- an ArrayList<int[]> of x, y coordinate pairs that are the points traversed by a generalized space-filling curve over a bitmap of dimensions w * h.
-