Why is JAVA such a battle?
Using a high level language should make programming easier but I seem to be constantly fighting Java to find ways around its restrictions. I've struggled with the following two problems for ages and I'm not happy with the solutions I'm using. Please, can anybody tell me a better solution to either of them?
1. I have a YUV camera and I need access to the Y and V values. Cuurently I convert to RGB and then average the R,G and B values for an approximation to grey-scale. This seems crazy, just to access the data in a form that it was already in. RGB has all the functions such a pixelgrabber and getRED etc so there can't be any ggod reason why Java doesn't have equivalent functions for YUV. I even considered hijacking the "convert YUV2RGB" but got lost at the point where it calls its "native functions". Any ideas how I can access Y, U and V as a data array?
2. The program builds up a sequence of 16 images (RGB), stores them in an array of 16 elements, compresses them with JPG - each about 10KB (when compressed) and writes them to flash memory. Currently I write each jpg individually which is incredibly inefficient, writing data to flash in small blocks. Is there a way I can write the entire array of 16 images in a single transfer of 160KB (approx)?