Examples of DataBufferInt


Examples of java.awt.image.DataBufferInt

        int endY = YToTileY(rectYend);

        //
        //  Get parameters of destination raster
        //
        DataBufferInt dstDB = (DataBufferInt)dstRaster.getDataBuffer();
        int[] dst           = dstDB.getData();
        int dstPS            = dstSM.getPixelStride();
        int dstSS            = dstSM.getScanlineStride();

        boolean tileParamsSet = false;
        ComponentSampleModel srcSM = null;
        int srcPS=0, srcSS=0;
        int xOrg, yOrg;
        int srcX1, srcY1, srcX2, srcY2, srcW, srcH;

        for (int y = startY; y <= endY; y++) {
            for (int x = startX; x <= endX; x++) {
                Raster tile = getTile(x, y);
                if (tile == null) {
                    //
                    // Out-of-bounds tile. Zero fill will be supplied
                    // since dstRaster is initialized to zero
                    //
                    continue;
                }

                if (! tileParamsSet) {
                    //
                    // These are constant for all tiles,
                    // so only set them once.
                    //
                    srcSM = (ComponentSampleModel)tile.getSampleModel();
                    srcPS = srcSM.getPixelStride();
                    srcSS = srcSM.getScanlineStride();
                    tileParamsSet = true;
                }

                //
                //  Intersect the tile and the rectangle
                //  Avoid use of Math.min/max
                //
                yOrg  = y*tileHeight + tileGridYOffset;
                srcY1 = yOrg;
                srcY2 = srcY1 + tileHeight - 1;
                if (bounds.y > srcY1) srcY1 = bounds.y;
                if (rectYend < srcY2) srcY2 = rectYend;
                srcH = srcY2 - srcY1 + 1;

                xOrg  = x*tileWidth + tileGridXOffset;
                srcX1 = xOrg;
                srcX2 = srcX1 + tileWidth - 1;
                if (bounds.x > srcX1) srcX1 = bounds.x;
                if (rectXend < srcX2) srcX2 = rectXend;
                srcW = srcX2 - srcX1 + 1;

                int dstX = srcX1 - bounds.x;
                int dstY = srcY1 - bounds.y;

                // Get the actual data array
                DataBufferInt srcDB = (DataBufferInt)tile.getDataBuffer();
                int[] src = srcDB.getData();

                int nsamps = srcW * srcPS;
                boolean useArrayCopy = (nsamps >= MIN_ARRAYCOPY_SIZE);

                int ySrcIdx = (srcY1 - yOrg)*srcSS + (srcX1 - xOrg)*srcPS;
 
View Full Code Here

Examples of java.awt.image.DataBufferInt

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

Examples of java.awt.image.DataBufferInt

                    {
                        int[][] bankData = (int[][])array;
                        /*for(int i = 0; i < numBanks; i++) {
                            Arrays.fill(bankData[i], 0);
                        }*/
                        db = new DataBufferInt(bankData, (int)size);
                    }
                    break;
                case DataBuffer.TYPE_FLOAT:
                    {
                        float[][] bankData = (float[][])array;
View Full Code Here

Examples of java.awt.image.DataBufferInt

                        shortArray[i] = (short)readInteger(input);
                    }
                    break;

                case DataBuffer.TYPE_INT:
                    DataBufferInt ibuf =
                        (DataBufferInt)tile.getDataBuffer();
                    int[] intArray = ibuf.getData();
                    for (int i = 0; i < size; i++) {
                        intArray[i] = readInteger(input);
                    }
                    break;
                }
View Full Code Here

Examples of java.awt.image.DataBufferInt

                    {
                        int[][] bankData = (int[][])array;
                        /* for(int i = 0; i < numBanks; i++) {
                            Arrays.fill(bankData[i], 0);
                        } */
                        db = new DataBufferInt(bankData, (int)size);
                    }
                    break;
                case DataBuffer.TYPE_FLOAT:
                    {
                        float[][] bankData = (float[][])array;
View Full Code Here

Examples of java.awt.image.DataBufferInt

                        // ignore
                    }
                }

                WritableRaster raster = bi.getRaster();
                DataBufferInt buffer = (DataBufferInt) raster.getDataBuffer();
                ThemeReader.paintBackground(buffer.getData(),
                        part.getControlName(c), part.getValue(),
                        TMSchema.State.getValue(part, state),
                        0, 0, w, h, w);

                if (sm.getClass().getName().equals("sun.awt.image.CachingSurfaceManager")) {
                    try {
                        boolean oldAccEnabled = (Boolean) ReflectionUtils.callGet(sm, "isLocalAccelerationEnabled");
                        if (accEnabled != oldAccEnabled) {
                            ReflectionUtils.callSet(sm, "setLocalAccelerationEnabled", accEnabled);
                            ReflectionUtils.call(sm, "rasterChanged");
                        }
                    }
                    catch (Exception e) {
                        // ignore
                    }
                }
            }
            else // copied from JDK7 XPStyle. To make the code compilable under JDk6, we use RefectionUtils
                boolean accEnabled = false;
                Skin skin = (Skin) args[0];
                Part part = skin.part;
                State state = (State) args[1];
                if (state == null) {
                    state = skin.state;
                }
                if (c == null) {
                    c = skin.component;
                }
                BufferedImage bi = (BufferedImage) image;

                WritableRaster raster = bi.getRaster();
                DataBufferInt dbi = (DataBufferInt) raster.getDataBuffer();
                // Note that stealData() requires a markDirty() afterwards
                // since we modify the data in it.
                try {
                    ThemeReader.paintBackground(
                            (int[]) ReflectionUtils.callStatic(SunWritableRaster.class, "stealData", new Class[]{DataBufferInt.class, int.class}, new Object[]{dbi, 0}),
View Full Code Here

Examples of java.awt.image.DataBufferInt

        if ( data == null ) {
            throw new IllegalArgumentException(JaiI18N.getString("Generic0"));
        }

        this.initOffsets(data.length, offset);
        this.data = new DataBufferInt(data, data[0].length);
    }
View Full Code Here

Examples of java.awt.image.DataBufferInt

        if ( data == null ) {
            throw new IllegalArgumentException(JaiI18N.getString("Generic0"));
        }

        this.initOffsets(data.length, offsets);
        this.data = new DataBufferInt(data, data[0].length);
    }
View Full Code Here

Examples of java.awt.image.DataBufferInt

                    shortDataArrays[i] = dbs.getData(bankIndices[i]);
                }
                break;

            case DataBuffer.TYPE_INT:
                DataBufferInt dbi = (DataBufferInt)raster.getDataBuffer();
                intDataArrays = new int[numBands][];
                for (int i = 0; i < numBands; i++) {
                    intDataArrays[i] = dbi.getData(bankIndices[i]);
                }
                break;

            case DataBuffer.TYPE_FLOAT:
                DataBuffer dbf = (DataBuffer)raster.getDataBuffer();
View Full Code Here

Examples of java.awt.image.DataBufferInt

        if ( data == null ) {
            throw new IllegalArgumentException(JaiI18N.getString("Generic0"));
        }

        this.initOffsets(1, 0);
        this.data = new DataBufferInt(data, data.length);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.