Package javax.media.jai

Examples of javax.media.jai.RasterFormatTag


              layout.getWidth(null), layout.getHeight(null));

        // Set the format tag if and only if we will use the RasterAccessor.
        if(getTileWidth() != getWidth() || getTileHeight() != getHeight()) {
            rasterFormatTag =
                new RasterFormatTag(getSampleModel(),
                                    RasterAccessor.TAG_BYTE_UNCOPIED);
        }

        // Grab the entire image
        this.pixels = new int[width * height];
 
View Full Code Here


            SampleModel[] sampleModels = { getSampleModel() };
            int tagID =
                RasterAccessor.findCompatibleTag(sampleModels,
                                                 dest.getSampleModel());

            RasterFormatTag srcTag =
                new RasterFormatTag(getSampleModel(),tagID);
            RasterFormatTag dstTag =
                new RasterFormatTag(dest.getSampleModel(),tagID);

            for (int ty = startTileY; ty <= endTileY; ty++) {
                for (int tx = startTileX; tx <= endTileX; tx++) {
                    Raster tile = getTile(tx, ty);
                    Rectangle subRegion =
View Full Code Here

        // Create source accessors.
        RasterAccessor[] s = new RasterAccessor[numSources];
        for(int i = 0; i < numSources; i++) {
            if(sources[i] != null) {
                RasterFormatTag formatTag =
                    new RasterFormatTag(sources[i].getSampleModel(),
                                        formatTagID);
                s[i] = new RasterAccessor(sources[i], destRect, formatTag,
                                          null);
            }
        }

        // Create dest accessor.
        RasterAccessor d =
            new RasterAccessor(dest, destRect,
                               new RasterFormatTag(dest.getSampleModel(),
                                                   formatTagID),
                               null);

        // Create the alpha accessors.
        RasterAccessor[] a = new RasterAccessor[numSources];
        if(alphaRaster != null) {
            for(int i = 0; i < numSources; i++) {
                if(alphaRaster[i] != null) {
                    SampleModel alphaSM = alphaRaster[i].getSampleModel();
                    int alphaFormatTagID =
                        RasterAccessor.findCompatibleTag(null, alphaSM);
                    RasterFormatTag alphaFormatTag =
                        new RasterFormatTag(alphaSM, alphaFormatTagID);
                    a[i] = new RasterAccessor(alphaRaster[i], destRect, 
                                              alphaFormatTag,
                                              sourceAlpha[i].getColorModel());
                }
            }
View Full Code Here

        if (source2Alpha != null) {
            renderedSources[3] = source2Alpha;
            source2AlphaRaster = source2Alpha.getData(destRect);   
        }

        RasterFormatTag tags[] =
            RasterAccessor.findCompatibleTags(renderedSources, this);
        RasterAccessor s1 = new RasterAccessor(sources[0], destRect,
                                          tags[0],getSourceImage(0).getColorModel());
        RasterAccessor s2 = new RasterAccessor(sources[1], destRect,
                                          tags[1],getSourceImage(1).getColorModel());
View Full Code Here

/*  758 */       int endTileY = PlanarImage.YToTileY(region.y + region.height - 1, this.tileGridYOffset, this.tileHeight);
/*      */
/*  762 */       SampleModel[] sampleModels = { getSampleModel() };
/*  763 */       int tagID = RasterAccessor.findCompatibleTag(sampleModels, dest.getSampleModel());
/*      */
/*  767 */       RasterFormatTag srcTag = new RasterFormatTag(getSampleModel(), tagID);
/*      */
/*  769 */       RasterFormatTag dstTag = new RasterFormatTag(dest.getSampleModel(), tagID);
/*      */
/*  772 */       for (int ty = startTileY; ty <= endTileY; ty++) {
/*  773 */         for (int tx = startTileX; tx <= endTileX; tx++) {
/*  774 */           Raster tile = getTile(tx, ty);
/*  775 */           Rectangle subRegion = region.intersection(tile.getBounds());
View Full Code Here

/*     */   public AWTImageOpImage(Map config, ImageLayout layout, Image image)
/*     */   {
/* 151 */     super(layout = layoutHelper(layout, image), config, layout.getSampleModel(null), layout.getMinX(null), layout.getMinY(null), layout.getWidth(null), layout.getHeight(null));
/*     */
/* 157 */     if ((getTileWidth() != getWidth()) || (getTileHeight() != getHeight())) {
/* 158 */       this.rasterFormatTag = new RasterFormatTag(getSampleModel(), 0);
/*     */     }
/*     */
/* 164 */     this.pixels = new int[this.width * this.height];
/* 165 */     PixelGrabber grabber = new PixelGrabber(image, 0, 0, this.width, this.height, this.pixels, 0, this.width);
/*     */     try
View Full Code Here

        final SampleModel[] sourceSM = new SampleModel[] { sources.getSampleModel() };
        final int formatTagID = RasterAccessor.findCompatibleTag(sourceSM, destinationRaster.getSampleModel());

        // Create dest accessor.
        final RasterAccessor rasterAccessor = new RasterAccessor(destinationRaster, destRect,
                new RasterFormatTag(destinationRaster.getSampleModel(), formatTagID), null);

        final int dataType = rasterAccessor.getDataType();
        // Branch to data type-specific method.
        switch (dataType) {
        case DataBuffer.TYPE_BYTE:
View Full Code Here

TOP

Related Classes of javax.media.jai.RasterFormatTag

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.