Package net.paulhertz.pixelaudio
Class DiagonalZigzagGen
java.lang.Object
net.paulhertz.pixelaudio.PixelMapGen
net.paulhertz.pixelaudio.DiagonalZigzagGen
Generates a PixelMapGen with a zigzag diagonal signal path. The path starts at (0,0) and (0,1), then goes diagonally
from edge to edge in a continuous path.
-
Field Summary
FieldsFields inherited from class net.paulhertz.pixelaudio.PixelMapGen
coords, flipx, flipy, fx270, fx90, h, nada, pixelMap, r180, r270, r90, sampleMap, size, transArray, transformType, uniformTransArray, w -
Constructor Summary
ConstructorsConstructorDescriptionDiagonalZigzagGen(int width, int height) DiagonalZigzagGen(int width, int height, AffineTransformType type) -
Method Summary
Modifier and TypeMethodDescriptiondescribe()Returns a description of the mapping and initialization requirements of a PixelMapGen class.int[]generate()Initialize this.coords, this.pixelMap, this.sampleMap.private ArrayList<int[]>Generically-named method that calls the custom coordinate generation method (here, generateZigzagDiagonalCoordinates).private ArrayList<int[]>generateZigzagDiagonalCoordinates(int width, int height) The coordinate generation method for this class.booleanvalidate(int width, int height) Always returns true for width and height greater than 1.static MultiGenzigzagLoop6x4(int genW, int genH) 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, randomUniformTransform, setMapsFromCoords, setTransformType, transformCoords
-
Field Details
-
description
- See Also:
-
-
Constructor Details
-
DiagonalZigzagGen
- Parameters:
width- PixelMapGen widthheight- PixelMapGen heighttype- an AffineTransformType to apply to the coordinates of the PixelMapGen
-
DiagonalZigzagGen
public DiagonalZigzagGen(int width, int height) - Parameters:
width- PixelMapGen widthheight- PixelMapGen height
-
-
Method Details
-
describe
Description copied from class:PixelMapGenReturns a description of the mapping and initialization requirements of a PixelMapGen class.- Specified by:
describein classPixelMapGen- Returns:
- A String describing this class's mapping and initialization requirements
-
validate
public boolean validate(int width, int height) Always returns true for width and height greater than 1.- 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()Initialize this.coords, this.pixelMap, this.sampleMap.- Specified by:
generatein classPixelMapGen- Returns:
- this.pixelMap, the value for PixelAudioMapper.signalToImageLUT.
-
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 of int[], bitmap coordinates in the order the signal mapping would visit them.
-
generateZigzagDiagonalCoordinates
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 arrayheight- height of the 2D bitmap pixel array- Returns:
- an array of coordinate pairs
-
zigzagLoop6x4
- Parameters:
genW- width of each zigzag gengenH- height of each zigzag gen- Returns:
- a looping MultiGen with 6 rows x 4 columns of DiagonalZigzagGen instances
-