File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
hybrid-programming/example2 Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 66N = 100_000
77
88# create points direct buffer and array
9- points_buffer = jpype .nio .convertToDirectBuffer (bytearray (4 * N * 2 )).asFloatBuffer ()
9+ points_bytearray = bytearray (4 * N * 2 )
10+ points_buffer = jpype .nio .convertToDirectBuffer (points_bytearray ).asFloatBuffer ()
1011points = np .asarray (points_buffer ).reshape (N , 2 )
1112
1213# create colors direct buffer and array
13- color_byte_array = bytearray (4 * N )
14- colors_buffer = jpype .nio .convertToDirectBuffer (color_byte_array ).asIntBuffer ()
15- colors = np .asarray (color_byte_array ).reshape (N , 4 )
14+ color_bytearray = bytearray (4 * N )
15+ colors_buffer = jpype .nio .convertToDirectBuffer (color_bytearray ).asIntBuffer ()
16+ colors = np .asarray (color_bytearray ).reshape (N , 4 )
1617
1718# Note that the `colors_buffer` is like an array of 32 bit Integers, which is
1819# how Processing stores color values. The `colors` numpy array is an array of
You can’t perform that action at this time.
0 commit comments