boolean flip = origin() == IPL_ORIGIN_BL; // need to add support for ROI..
ByteBuffer in = getByteBuffer(roi == null ? 0 : roi.y*widthStep() + roi.x*nChannels());
SampleModel sm = image.getSampleModel();
Raster r = image.getRaster();
DataBuffer out = r.getDataBuffer();
int x = -r.getSampleModelTranslateX();
int y = -r.getSampleModelTranslateY();
int step = sm.getWidth()*sm.getNumBands();
int channels = sm.getNumBands();
if (sm instanceof ComponentSampleModel) {