Package org.geotools.resources.image

Examples of org.geotools.resources.image.ComponentColorModelJAI


                colorSpace = new BogusColorSpace(numberOfBands);
                int[] numBits = new int[numberOfBands];
                for (int i = 0; i < numberOfBands; i++) {
                    numBits[i] = bitsPerSample;
                }
                colorModel = new ComponentColorModelJAI(colorSpace, numBits, false, false,
                        Transparency.OPAQUE, dataType);
            }
            {
                int[] bankIndices = new int[numberOfBands];
                int[] bandOffsets = new int[numberOfBands];
View Full Code Here


        boolean isAlphaPremultiplied = false;
        int transparency = Transparency.TRANSLUCENT;
        int transferType = dataType;

        int[] nBits = { 8, 8, 8, 8 };
        ColorModel colorModel = new ComponentColorModelJAI(colorSpace, nBits, hasAlpha,
                isAlphaPremultiplied, transparency, transferType);

        /*
         * Do not use colorModel.createCompatibleSampleModel cause it creates a
         * PixelInterleavedSampleModel and we need a BandedSampleModel so it matches how the data
View Full Code Here

        boolean hasAlpha = false;
        boolean isAlphaPremultiplied = false;
        int transparency = Transparency.OPAQUE;
        int transferType = dataType;
        int[] nbits = { bitsPerPixel };
        ColorModel colorModel = new ComponentColorModelJAI(colorSpace, nbits, hasAlpha,
                isAlphaPremultiplied, transparency, transferType);

        SampleModel sampleModel = colorModel.createCompatibleSampleModel(sampleImageWidth,
                sampleImageHeight);
        its = new ImageTypeSpecifier(colorModel, sampleModel);
        return its;
    }
View Full Code Here

          raster.setSample(x, y, 0, noDataValue);
        else
          raster.setSample(x, y, 0, (x + y));
      }
    }
    final ColorModel cm = new ComponentColorModelJAI(ColorSpace
        .getInstance(ColorSpace.CS_GRAY), false, false,
        Transparency.OPAQUE, DataBuffer.TYPE_DOUBLE);
    final BufferedImage image = new BufferedImage(cm, raster, false, null);
    return image;
  }
View Full Code Here

    for (int y = 0; y < height; y++) {
      for (int x = 0; x < width; x++) {
        raster.setSample(x, y, 0, (x + y));
      }
    }
    final ColorModel cm = new ComponentColorModelJAI(ColorSpace
        .getInstance(ColorSpace.CS_GRAY), false, false,
        Transparency.OPAQUE, DataBuffer.TYPE_DOUBLE);
    final BufferedImage image = new BufferedImage(cm, raster, false, null);
    return image;
  }
View Full Code Here

    for (int y = 0; y < height; y++) {
      for (int x = 0; x < width; x++) {
        raster.setSample(x, y, 0, (x + y));
      }
    }
    final ColorModel cm = new ComponentColorModelJAI(ColorSpace
        .getInstance(ColorSpace.CS_GRAY), false, false,
        Transparency.OPAQUE, DataBuffer.TYPE_FLOAT);
    final BufferedImage image = new BufferedImage(cm, raster, false, null);
    return image;
  }
View Full Code Here

            }
            if (false) {
                // Our patched color model extends J2SE's ComponentColorModel (which work correctly
                // with our custom ColorSpace), but create JAI's SampleModel instead of J2SE's one.
                // It make RectIter happy and display colors correctly.
                return new ComponentColorModelJAI(colors, false, false, transparency, type);
            }
            // This factory is not really different from a direct construction of
            // FloatDoubleColorModel. We provide it here just because we must end
            // with something.
            return RasterFactory.createComponentColorModel(type, colors, false, false, transparency);
View Full Code Here

    for (int y = 0; y < height; y++) {
      for (int x = 0; x < width; x++) {
        raster.setSample(x, y, 0,Math.ceil(random.nextDouble()*maximum) );
      }
    }
    final ColorModel cm = new ComponentColorModelJAI(ColorSpace
        .getInstance(ColorSpace.CS_GRAY), false, false,
        Transparency.OPAQUE, DataBuffer.TYPE_DOUBLE);
    final BufferedImage image = new BufferedImage(cm, raster, false, null);
    return image;
  }   
View Full Code Here

TOP

Related Classes of org.geotools.resources.image.ComponentColorModelJAI

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.