Package sun.awt.image

Examples of sun.awt.image.ShortInterleavedRaster


        switch(dataType) {
        case DataBuffer.TYPE_BYTE:
            return new ByteInterleavedRaster(sppsm, dataBuffer, location);

        case DataBuffer.TYPE_USHORT:
            return new ShortInterleavedRaster(sppsm, dataBuffer, location);

        case DataBuffer.TYPE_INT:
            return new IntegerInterleavedRaster(sppsm, dataBuffer, location);

        default:
View Full Code Here


            switch(dataType) {
                case DataBuffer.TYPE_BYTE:
                    return new ByteInterleavedRaster(sm, db, location);

                case DataBuffer.TYPE_USHORT:
                    return new ShortInterleavedRaster(sm, db, location);
            }
        } else if (sm instanceof SinglePixelPackedSampleModel) {
            switch(dataType) {
                case DataBuffer.TYPE_BYTE:
                    return new ByteInterleavedRaster(sm, db, location);

                case DataBuffer.TYPE_USHORT:
                    return new ShortInterleavedRaster(sm, db, location);

                case DataBuffer.TYPE_INT:
                    return new IntegerInterleavedRaster(sm, db, location);
            }
        } else if (sm instanceof MultiPixelPackedSampleModel &&
View Full Code Here

            switch(dataType) {
                case DataBuffer.TYPE_BYTE:
                    return new ByteInterleavedRaster(sm, db, location);

                case DataBuffer.TYPE_USHORT:
                    return new ShortInterleavedRaster(sm, db, location);
            }
        } else if (sm instanceof SinglePixelPackedSampleModel) {
            switch(dataType) {
                case DataBuffer.TYPE_BYTE:
                    return new ByteInterleavedRaster(sm, db, location);

                case DataBuffer.TYPE_USHORT:
                    return new ShortInterleavedRaster(sm, db, location);

                case DataBuffer.TYPE_INT:
                    return new IntegerInterleavedRaster(sm, db, location);
            }
        } else if (sm instanceof MultiPixelPackedSampleModel &&
View Full Code Here

        switch(dataType) {
        case DataBuffer.TYPE_BYTE:
            return new ByteInterleavedRaster(csm, dataBuffer, location);

        case DataBuffer.TYPE_USHORT:
            return new ShortInterleavedRaster(csm, dataBuffer, location);

        default:
            throw new IllegalArgumentException("Unsupported data type " +
                                                dataType);
        }
View Full Code Here

                    break;
                default:
                    throw new UnknownImageTypeException("Unknown Bayer filter pattern.");
            }

            final ShortInterleavedRaster dcrawRaster = (ShortInterleavedRaster) dcrawImage.getRaster();

            final BufferedImage dcrawImage2 = (BufferedImage) dcRaw.runDCRaw(DCRaw.dcrawMode.full, true);
            final ShortInterleavedRaster dcrawRaster2 = (ShortInterleavedRaster) dcrawImage2.getRaster();

            short data[] = dcrawRaster.getDataStorage();
            short data2[] = dcrawRaster2.getDataStorage();

            float[] cameraMultipliers = dcRaw.getCameraMultipliers();
            float[] secondaryCameraMultipliers = dcRaw.getSecondaryCameraMultipliers();

            float redRatio = secondaryCameraMultipliers[0] / cameraMultipliers[0];
View Full Code Here

            ByteInterleavedRaster source = (ByteInterleavedRaster) sources[0];
            ByteInterleavedRaster destination = (ByteInterleavedRaster) dest;

            transform.doTransform(source, destination);
        } else if (sources[0] instanceof ShortInterleavedRaster && dest instanceof ShortInterleavedRaster) {
            ShortInterleavedRaster source = (ShortInterleavedRaster) sources[0];
            ShortInterleavedRaster destination = (ShortInterleavedRaster) dest;

            transform.doTransform(source, destination);
        } else
            throw new IllegalArgumentException( "Input and output rasters don't match!" );
    }
View Full Code Here

        // System.out.println("RGBColorSelectionMaskOpImage - L:" + L + ", a:" + a + ", b: " + b + ", radius: " + colorSelection.radius);
    }

    protected void computeRect(Raster[] sources, WritableRaster dest, Rectangle destRect) {
        ShortInterleavedRaster src = (ShortInterleavedRaster) sources[0];
        ByteInterleavedRaster dst = (ByteInterleavedRaster) dest;

        dst = (ByteInterleavedRaster) dst.createChild(destRect.x, destRect.y, destRect.width, destRect.height,
                                                      destRect.x, destRect.y, null);

        int width = dst.getWidth();
        int height = dst.getHeight();

        byte dstData[] = dst.getDataStorage();
        int dstBandOffsets[] = dst.getDataOffsets();
        int dstLineStride = dst.getScanlineStride();
        // int dstPixelStride = dst.getPixelStride();

        short srcData[] = src.getDataStorage();
        int srcBandOffsets[] = src.getDataOffsets();
        int srcLineStride = src.getScanlineStride();
        // int srcPixelStride = src.getPixelStride();

        int dstOffset = dstBandOffsets[0];

        float colorSelectionArray[] = {
View Full Code Here

        super(source, createLayout(source), config, true);
        this.colorSelection = colorSelection;
    }

    protected void computeRect(Raster[] sources, WritableRaster dest, Rectangle destRect) {
        ShortInterleavedRaster src = (ShortInterleavedRaster) sources[0];
        ByteInterleavedRaster dst = (ByteInterleavedRaster) dest;

        dst = (ByteInterleavedRaster) dst.createChild(destRect.x, destRect.y, destRect.width, destRect.height,
                                                      destRect.x, destRect.y, null);

        int width = dst.getWidth();
        int height = dst.getHeight();

        byte dstData[] = dst.getDataStorage();
        int dstBandOffsets[] = dst.getDataOffsets();
        int dstLineStride = dst.getScanlineStride();
        // int dstPixelStride = dst.getPixelStride();

        short srcData[] = src.getDataStorage();
        int srcBandOffsets[] = src.getDataOffsets();
        int srcLineStride = src.getScanlineStride();
        // int srcPixelStride = src.getPixelStride();

        int dstOffset = dstBandOffsets[0];

        float colorSelectionArray[] = {
View Full Code Here

            );
        final WritableRaster outBuffer;
        if (dataType == DataBuffer.TYPE_BYTE)
            outBuffer = new ByteInterleavedRaster(sm, new Point(0, 0));
        else
            outBuffer = new ShortInterleavedRaster(sm, new Point(0, 0));

        int stripIndex = 0;
        for ( int y = 0; y < imageHeight; y += stripHeight ) {
            if ( thread != null && thread.isCanceled() )
                return;

            final int currentStripHeight = Math.min( stripHeight, imageHeight - y );

            // Create a child raster of the out buffer for the current strip
            final WritableRaster raster = outBuffer.createWritableChild(0, 0, imageWidth, currentStripHeight, 0, y, null);

            // Prefetch tiles, uses all CPUs
            if (image instanceof PlanarImage)
                ((PlanarImage) image).getTiles(((PlanarImage) image).getTileIndices(raster.getBounds()));

            image.copyData(raster);

            int offset;
            if (raster instanceof ByteInterleavedRaster) {
                final ByteInterleavedRaster interleaved =
                    (ByteInterleavedRaster) raster;

                final int[] offsets = interleaved.getDataOffsets();
                offset = offsets[0];
                for (int i = 1; i < offsets.length; i++)
                    offset = Math.min(offset, offsets[i]);

                final DataBufferByte db = (DataBufferByte)raster.getDataBuffer();

                final int written = writeStripByte( stripIndex, db.getData(), offset, bands * imageWidth * currentStripHeight );

                if ( written != bands * imageWidth * currentStripHeight )
                    throw new LCImageLibException(
                        "something is wrong: " + written + " != " +
                        (bands * imageWidth * currentStripHeight)
                    );
            } else {
                final ShortInterleavedRaster interleaved =
                    (ShortInterleavedRaster) raster;

                final int[] offsets = interleaved.getDataOffsets();
                offset = offsets[0];
                for (int i = 1; i < offsets.length; i++)
                    offset = Math.min(offset, offsets[i]);

                final DataBufferUShort db = (DataBufferUShort) raster.getDataBuffer();
View Full Code Here

                                                                                raster.getHeight(),
                                                                                bands, bands * raster.getWidth(),
                                                                                bands == 1
                                                                                ? new int[] {0}
                                                                                : new int[] {0, 1, 2});
            ShortInterleavedRaster newRaster = new ShortInterleavedRaster(newSM, new Point(raster.getMinX(),
                                                                                           raster.getMinY()));

            Functions.copyData(newRaster, raster);
            raster = newRaster;
        }
View Full Code Here

TOP

Related Classes of sun.awt.image.ShortInterleavedRaster

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.