Package com.google.code.appengine.awt.image

Examples of com.google.code.appengine.awt.image.DataBufferInt


                    h != savedRaster.getHeight()) {
                savedRaster =
                        getColorModel().createCompatibleWritableRaster(w, h);

                // Suppose we have here simple INT/RGB color/sample model
                DataBufferInt intBuffer =
                        (DataBufferInt) savedRaster.getDataBuffer();
                int rgbValues[] = intBuffer.getData();
                int rgbFillValue = rgbValue;
                Arrays.fill(rgbValues, rgbFillValue);
            }

            return savedRaster;
View Full Code Here


    static protected AwtImageBackdoorAccessor inst;

    public static AwtImageBackdoorAccessor getInstance(){
        // First we need to run the static initializer in the DataBuffer class to resolve inst.
        new DataBufferInt(0);
        return inst;
    }
View Full Code Here

            if(cm == model && model.getTransferType() == DataBuffer.TYPE_INT &&
                    raster.getNumDataElements() == 1){

                int data[] = (int[])surfData;
                int scanline = raster.getWidth();
                DataBufferInt dbi = (DataBufferInt) db;
                int rof = dbi.getOffset() + y * scanline + x;
                for(int lineOff = off, line = y; line < y + h;
                    line++, lineOff += scansize, rof += scanline){

                    System.arraycopy(pixels, lineOff, data, rof, w);
                }

            }else if(isIntRGB){
                int buff[] = new int[w];
                int data[] = (int[])surfData;
                int scanline = raster.getWidth();
                DataBufferInt dbi = (DataBufferInt) db;
                int rof = dbi.getOffset() + y * scanline + x;
                for (int sy = y, sOff = off; sy < y + h; sy++, sOff += scansize,
                    rof += scanline) {

                    for (int sx = x, idx = 0; sx < x + w; sx++, idx++) {
                        buff[idx] = model.getRGB(pixels[sOff + idx]);
View Full Code Here

        synchronized(surfData){
            if(isIntRGB){
                int buff[] = new int[w];
                int data[] = (int[])surfData;
                int scanline = raster.getWidth();
                DataBufferInt dbi = (DataBufferInt) db;
                int rof = dbi.getOffset() + y * scanline + x;
                if(model instanceof IndexColorModel){

                    IndexColorModel icm = (IndexColorModel) model;
                    int colorMap[] = new int[icm.getMapSize()];
                    icm.getRGBs(colorMap);
View Full Code Here

                byte data[] = dbb.getData();
                int off = dbb.getOffset();
                ic.setPixels(0, 0, width, height, cm, data, off, width);
            }else if(cm instanceof DirectColorModel &&
                    raster.getTransferType() == DataBuffer.TYPE_INT){
                DataBufferInt dbi = (DataBufferInt) raster.getDataBuffer();
                int data[] = dbi.getData();
                int off = dbi.getOffset();
                ic.setPixels(0, 0, width, height, cm, data, off, width);
            }else if(cm instanceof DirectColorModel &&
                    raster.getTransferType() == DataBuffer.TYPE_BYTE){
                DataBufferByte dbb = (DataBufferByte) raster.getDataBuffer();
                byte data[] = dbb.getData();
View Full Code Here

            break;
        case DataBuffer.TYPE_USHORT:
            data = new DataBufferUShort(size);
            break;
        case DataBuffer.TYPE_INT:
            data = new DataBufferInt(size);
            break;
        }
        return data;
    }
View Full Code Here

            break;
        case DataBuffer.TYPE_USHORT:
            data = new DataBufferUShort(size, numBanks);
            break;
        case DataBuffer.TYPE_INT:
            data = new DataBufferInt(size, numBanks);
            break;
        case DataBuffer.TYPE_FLOAT:
            data = new DataBufferFloat(size, numBanks);
            break;
        case DataBuffer.TYPE_DOUBLE:
View Full Code Here

        case DataBuffer.TYPE_SHORT:
        case DataBuffer.TYPE_USHORT:
            data = new DataBufferShort(size, numBanks);
            break;
        case DataBuffer.TYPE_INT:
            data = new DataBufferInt(size, numBanks);
            break;
        case DataBuffer.TYPE_FLOAT:
            data = new DataBufferFloat(size, numBanks);
            break;
        case DataBuffer.TYPE_DOUBLE:
View Full Code Here

                    rgbData[i] = cm.getRGB(iData[i]);
                }
            }

            cm = ColorModel.getRGBdefault();
            DataBufferInt db = new DataBufferInt(rgbData, size);
            int masks[] = new int[] {0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000};
            raster = Raster.createPackedRaster(db, width, height, width, masks, null);
            iData = accessor.getDataInt(db);
            bData = null;
            transferType = DataBuffer.TYPE_INT;
View Full Code Here

            break;
        case DataBuffer.TYPE_USHORT:
            dataBuffer = new DataBufferUShort(size + (dataBitOffset + 15) / 16);
            break;
        case DataBuffer.TYPE_INT:
            dataBuffer = new DataBufferInt(size + (dataBitOffset + 31) / 32);
            break;
        }
        return dataBuffer;
    }
View Full Code Here

TOP

Related Classes of com.google.code.appengine.awt.image.DataBufferInt

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.