Package javax.media.jai

Examples of javax.media.jai.ColorCube


            pb.add(lut);
            pb.add(KernelJAI.ERROR_FILTER_FLOYD_STEINBERG);
        } else {
            opName = "ordereddither";
            //Create the color cube.
            ColorCube colorMap = ColorCube.createColorCube(DataBuffer.TYPE_BYTE,
                    0, new int[] {2});
            pb.add(colorMap);
            pb.add(KernelJAI.DITHER_MASK_441);
        }
       
View Full Code Here


            pb.add(lut);
            pb.add(KernelJAI.ERROR_FILTER_FLOYD_STEINBERG);
        } else {
            opName = "ordereddither";
            //Create the color cube.
            ColorCube colorMap = ColorCube.createColorCube(DataBuffer.TYPE_BYTE,
                    0, new int[] {2});
            pb.add(colorMap);
            pb.add(KernelJAI.DITHER_MASK_441);
        }
       
View Full Code Here

     */
    public RenderedImage create(ParameterBlock args,
                                RenderingHints hints) {
        // Get source and parameters.
        RenderedImage source = args.getRenderedSource(0);
        ColorCube colorMap =
            (ColorCube)args.getObjectParameter(0);
        KernelJAI[] ditherMask = (KernelJAI[])args.getObjectParameter(1);

        // Check colorMap compatibility.
        if(colorMap.getNumBands() != 1 &&
           colorMap.getNumBands() != 3) {
            // 1 or 3 band colorMaps only.
            return null;
        } else if(colorMap.getDataType() != DataBuffer.TYPE_BYTE) {
            // byte colorMaps only
            return null;
        }

        // Check source compatibility.
        SampleModel sourceSM = source.getSampleModel();
        if(sourceSM.getDataType() != DataBuffer.TYPE_BYTE) {
            // byte source images only
            return null;
        } else if(sourceSM.getNumBands() != colorMap.getNumBands()) {
            // band counts must match
            return null;
        }

        // Get ImageLayout from RenderingHints if any.
View Full Code Here

        // Get ImageLayout from renderHints if any.
        ImageLayout layout = RIFUtil.getImageLayoutHint(renderHints);
       

        RenderedImage source = paramBlock.getRenderedSource(0);
        ColorCube colorMap =
            (ColorCube)paramBlock.getObjectParameter(0);
        KernelJAI[] ditherMask = (KernelJAI[])paramBlock.getObjectParameter(1);

        return new OrderedDitherOpImage(source, renderHints, layout,
                                        colorMap, ditherMask);
View Full Code Here

  if (!modeName.equalsIgnoreCase("rendered"))
      return true;

        // Retrieve the operation source and parameters.
        RenderedImage src = args.getRenderedSource(0);
        ColorCube colorMap = (ColorCube)args.getObjectParameter(0);
        KernelJAI[] ditherMask = (KernelJAI[])args.getObjectParameter(1);

        // Check color map validity.
        if (!isValidColorMap(src, colorMap, msg)) {
            return false;
View Full Code Here

/*    */   public RenderedImage create(ParameterBlock paramBlock, RenderingHints renderHints)
/*    */   {
/* 53 */     ImageLayout layout = RIFUtil.getImageLayoutHint(renderHints);
/*    */
/* 56 */     RenderedImage source = paramBlock.getRenderedSource(0);
/* 57 */     ColorCube colorMap = (ColorCube)paramBlock.getObjectParameter(0);
/*    */
/* 59 */     KernelJAI[] ditherMask = (KernelJAI[])paramBlock.getObjectParameter(1);
/*    */
/* 61 */     return new OrderedDitherOpImage(source, renderHints, layout, colorMap, ditherMask);
/*    */   }
View Full Code Here

/*    */   implements RenderedImageFactory
/*    */ {
/*    */   public RenderedImage create(ParameterBlock args, RenderingHints hints)
/*    */   {
/* 56 */     RenderedImage source = args.getRenderedSource(0);
/* 57 */     ColorCube colorMap = (ColorCube)args.getObjectParameter(0);
/*    */
/* 59 */     KernelJAI[] ditherMask = (KernelJAI[])args.getObjectParameter(1);
/*    */
/* 62 */     if ((colorMap.getNumBands() != 1) && (colorMap.getNumBands() != 3))
/*    */     {
/* 65 */       return null;
/* 66 */     }if (colorMap.getDataType() != 0)
/*    */     {
/* 68 */       return null;
/*    */     }
/*    */
/* 72 */     SampleModel sourceSM = source.getSampleModel();
/* 73 */     if (sourceSM.getDataType() != 0)
/*    */     {
/* 75 */       return null;
/* 76 */     }if (sourceSM.getNumBands() != colorMap.getNumBands())
/*    */     {
/* 78 */       return null;
/*    */     }
/*    */
/* 82 */     ImageLayout layoutHint = RIFUtil.getImageLayoutHint(hints);
View Full Code Here

/* 212 */     if (!modeName.equalsIgnoreCase("rendered")) {
/* 213 */       return true;
/*     */     }
/*     */
/* 216 */     RenderedImage src = args.getRenderedSource(0);
/* 217 */     ColorCube colorMap = (ColorCube)args.getObjectParameter(0);
/* 218 */     KernelJAI[] ditherMask = (KernelJAI[])args.getObjectParameter(1);
/*     */
/* 221 */     if (!isValidColorMap(src, colorMap, msg)) {
/* 222 */       return false;
/*     */     }
View Full Code Here

            // (LookupTableJAI) temp.getProperty("JAI.LookupTable");
            image = ErrorDiffusionDescriptor.create(image, colorMap, ditherMask, hints);
        } else {
            // ordered dither
            final KernelJAI[] ditherMask = KernelJAI.DITHER_MASK_443;
            final ColorCube colorMap = ColorCube.BYTE_496;
            image = OrderedDitherDescriptor.create(image, colorMap, ditherMask, hints);
        }
        tileCacheEnabled(true);
        invalidateStatistics();
View Full Code Here

TOP

Related Classes of javax.media.jai.ColorCube

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.