My program produces 10 x 10 tiles images of 3000x3000 pixel, one by one (currently saved to 100 files named
I want to assemble these 100 images into one big image, without loading everything in memory. My goal is to create one big image file, of 30'000 * 30'000 pixels.
I believe there is a class in JAI that does this. Whatever problems you are having with integrating JAI into your project I would persevere with that rather than roll your own version. There is nothing like this in Java2D.
My original idea was to create a very big buffered image, from a DataBuffer backed to a file on the disk. But i'm not sure that this is possible. Did anybody ever do this ?
Yes I have written an incomplete implementation of this. It consists of
DataBufferthat is backed by a
ByteBufferinstead of an array (if the buffer is direct it can be mapped to a file.)
WritableRastersimilar to the standard rasters but using my implementation of
DataBuffer(the standard rasters in the JDK cheat by holding a reference to the backing array. There is no array in the case of a direct
ByteBufferso unfortunately you must re-implement most
I do not recommend extending
SampleModel because your class will not work with the JDK rasters (various methods in Java2D including the
Raster factory methods switch on the type of the
SampleModel assuming it is one of the standard ones. Bad design IMHO but not much you can do about it except follow the same pattern.)