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
19
20public class ScriptIntrinsicYuvToRGBThunker extends ScriptIntrinsicYuvToRGB {
21    android.renderscript.ScriptIntrinsicYuvToRGB mN;
22
23    android.renderscript.ScriptIntrinsicYuvToRGB getNObj() {
24        return mN;
25    }
26
27
28    private ScriptIntrinsicYuvToRGBThunker(int id, RenderScript rs) {
29        super(id, rs);
30    }
31
32    public static ScriptIntrinsicYuvToRGBThunker create(RenderScript rs, Element e) {
33        RenderScriptThunker rst = (RenderScriptThunker) rs;
34        ElementThunker et = (ElementThunker) e;
35
36        ScriptIntrinsicYuvToRGBThunker si = new ScriptIntrinsicYuvToRGBThunker(0, rs);
37        try {
38            si.mN = android.renderscript.ScriptIntrinsicYuvToRGB.create(rst.mN, et.getNObj());
39        } catch (android.renderscript.RSRuntimeException exc) {
40            throw ExceptionThunker.convertException(exc);
41        }
42        return si;
43    }
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 forEach(Allocation aout) {
56        AllocationThunker aoutt = (AllocationThunker)aout;
57        try {
58            mN.forEach(aoutt.getNObj());
59        } catch (android.renderscript.RSRuntimeException e) {
60            throw ExceptionThunker.convertException(e);
61        }
62    }
63
64    public Script.KernelID getKernelID() {
65        Script.KernelID k = createKernelID(0, 2, null, null);
66        try {
67            k.mN = mN.getKernelID();
68        } catch (android.renderscript.RSRuntimeException e) {
69            throw ExceptionThunker.convertException(e);
70        }
71        return k;
72    }
73
74    public Script.FieldID getFieldID_Input() {
75        Script.FieldID f = createFieldID(0, null);
76        try {
77            f.mN = mN.getFieldID_Input();
78        } catch (android.renderscript.RSRuntimeException e) {
79            throw ExceptionThunker.convertException(e);
80        }
81        return f;
82    }
83}
84