1 group SSEJavaGlue; 2 3 glue(effectName,peerName,interfaceDecl, 4 usercode,samplers,cleanup,srcRects,constants,params,paramDecls) ::= << 5 /* 6 * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. 7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 8 * 9 * This code is free software; you can redistribute it and/or modify it 10 * under the terms of the GNU General Public License version 2 only, as 11 * published by the Free Software Foundation. Oracle designates this 12 * particular file as subject to the "Classpath" exception as provided 13 * by Oracle in the LICENSE file that accompanied this code. 14 * 15 * This code is distributed in the hope that it will be useful, but WITHOUT 16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 18 * version 2 for more details (a copy is included in the LICENSE file that 19 * accompanied this code). 20 * 21 * You should have received a copy of the GNU General Public License version 22 * 2 along with this work; if not, write to the Free Software Foundation, 23 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 24 * 25 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 26 * or visit www.oracle.com if you need additional information or have any 27 * questions. 28 */ 29 30 /* 31 * This file was generated by JSLC -- DO NOT EDIT MANUALLY! 32 */ 33 34 package com.sun.scenario.effect.impl.sw.sse; 35 36 import java.nio.FloatBuffer; 37 import java.nio.IntBuffer; 38 import com.sun.scenario.effect.Effect; 39 import com.sun.scenario.effect.FilterContext; 40 import com.sun.scenario.effect.FloatMap; 41 import com.sun.scenario.effect.ImageData; 42 import com.sun.scenario.effect.$effectName$; 43 import com.sun.scenario.effect.impl.BufferUtil; 44 import com.sun.scenario.effect.impl.HeapImage; 45 import com.sun.scenario.effect.impl.Renderer; 46 import com.sun.scenario.effect.impl.state.*; 47 import com.sun.javafx.geom.Rectangle; 48 import com.sun.javafx.geom.transform.BaseTransform; 49 50 public class SSE$peerName$Peer extends SSEEffectPeer $interfaceDecl$ { 51 52 public SSE$peerName$Peer(FilterContext fctx, Renderer r, String uniqueName) { 53 super(fctx, r, uniqueName); 54 } 55 56 @Override 57 protected final $effectName$ getEffect() { 58 return ($effectName$)super.getEffect(); 59 } 60 61 $usercode$ 62 63 @Override 64 public ImageData filter(Effect effect, 65 BaseTransform transform, 66 Rectangle outputClip, 67 ImageData... inputs) 68 { 69 setEffect(effect); 70 Rectangle dstBounds = getResultBounds(transform, outputClip, inputs); 71 setDestBounds(dstBounds); 72 73 // TODO: for now, all input images must be TYPE_INT_ARGB_PRE 74 $samplers$ 75 76 $srcRects$ 77 78 final int dstx = 0; 79 final int dsty = 0; 80 final int dstw = dstBounds.width; 81 final int dsth = dstBounds.height; 82 83 HeapImage dst = (HeapImage)getRenderer().getCompatibleImage(dstw, dsth); 84 setDestNativeBounds(dst.getPhysicalWidth(), dst.getPhysicalHeight()); 85 int dstscan = dst.getScanlineStride(); 86 int[] dstPixels = dst.getPixelArray(); 87 88 $constants$ 89 90 filter(dstPixels, dstx, dsty, dstw, dsth, dstscan$params$); 91 92 $cleanup$ 93 94 return new ImageData(getFilterContext(), dst, dstBounds); 95 } 96 97 private static native void filter(int[] dstPixels, 98 int dstx, int dsty, 99 int dstw, int dsth, 100 int dstscan$paramDecls$); 101 } 102 103 >>