1f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford/*
2f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford * Copyright (C) 2013 The Android Open Source Project
3f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford *
4f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford * Licensed under the Apache License, Version 2.0 (the "License");
5f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford * you may not use this file except in compliance with the License.
6f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford * You may obtain a copy of the License at
7f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford *
8f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford *      http://www.apache.org/licenses/LICENSE-2.0
9f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford *
10f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford * Unless required by applicable law or agreed to in writing, software
11f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford * distributed under the License is distributed on an "AS IS" BASIS,
12f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford * See the License for the specific language governing permissions and
14f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford * limitations under the License.
15f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford */
16f4b659334750a5aa75f929d18857a2ab93c9d939John Hofordpackage com.android.gallery3d.filtershow.controller;
17f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford
18f4b659334750a5aa75f929d18857a2ab93c9d939John Hofordpublic class ParameterOpacity extends BasicParameterInt {
19f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford    public static String sParameterType = "ParameterOpacity";
20f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford    float[] mHSVO = new float[4];
21f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford
22f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford    public ParameterOpacity(int id, int value) {
23f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford        super(id, value, 0, 255);
24f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford    }
25f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford
26f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford    @Override
27f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford    public String getParameterType() {
28f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford        return sParameterType;
29f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford    }
30f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford
31f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford    public void setColor(float[] hsvo) {
32f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford        mHSVO = hsvo;
33f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford    }
34f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford
35f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford    public float[] getColor() {
36f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford        mHSVO[3] = getValue() / (float) getMaximum();
37f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford        return mHSVO;
38f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford    }
39f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford}
40