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.content.Context;
20import android.content.res.Resources;
21import android.util.Log;
22
23class ScriptIntrinsicBlurThunker extends ScriptIntrinsicBlur {
24
25    android.renderscript.ScriptIntrinsicBlur mN;
26
27    android.renderscript.ScriptIntrinsicBlur getNObj() {
28        return mN;
29    }
30
31    protected ScriptIntrinsicBlurThunker(int id, RenderScript rs) {
32        super(id, rs);
33    }
34
35    public static ScriptIntrinsicBlurThunker create(RenderScript rs, Element e) {
36        RenderScriptThunker rst = (RenderScriptThunker) rs;
37        ElementThunker et = (ElementThunker) e;
38
39        ScriptIntrinsicBlurThunker blur = new ScriptIntrinsicBlurThunker(0, rs);
40        try {
41            blur.mN = android.renderscript.ScriptIntrinsicBlur.create(rst.mN, et.getNObj());
42        } catch (android.renderscript.RSRuntimeException exc) {
43            throw ExceptionThunker.convertException(exc);
44        }
45        return blur;
46    }
47
48    public void setInput(Allocation ain) {
49        AllocationThunker aint = (AllocationThunker) ain;
50        try {
51            mN.setInput(aint.getNObj());
52        } catch (android.renderscript.RSRuntimeException e) {
53            throw ExceptionThunker.convertException(e);
54        }
55    }
56
57    public void setRadius(float radius) {
58        try {
59            mN.setRadius(radius);
60        } catch (android.renderscript.RSRuntimeException e) {
61            throw ExceptionThunker.convertException(e);
62        }
63    }
64
65    public void forEach(Allocation aout) {
66        AllocationThunker aoutt = (AllocationThunker) aout;
67        if (aoutt != null) {
68            try {
69                mN.forEach(aoutt.getNObj());
70            } catch (android.renderscript.RSRuntimeException e) {
71                throw ExceptionThunker.convertException(e);
72            }
73        }
74    }
75
76    public Script.KernelID getKernelID() {
77        Script.KernelID k = createKernelID(0, 2, null, null);
78        try {
79            k.mN = mN.getKernelID();
80        } catch (android.renderscript.RSRuntimeException e) {
81            throw ExceptionThunker.convertException(e);
82        }
83        return k;
84    }
85
86    public Script.FieldID getFieldID_Input() {
87        Script.FieldID f = createFieldID(1, null);
88        try {
89            f.mN = mN.getFieldID_Input();
90        } catch (android.renderscript.RSRuntimeException e) {
91            throw ExceptionThunker.convertException(e);
92        }
93        return f;
94    }
95}
96
97