1 group SSEJavaGlue;
   2 
   3 glue(effectName,peerName,genericsDecl,interfaceDecl,
   4      usercode,samplers,cleanup,srcRects,constants,params,paramDecls) ::= <<
   5 /*
   6  * Copyright (c) 2008, 2014, 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$genericsDecl$ $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                             RenderState rstate,
  66                             BaseTransform transform,
  67                             Rectangle outputClip,
  68                             ImageData... inputs)
  69     {
  70         setEffect(effect);
  71         Rectangle dstBounds = getResultBounds(transform, outputClip, inputs);
  72         setDestBounds(dstBounds);
  73 
  74         // TODO: for now, all input images must be TYPE_INT_ARGB_PRE
  75         $samplers$
  76 
  77         $srcRects$
  78 
  79         final int dstx = 0;
  80         final int dsty = 0;
  81         final int dstw = dstBounds.width;
  82         final int dsth = dstBounds.height;
  83 
  84         HeapImage dst = (HeapImage)getRenderer().getCompatibleImage(dstw, dsth);
  85         setDestNativeBounds(dst.getPhysicalWidth(), dst.getPhysicalHeight());
  86         int dstscan = dst.getScanlineStride();
  87         int[] dstPixels = dst.getPixelArray();
  88         
  89         $constants$
  90 
  91         filter(dstPixels, dstx, dsty, dstw, dsth, dstscan$params$);
  92 
  93         $cleanup$
  94 
  95         return new ImageData(getFilterContext(), dst, dstBounds);
  96     }
  97 
  98     private static native void filter(int[] dstPixels,
  99                                       int dstx, int dsty,
 100                                       int dstw, int dsth,
 101                                       int dstscan$paramDecls$);
 102 }
 103 
 104 >>