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