Examples of DataBufferByte


Examples of java.awt.image.DataBufferByte

        }
        int size = (int)lsize;

        switch(dataType) {
        case DataBuffer.TYPE_BYTE:
            d = new DataBufferByte(size, banks);
            break;

        case DataBuffer.TYPE_USHORT:
            d = new DataBufferUShort(size, banks);
            break;
View Full Code Here

Examples of java.awt.image.DataBufferByte

        // Restore the transient DataBuffer.
        switch (dataType) {
        case DataBuffer.TYPE_BYTE:
            dataBuffer =
                new DataBufferByte((byte[][])dataArray, size, offsets);
            break;
        case DataBuffer.TYPE_SHORT:
            dataBuffer =
                new DataBufferShort((short[][])dataArray, size, offsets);
            break;
View Full Code Here

Examples of java.awt.image.DataBufferByte

        DataBuffer dataBuffer;
        WritableRaster ras = null;
        Point origin = new Point(0, 0);
        if ((bitDepth < 8) && (bands == 1)) {
            dataBuffer = new DataBufferByte(height*scanlineStride);
            ras = Raster.createPackedRaster(dataBuffer,
                                            width, height,
                                            bitDepth,
                                            origin);
        } else if (bitDepth <= 8) {
            dataBuffer = new DataBufferByte(height*scanlineStride);
           ras = Raster.createInterleavedRaster(dataBuffer,
                                                 width, height,
                                                 scanlineStride,
                                                 bands,
                                                 bandOffsets[bands],
View Full Code Here

Examples of java.awt.image.DataBufferByte

        int endY = YToTileY(rectYend);

        //
        //  Get parameters of destination raster
        //
        DataBufferByte dstDB = (DataBufferByte)dstRaster.getDataBuffer();
        byte[] 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
                DataBufferByte srcDB = (DataBufferByte)tile.getDataBuffer();
                byte[] 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.DataBufferByte

        DataBuffer dataBuffer = null;

        int size = (int)getBufferSize();
        switch (dataType) {
        case DataBuffer.TYPE_BYTE:
            dataBuffer = new DataBufferByte(size, numBanks);
            break;
        case DataBuffer.TYPE_USHORT:
            dataBuffer = new DataBufferUShort(size, numBanks);
            break;
        case DataBuffer.TYPE_INT:
View Full Code Here

Examples of java.awt.image.DataBufferByte

                // SampleModel for these cases should be PixelInterleaved.
                int size = width*height*numBands;

                switch (dataType) {
                case DataBuffer.TYPE_BYTE:
                    DataBufferByte bbuf =
                        (DataBufferByte)tile.getDataBuffer();
                    byte[] byteArray = bbuf.getData();
                    if (isRaw(variant)) {
                        input.readFully(byteArray);
                    } else {
                        for (int i = 0; i < size; i++) {
                            byteArray[i] = (byte)readInteger(input);
View Full Code Here

Examples of java.awt.image.DataBufferByte

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

Examples of java.awt.image.DataBufferByte

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

Examples of java.awt.image.DataBufferByte

                                                  numChannels,
                                                  bandOffsets,
                                                  new Point(tx, ty));
        // System.out.println("Uncompressed tile.");

        DataBufferByte dataBuffer = (DataBufferByte)ras.getDataBuffer();
        byte[] data = dataBuffer.getData();

        int tileIndex = tileY*tilesAcross + tileX;
        subimageDataStream.seek(getTileOffset(tileIndex));
        subimageDataStream.readFully(data, 0,
                                     numChannels*tileWidth*tileHeight);
 
View Full Code Here

Examples of java.awt.image.DataBufferByte

                                                  bandOffsets,
                                                  new Point(tx, ty));

        int subimageColorType = subimageColor[resolution][0] >> 16;

        DataBufferByte dataBuffer = (DataBufferByte)ras.getDataBuffer();
        byte[] data = dataBuffer.getData();

        int tileIndex = tileY*tilesAcross + tileX;
        int color = getCompressionSubtype(tileIndex);
        byte c0 = (byte)((color >> 0) & 0xff);
        byte c1 = (byte)((color >> 8) & 0xff);
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.