|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.fractalkiss.util.Util | +--FrameCube
Cube alignment application and tools for working with text. Works a little differently from FramePlane, here -frame0 option causes looped processing of entire file.
Constructor Summary | |
FrameCube()
Creates new FrameCube |
Method Summary | |
static void |
align(char[][][] cube,
java.lang.String name,
int len,
int brk)
Performs so-called "alignment" by processing fragmented sets. |
static void |
alignFrames(char[][][] cube,
int res,
int frame,
java.io.InputStream in,
java.lang.String name)
Performs frame fragmentation |
static void |
loopRead(char[] looped,
int c,
int counter)
Reserved for looping inputstream, not implemented |
static void |
main(java.lang.String[] args)
java FrameCube -h |
static int[] |
parse(java.io.InputStream in,
java.lang.String name,
int res)
Parses text and writes 9 layers of increasing fragmenticity. |
static boolean |
readCube(char[][][] cube,
java.lang.String name,
int res)
Reads a char cube of size res*res*res from the name file |
static boolean |
repeat(char[] bef,
char[] aft)
checks if to char arrays have the same value |
static java.lang.String |
showBinary(char[] bin)
Displays spaced 8-bit presentation of char array |
static java.lang.String |
showDecimal(char[] bin)
Displays spaced 3-digit decimal presentation of char array |
static void |
writeCube(char[][][] cube,
java.lang.String name,
int res)
writes cube to name file |
static char[] |
xorNext(char[] sb)
performs XOR operation on every char with the next in the array, the last char XORs with the first |
Methods inherited from class net.fractalkiss.util.Util |
and, fill02, fill03, nand, or, writeBytes, writePlane, xor |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FrameCube()
Method Detail |
public static void main(java.lang.String[] args)
args
- java FrameCube -hpublic static void alignFrames(char[][][] cube, int res, int frame, java.io.InputStream in, java.lang.String name) throws java.lang.Exception
cube
- 3D char arrayres
- resolution 128 or 256frame
- bytes per framein
- stream of framed inputname
- stored cube if presentjava.lang.Exception
- file I/O exceptionspublic static void loopRead(char[] looped, int c, int counter)
looped
- char array, records frame*levels chars from beginningc
- character to writecounter
- position to writepublic static boolean readCube(char[][][] cube, java.lang.String name, int res)
cube
of size res*res*res
from the name
filecube
- 3D array to store the cubename
- file to readres
- size of cube sidespublic static void writeCube(char[][][] cube, java.lang.String name, int res)
cube
to name
filecube
- 3D char array to writename
- file nameres
- size of cube sidespublic static char[] xorNext(char[] sb)
sb
- char arraypublic static boolean repeat(char[] bef, char[] aft)
bef
- char array before NANDingaft
- char array after NANDingpublic static java.lang.String showDecimal(char[] bin)
bin
- char arraypublic static java.lang.String showBinary(char[] bin)
bin
- char arraypublic static int[] parse(java.io.InputStream in, java.lang.String name, int res)
1st layer is text, 2nd layer frag[0] = xor[0] NAND text xor[0] = text XOR loopLeft(text) 3rd layer frag[1] = xor[1] NAND xor[0] NAND text xor[1] = xor[0] XOR loopLeft xor[0] ... 9th layer frag[7] = xor[7] NAND ... xor[0] NAND text X NAND Y = NOT X AND Y : key fractal operation XOR operation on FRAMEs calculates overlaps NAND operation on overlaps and FRAMEs calculates fragments NAND operation on overlap(n+1) and overlap(n) calculates fragment shapes IXOR is the iterative XOR on frames, essentially it cleans overlaps IXOR(n,b) = IXOR(n-1,b) XOR IXOR(n-1,b plus 1) IXOR(0,b) = FRAME(b) XOR FRAME(b plus 1) FRAG calculates n increasingly fragmented copies of a given frame b FRAG(n,b) = INAND (n-1,b) NAND FRAME(b) INAND is iterative NAND of one xor mask with the previous from left to right INAND(n,b) = IXOR(n,b) NAND IXOR(n-1,b) NAND ... IXOR(0,b)if we view text as one frame, then looping text left by one letter will produce more frames. By looping xor mask we'll model consecutive xors of one frame with the next.
parse
frags only top frame (text itself)
producing 8 copies FRAG(0,0-7)
because text is repetitive.
Those copies are, of course, of same length and are layered one after another
below the text itself.res
- resolution 128 or 256in
- reader text streamname
- workfile to write, "work.acube" is defaultpublic static void align(char[][][] cube, java.lang.String name, int len, int brk)
cube[x][y][z] = cube[x][y][z] | 1 shiftLeft n
Now, it is enough to align text once, because of its inherent periodicity,
but you need to perform alignment on every frame of other kinds of input, like
video and audio. For every frame calculate 8 fragments and get to work. The alignment
cube will grow with periodicity records.cube
- 3D char arrayname
- stored cube filelen
- file lengthbrk
- number of fragments
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |