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 Hoford 17f4b659334750a5aa75f929d18857a2ab93c9d939John Hofordpackage com.android.gallery3d.filtershow.controller; 18f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford 19f4b659334750a5aa75f929d18857a2ab93c9d939John Hofordpublic class ParameterSaturation extends BasicParameterInt { 20f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford public static String sParameterType = "ParameterSaturation"; 21f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford float[] mHSVO = new float[4]; 22f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford 23f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford public ParameterSaturation(int id, int value) { 24f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford super(id, value, 0, 100); 25f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford } 26f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford 27f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford @Override 28f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford public String getParameterType() { 29f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford return sParameterType; 30f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford } 31f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford 32f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford public void setColor(float[] hsvo) { 33f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford mHSVO = hsvo; 34f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford } 35f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford 36f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford public float[] getColor() { 37f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford mHSVO[3] = getValue() / (float) getMaximum(); 38f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford return mHSVO; 39f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford } 40f4b659334750a5aa75f929d18857a2ab93c9d939John Hoford} 41