I have a problem that can basically be summirized as:
Byte[] barr = new Byte[25 * 1024 * 1024];
// use barr
The problem is that this cause an Out Of Memory exception.
A simple solution could be to allocate this memory “by chunks” and process a chunk at a time, but I cannot do that because I am using an external library that wants all the data to be processed in a whole.
More details about the application:
- The data to process is a Bitmap obtained by a laser imager (EMDK framework)
- I process the Bitmap saving in “barr” each 3rd byte of the Bitmap
- I pass “barr” to an external library that perform a gradient analysis and returns valid/invalid
- Loop until valid and save the bitmap
To not use that external library is not a feasable solution! (unfortunately)
Is it possible to validate the bitmap by pixel row? If the current row is not valid, push in the next row until you receive a valid reply?