1 group MENativeGlue;
   2 
   3 glue(peerName,jniName,paramDecls,arrayGet,arrayRelease,
   4      pixInitY,pixInitX,posDecls,posInitY,posIncrY,posInitX,posIncrX,
   5      body) ::= <<
   6 /*
   7  * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
   8  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   9  *
  10  * This code is free software; you can redistribute it and/or modify it
  11  * under the terms of the GNU General Public License version 2 only, as
  12  * published by the Free Software Foundation.  Oracle designates this
  13  * particular file as subject to the "Classpath" exception as provided
  14  * by Oracle in the LICENSE file that accompanied this code.
  15  *
  16  * This code is distributed in the hope that it will be useful, but WITHOUT
  17  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  18  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  19  * version 2 for more details (a copy is included in the LICENSE file that
  20  * accompanied this code).
  21  *
  22  * You should have received a copy of the GNU General Public License version
  23  * 2 along with this work; if not, write to the Free Software Foundation,
  24  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  25  *
  26  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  27  * or visit www.oracle.com if you need additional information or have any
  28  * questions.
  29  */
  30 
  31 /*
  32  * This file was generated by JSLC -- DO NOT EDIT MANUALLY!
  33  */
  34 
  35 #include <jni.h>
  36 #include <math.h>
  37 #include "MEUtils.h"
  38 #include "com_sun_scenario_effect_impl_sw_me_ME$peerName$Peer.h"
  39 
  40 JNIEXPORT void JNICALL
  41 Java_com_sun_scenario_effect_impl_sw_me_ME$jniName$Peer_filter
  42   (JNIEnv *env, jclass klass,
  43    jintArray dst_arr,
  44    jint dstx, jint dsty, jint dstw, jint dsth, jint dstscan$paramDecls$)
  45 {
  46     int dyi;
  47     float color_x, color_y, color_z, color_w;
  48 
  49     $arrayGet$
  50 
  51     $posDecls$
  52 
  53     $posInitY$
  54     for (int dy = dsty; dy < dsty+dsth; dy++) {
  55         $pixInitY$
  56         dyi = dy*dstscan;
  57 
  58         $posInitX$
  59         for (int dx = dstx; dx < dstx+dstw; dx++) {
  60             $pixInitX$
  61 
  62             $body$
  63 
  64             if (color_w < 0.f) color_w = 0.f; else if (color_w > 1.f) color_w = 1.f;
  65             if (color_x < 0.f) color_x = 0.f; else if (color_x > color_w) color_x = color_w;
  66             if (color_y < 0.f) color_y = 0.f; else if (color_y > color_w) color_y = color_w;
  67             if (color_z < 0.f) color_z = 0.f; else if (color_z > color_w) color_z = color_w;
  68             dst[dyi+dx] =
  69                 ((int)(color_x * 0xff) << 16) |
  70                 ((int)(color_y * 0xff) <<  8) |
  71                 ((int)(color_z * 0xff) <<  0) |
  72                 ((int)(color_w * 0xff) << 24);
  73 
  74             $posIncrX$
  75         }
  76 
  77         $posIncrY$
  78     }
  79 
  80     $arrayRelease$
  81 }
  82 
  83 >>