Home | History | Annotate | Download | only in crop
      1 /*
      2  * Copyright (C) 2012 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 com.android.gallery3d.filtershow.crop;
     18 
     19 import android.net.Uri;
     20 
     21 public class CropExtras {
     22 
     23     public static final String KEY_CROPPED_RECT = "cropped-rect";
     24     public static final String KEY_OUTPUT_X = "outputX";
     25     public static final String KEY_OUTPUT_Y = "outputY";
     26     public static final String KEY_SCALE = "scale";
     27     public static final String KEY_SCALE_UP_IF_NEEDED = "scaleUpIfNeeded";
     28     public static final String KEY_ASPECT_X = "aspectX";
     29     public static final String KEY_ASPECT_Y = "aspectY";
     30     public static final String KEY_SET_AS_WALLPAPER = "set-as-wallpaper";
     31     public static final String KEY_RETURN_DATA = "return-data";
     32     public static final String KEY_DATA = "data";
     33     public static final String KEY_SPOTLIGHT_X = "spotlightX";
     34     public static final String KEY_SPOTLIGHT_Y = "spotlightY";
     35     public static final String KEY_SHOW_WHEN_LOCKED = "showWhenLocked";
     36     public static final String KEY_OUTPUT_FORMAT = "outputFormat";
     37 
     38     private int mOutputX = 0;
     39     private int mOutputY = 0;
     40     private boolean mScaleUp = true;
     41     private int mAspectX = 0;
     42     private int mAspectY = 0;
     43     private boolean mSetAsWallpaper = false;
     44     private boolean mReturnData = false;
     45     private Uri mExtraOutput = null;
     46     private String mOutputFormat = null;
     47     private boolean mShowWhenLocked = false;
     48     private float mSpotlightX = 0;
     49     private float mSpotlightY = 0;
     50 
     51     public CropExtras(int outputX, int outputY, boolean scaleUp, int aspectX, int aspectY,
     52             boolean setAsWallpaper, boolean returnData, Uri extraOutput, String outputFormat,
     53             boolean showWhenLocked, float spotlightX, float spotlightY) {
     54         mOutputX = outputX;
     55         mOutputY = outputY;
     56         mScaleUp = scaleUp;
     57         mAspectX = aspectX;
     58         mAspectY = aspectY;
     59         mSetAsWallpaper = setAsWallpaper;
     60         mReturnData = returnData;
     61         mExtraOutput = extraOutput;
     62         mOutputFormat = outputFormat;
     63         mShowWhenLocked = showWhenLocked;
     64         mSpotlightX = spotlightX;
     65         mSpotlightY = spotlightY;
     66     }
     67 
     68     public CropExtras(CropExtras c) {
     69         this(c.mOutputX, c.mOutputY, c.mScaleUp, c.mAspectX, c.mAspectY, c.mSetAsWallpaper,
     70                 c.mReturnData, c.mExtraOutput, c.mOutputFormat, c.mShowWhenLocked,
     71                 c.mSpotlightX, c.mSpotlightY);
     72     }
     73 
     74     public int getOutputX() {
     75         return mOutputX;
     76     }
     77 
     78     public int getOutputY() {
     79         return mOutputY;
     80     }
     81 
     82     public boolean getScaleUp() {
     83         return mScaleUp;
     84     }
     85 
     86     public int getAspectX() {
     87         return mAspectX;
     88     }
     89 
     90     public int getAspectY() {
     91         return mAspectY;
     92     }
     93 
     94     public boolean getSetAsWallpaper() {
     95         return mSetAsWallpaper;
     96     }
     97 
     98     public boolean getReturnData() {
     99         return mReturnData;
    100     }
    101 
    102     public Uri getExtraOutput() {
    103         return mExtraOutput;
    104     }
    105 
    106     public String getOutputFormat() {
    107         return mOutputFormat;
    108     }
    109 
    110     public boolean getShowWhenLocked() {
    111         return mShowWhenLocked;
    112     }
    113 
    114     public float getSpotlightX() {
    115         return mSpotlightX;
    116     }
    117 
    118     public float getSpotlightY() {
    119         return mSpotlightY;
    120     }
    121 }
    122