Camera.java revision 54b6cfa9a9e5b861a9930af873580d6dc20f773c
1/*
2 * Copyright (C) 2006 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.graphics;
18
19
20public class Camera {
21
22    public Camera() {
23        nativeConstructor();
24    }
25
26    public native void save();
27    public native void restore();
28
29    public native void translate(float x, float y, float z);
30    public native void rotateX(float deg);
31    public native void rotateY(float deg);
32    public native void rotateZ(float deg);
33
34    public void getMatrix(Matrix matrix) {
35        nativeGetMatrix(matrix.native_instance);
36    }
37    public void applyToCanvas(Canvas canvas) {
38        nativeApplyToCanvas(canvas.mNativeCanvas);
39    }
40
41    public native float dotWithNormal(float dx, float dy, float dz);
42
43    protected void finalize() throws Throwable {
44        nativeDestructor();
45    }
46
47    private native void nativeConstructor();
48    private native void nativeDestructor();
49    private native void nativeGetMatrix(int native_matrix);
50    private native void nativeApplyToCanvas(int native_canvas);
51
52    int native_instance;
53}
54
55