Package javax.media.jai

Examples of javax.media.jai.KernelJAI


/*     */
/*  67 */     BorderExtender extender = RIFUtil.getBorderExtenderHint(hints);
/*     */
/*  69 */     RenderedImage source = args.getRenderedSource(0);
/*     */
/*  71 */     KernelJAI unRotatedKernel = (KernelJAI)args.getObjectParameter(0);
/*  72 */     KernelJAI kJAI = unRotatedKernel.getRotatedKernel();
/*     */
/*  74 */     int kWidth = kJAI.getWidth();
/*  75 */     int kHeight = kJAI.getHeight();
/*  76 */     int xOri = kJAI.getXOrigin();
/*  77 */     int yOri = kJAI.getYOrigin();
/*  78 */     int numB = source.getSampleModel().getNumBands();
/*     */
/*  82 */     if ((xOri != 1) || (yOri != 1) || (kWidth != 3) || (kHeight != 3) || (numB != 1)) {
/*  83 */       return null;
/*     */     }
/*     */
/*  88 */     float[] kdata = kJAI.getKernelData();
/*     */
/*  90 */     if (((isBinary) && (isKernel3Square1(kdata))) || ((!isBinary) && (isKernel3Square0(kdata))))
/*     */     {
/*  92 */       return new MlibDilate3SquareOpImage(source, extender, hints, layout);
/*     */     }
View Full Code Here


/*    */   public RenderedImage create(ParameterBlock args, RenderingHints hints)
/*    */   {
/* 56 */     RenderedImage source = args.getRenderedSource(0);
/* 57 */     LookupTableJAI colorMap = (LookupTableJAI)args.getObjectParameter(0);
/*    */
/* 59 */     KernelJAI errorKernel = (KernelJAI)args.getObjectParameter(1);
/*    */
/* 62 */     if ((colorMap.getNumBands() != 1) && (colorMap.getNumBands() != 3))
/*    */     {
/* 65 */       return null;
/* 66 */     }if (colorMap.getDataType() != 0)
View Full Code Here

/*     */
/*  67 */     BorderExtender extender = RIFUtil.getBorderExtenderHint(hints);
/*     */
/*  69 */     RenderedImage source = args.getRenderedSource(0);
/*     */
/*  71 */     KernelJAI unRotatedKernel = (KernelJAI)args.getObjectParameter(0);
/*  72 */     KernelJAI kJAI = unRotatedKernel.getRotatedKernel();
/*     */
/*  74 */     int kWidth = kJAI.getWidth();
/*  75 */     int kHeight = kJAI.getHeight();
/*  76 */     int xOri = kJAI.getXOrigin();
/*  77 */     int yOri = kJAI.getYOrigin();
/*  78 */     int numB = source.getSampleModel().getNumBands();
/*     */
/*  82 */     if ((xOri != 1) || (yOri != 1) || (kWidth != 3) || (kHeight != 3) || (numB != 1)) {
/*  83 */       return null;
/*     */     }
/*     */
/*  88 */     float[] kdata = kJAI.getKernelData();
/*     */
/*  90 */     if (((isBinary) && (isKernel3Square1(kdata))) || ((!isBinary) && (isKernel3Square0(kdata))))
/*     */     {
/*  92 */       return new MlibErode3SquareOpImage(source, extender, hints, layout);
/*     */     }
View Full Code Here

/*    */   {
/* 52 */     ImageLayout layout = RIFUtil.getImageLayoutHint(renderHints);
/*    */
/* 56 */     BorderExtender extender = RIFUtil.getBorderExtenderHint(renderHints);
/*    */
/* 60 */     KernelJAI unRotatedKernel = ImageUtil.getUnsharpMaskEquivalentKernel((KernelJAI)paramBlock.getObjectParameter(0), paramBlock.getFloatParameter(1));
/*    */
/* 65 */     KernelJAI kJAI = unRotatedKernel.getRotatedKernel();
/*    */
/* 67 */     RenderedImage source = paramBlock.getRenderedSource(0);
/* 68 */     int dataType = source.getSampleModel().getDataType();
/*    */
/* 70 */     boolean dataTypeOk = (dataType == 0) || (dataType == 2) || (dataType == 3);
/*    */
/* 74 */     if ((kJAI.getWidth() == 3) && (kJAI.getHeight() == 3) && (kJAI.getXOrigin() == 1) && (kJAI.getYOrigin() == 1) && (dataTypeOk))
/*    */     {
/* 76 */       return new Convolve3x3OpImage(source, extender, renderHints, layout, kJAI);
/*    */     }
/*    */
/* 81 */     if (kJAI.isSeparable()) {
/* 82 */       return new SeparableConvolveOpImage(source, extender, renderHints, layout, kJAI);
/*    */     }
/*    */
/* 89 */     return new ConvolveOpImage(source, extender, renderHints, layout, kJAI);
/*    */   }
View Full Code Here

/*    */     } else {
/* 75 */       dataV = new float[height];
/* 76 */       Arrays.fill(dataV, 1.0F / height);
/*    */     }
/*    */
/* 80 */     KernelJAI kernel = new KernelJAI(width, height, xOrigin, yOrigin, dataH, dataV);
/*    */
/* 84 */     return new SeparableConvolveOpImage(paramBlock.getRenderedSource(0), extender, renderHints, layout, kernel);
/*    */   }
View Full Code Here

/* 1316 */       newData[k] = (-gain * oldData[k]);
/*      */     }
/* 1318 */     k = yOrigin * width + xOrigin;
/* 1319 */     newData[k] = (1.0F + gain * (1.0F - oldData[k]));
/*      */
/* 1321 */     return new KernelJAI(width, height, xOrigin, yOrigin, newData);
/*      */   }
View Full Code Here

/*    */
/* 63 */     BorderExtender extender = RIFUtil.getBorderExtenderHint(hints);
/*    */
/* 65 */     RenderedImage source = args.getRenderedSource(0);
/*    */
/* 71 */     KernelJAI kern_h = (KernelJAI)args.getObjectParameter(0);
/* 72 */     KernelJAI kern_v = (KernelJAI)args.getObjectParameter(1);
/*    */
/* 75 */     int kWidth = kern_h.getWidth();
/* 76 */     int kHeight = kern_v.getHeight();
/*    */
/* 80 */     float[] khdata = kern_h.getKernelData();
/* 81 */     float[] kvdata = kern_v.getKernelData();
/* 82 */     if ((khdata[0] == -1.0F) && (khdata[1] == -2.0F) && (khdata[2] == -1.0F) && (khdata[3] == 0.0F) && (khdata[4] == 0.0F) && (khdata[5] == 0.0F) && (khdata[6] == 1.0F) && (khdata[7] == 2.0F) && (khdata[8] == 1.0F) && (kvdata[0] == -1.0F) && (kvdata[1] == 0.0F) && (kvdata[2] == 1.0F) && (kvdata[3] == -2.0F) && (kvdata[4] == 0.0F) && (kvdata[5] == 2.0F) && (kvdata[6] == -1.0F) && (kvdata[7] == 0.0F) && (kvdata[8] == 1.0F) && (kWidth == 3) && (kHeight == 3))
/*    */     {
/* 89 */       return new MlibSobelOpImage(source, extender, hints, layout, kern_h);
/*    */     }
/*    */
View Full Code Here

/*    */
/* 62 */     BorderExtender extender = RIFUtil.getBorderExtenderHint(hints);
/*    */
/* 64 */     RenderedImage source = args.getRenderedSource(0);
/*    */
/* 66 */     KernelJAI unRotatedKernel = (KernelJAI)args.getObjectParameter(0);
/* 67 */     KernelJAI kJAI = unRotatedKernel.getRotatedKernel();
/*    */
/* 69 */     int kWidth = kJAI.getWidth();
/* 70 */     int kHeight = kJAI.getHeight();
/*    */
/* 73 */     if ((kWidth < 2) || (kHeight < 2)) {
/* 74 */       return null;
/*    */     }
/*    */
/* 77 */     boolean centered = (kWidth == kJAI.getXOrigin() * 2 + 1) && (kHeight == kJAI.getYOrigin() * 2 + 1);
/*    */
/* 80 */     if ((kJAI.isSeparable()) && (kWidth >= 3) && (kWidth <= 7) && (kWidth == kHeight))
/*    */     {
/* 82 */       return new MlibSeparableConvolveOpImage(source, extender, hints, layout, kJAI);
/*    */     }
/*    */
/* 85 */     if (((kWidth == 3) && (kHeight == 3)) || ((kWidth == 5) && (kHeight == 5)))
View Full Code Here

/*    */
/* 66 */     BorderExtender extender = RIFUtil.getBorderExtenderHint(hints);
/*    */
/* 68 */     RenderedImage source = args.getRenderedSource(0);
/*    */
/* 72 */     KernelJAI unRotatedKernel = ImageUtil.getUnsharpMaskEquivalentKernel((KernelJAI)args.getObjectParameter(0), args.getFloatParameter(1));
/*    */
/* 77 */     KernelJAI kJAI = unRotatedKernel.getRotatedKernel();
/*    */
/* 79 */     int kWidth = kJAI.getWidth();
/* 80 */     int kHeight = kJAI.getHeight();
/*    */
/* 83 */     if ((kWidth < 2) || (kHeight < 2)) {
/* 84 */       return null;
/*    */     }
/*    */
/* 87 */     if ((kJAI.isSeparable()) && (kWidth >= 3) && (kWidth <= 7) && (kWidth == kHeight)) {
/* 88 */       return new MlibSeparableConvolveOpImage(source, extender, hints, layout, kJAI);
/*    */     }
/*    */
/* 91 */     if (((kWidth == 3) && (kHeight == 3)) || ((kWidth == 5) && (kHeight == 5)))
/*    */     {
View Full Code Here

/*    */   {
/* 49 */     ImageLayout layout = RIFUtil.getImageLayoutHint(renderHints);
/*    */
/* 53 */     BorderExtender extender = RIFUtil.getBorderExtenderHint(renderHints);
/*    */
/* 55 */     KernelJAI unRotatedKernel = (KernelJAI)paramBlock.getObjectParameter(0);
/*    */
/* 57 */     KernelJAI kJAI = unRotatedKernel.getRotatedKernel();
/*    */
/* 59 */     int dataType = paramBlock.getRenderedSource(0).getSampleModel().getDataType();
/*    */
/* 61 */     boolean dataTypeOk = (dataType == 0) || (dataType == 2) || (dataType == 3);
/*    */
/* 65 */     if ((kJAI.getWidth() == 3) && (kJAI.getHeight() == 3) && (kJAI.getXOrigin() == 1) && (kJAI.getYOrigin() == 1) && (dataTypeOk))
/*    */     {
/* 68 */       return new Convolve3x3OpImage(paramBlock.getRenderedSource(0), extender, renderHints, layout, kJAI);
/*    */     }
/*    */
/* 73 */     if (kJAI.isSeparable()) {
/* 74 */       return new SeparableConvolveOpImage(paramBlock.getRenderedSource(0), extender, renderHints, layout, kJAI);
/*    */     }
/*    */
/* 81 */     return new ConvolveOpImage(paramBlock.getRenderedSource(0), extender, renderHints, layout, kJAI);
/*    */   }
View Full Code Here

TOP

Related Classes of javax.media.jai.KernelJAI

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.