1/*
2 * Copyright (C) 2013 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.support.v8.renderscript;
18
19import android.util.Log;
20
21class ScriptIntrinsicConvolve5x5Thunker extends ScriptIntrinsicConvolve5x5 {
22    android.renderscript.ScriptIntrinsicConvolve5x5 mN;
23
24    android.renderscript.ScriptIntrinsicConvolve5x5 getNObj() {
25        return mN;
26    }
27
28
29    ScriptIntrinsicConvolve5x5Thunker(int id, RenderScript rs) {
30        super(id, rs);
31    }
32
33    public static ScriptIntrinsicConvolve5x5Thunker create(RenderScript rs, Element e) {
34        RenderScriptThunker rst = (RenderScriptThunker) rs;
35        ElementThunker et = (ElementThunker) e;
36
37        ScriptIntrinsicConvolve5x5Thunker si = new ScriptIntrinsicConvolve5x5Thunker(0, rs);
38        try {
39            si.mN = android.renderscript.ScriptIntrinsicConvolve5x5.create(rst.mN, et.getNObj());
40        } catch (android.renderscript.RSRuntimeException exc) {
41            throw ExceptionThunker.convertException(exc);
42        }
43        return si;
44    }
45
46    public void setInput(Allocation ain) {
47        AllocationThunker aint = (AllocationThunker)ain;
48        try {
49            mN.setInput(aint.getNObj());
50        } catch (android.renderscript.RSRuntimeException e) {
51            throw ExceptionThunker.convertException(e);
52        }
53    }
54
55    public void setCoefficients(float v[]) {
56        try {
57            mN.setCoefficients(v);
58        } catch (android.renderscript.RSRuntimeException e) {
59            throw ExceptionThunker.convertException(e);
60        }
61    }
62
63    public void forEach(Allocation aout) {
64        AllocationThunker aoutt = (AllocationThunker)aout;
65        try {
66            mN.forEach(aoutt.getNObj());
67        } catch (android.renderscript.RSRuntimeException e) {
68            throw ExceptionThunker.convertException(e);
69        }
70
71    }
72
73    public Script.KernelID getKernelID() {
74        Script.KernelID k = createKernelID(0, 2, null, null);
75        try {
76            k.mN = mN.getKernelID();
77        } catch (android.renderscript.RSRuntimeException e) {
78            throw ExceptionThunker.convertException(e);
79        }
80        return k;
81    }
82
83    public Script.FieldID getFieldID_Input() {
84        Script.FieldID f = createFieldID(1, null);
85        try {
86            f.mN = mN.getFieldID_Input();
87        } catch (android.renderscript.RSRuntimeException e) {
88            throw ExceptionThunker.convertException(e);
89        }
90        return f;
91    }
92
93}
94
95