Code example for IntBuffer

Methods: clearget

0
        WritableRaster wr = out.getRaster();
        DataBufferInt db = (DataBufferInt) wr.getDataBuffer();
         
        int[] cpuArray = db.getData();
         
        bgraBuf.clear();
        bgraBuf.get(cpuArray);
         
//        int width  = wr.getWidth(); 
//        int height = wr.getHeight(); 
// 
//        // flip the components the way AWT likes them 
//        for (int y = 0; y < height / 2; y++){ 
//            for (int x = 0; x < width; x++){ 
//                int inPtr  = (y * width + x); 
//                int outPtr = ((height-y-1) * width + x); 
//                int pixel = cpuArray[inPtr]; 
//                cpuArray[inPtr] = cpuArray[outPtr]; 
//                cpuArray[outPtr] = pixel; 
//            } 
Contextual code suggestions in your IDE  Get Codota for Java