i have, inside of FOR-loops, arrays of PImages which are filled with different images from disk everytime the loop is executed. but i have the feeling that the loaded data from the past runs of the loop are still in the memory, since the swap usage and swap space of my machine is growing more and more while the sketch s running. i need the PImages only for the time of one run of the loop, then i need the next set of images in the array of PImages. is there a way to clear the image data from the memory? i have already tried to set the PImage array =null at the loop's end; and also to set each of its slots/elements to null, but it didn't reduce the swap amount of memory.
i only put in the relevant part of the sketch. does anyone have a hint?
i have a problem: i am taking screenshots, take single lines out of them and save them as Images. things is, i need them to have transparency.
every trick i tried doesn't seem to do that.
i tried tint(255, 255, 255, 255) on the image; processing says this metthod doesn't exist. well, it's in the reference, dude! am i doing something wrong?
i tried to do an own method convertToARGB() which would do pixel math, no success.
i want to choose one random value out of 4, but for every of these 4, there should be a certain probability of how probable that one is picked. the only solution i came up with so far is, if i have for example probabilities like 2, 3, 3 and 2 for the values A, B, C, and D, to generate a random int i between 1 and 10 and then have an if-else-if-construction that selects value A if (1 <= i <= 2) , B if (3<= i <=5), C id (6<= i <=8) and D if (9 <= i <=10).
i want to program a markov model. for now, it should have an oder of 3 and work with integers (maybe later also chars). I also want the model to be able to train itself automatically, by "feeding in" sequences of 3 integers.
it seems to me at the moment a good way would be to work with hashmaps that are nested into each other, basically like this:
1st level HM start
|
| key1
| 2nd level HM start
| |
| | key1
| | 3rd level HM start
| | |
| | | key 1, value 1
| | | key 2, value 2
| | | key 3, value 3
| | | ...
| | |
| | 3rd level HM end
| |
| | key2
| | 3rd level HM start
| | | ...
| | 3rd level HM end
| |
| 2nd level HM end
|
| key2
| 2nd level HM start
| | ...
| 2nd level HM end
|
| key3
| 2nd level HM start
| | ...
| 2nd level HM end
|
1st level HM end
i thought it would be a good solution to write an own "Entry" class that extends the HashMap class; so that an entry on the 1st and 2nd level always contains another hashmap, and an entry on the 3rd level contains elements and their respective stochastic probability to appear after the elements of the 1st and 2nd level.
if there are any recommendations, examples, links relating to this or to nestig objects, i would be happy to hear them.
there's lots written about color extraction, bit shifting, etc. but i can't find an answer to how many bits are used with the ALPHA PImage image type. 8, or 16?
I calculate the brightness of an RGB bitwise through
in supercollider there are methods for comparing / intersect / find difference between etc arrays. i need to do similar operations in processing. are there any of those, for modifying arrays? or is there a different class (maybe from java) that allows such?
what i need: i will have a finite amount of ints. i want to move them in groups between 3 different arrays. for example, they are all in the first array, then i "move" (copy and remove) the first 100 ints to the second array, the from there the first 50 to the third array, then the first 20 back to the first array. every int can be inside of only one array at the same time, either first or second or third, never in two of the arrays.
can anybody give me a hint? thanks a lot, best regards!
i wonder if it's possible to connect three or more particles rigidly in traer.physics.
so that 3 particles behave like a seesaw, where the middle point is fixed, and the left and right move always in opposit directions, and keep their distance to the middle.
i could construct a cross from 5 particles, and very strong springs inbetween everywhere, but it looks like a bit clumsy solution...