blob: 86932c4e95c3389190cdb845467ee69694683671 [file] [log] [blame]
Jason Samsb8c5a842009-07-31 20:40:47 -07001/*
2 * Copyright (C) 2008 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.renderscript;
18
19
20import java.io.IOException;
21import java.io.InputStream;
22
23import android.content.res.Resources;
24import android.os.Bundle;
25import android.util.Config;
26import android.util.Log;
27
28import android.graphics.Bitmap;
29import android.graphics.BitmapFactory;
30
31/**
32 * @hide
33 *
34 **/
35public class Type extends BaseObj {
36 Type(int id, RenderScript rs) {
37 super(rs);
38 mID = id;
39 }
40
41 public void destroy() {
42 mRS.nTypeDestroy(mID);
43 mID = 0;
44 }
45
46 public static class Builder {
47 RenderScript mRS;
48 boolean mActive = true;
49
50 Builder(RenderScript rs) {
51 mRS = rs;
52 }
53
54 public void begin(Element e) {
55 mRS.nTypeBegin(e.mID);
56 }
57
58 public void add(Dimension d, int value) {
59 mRS.nTypeAdd(d.mID, value);
60 }
61
62 public Type create() {
63 int id = mRS.nTypeCreate();
64 return new Type(id, mRS);
65 }
66 }
67
68}