// Path: src/main/java/de/mprengemann/intellij/plugin/androidicons/model/Resolution.java
// public enum Resolution {
//     LDPI,
//     MDPI,
//     HDPI,
//     XHDPI,
//     XXHDPI,
//     XXXHDPI,
//     TVDPI,
//     ANYDPI;
// 
//     private static final Resolution[] RESOLUTIONS_WITHOUT_SVG = new Resolution[] {
//         LDPI, MDPI, HDPI, XHDPI, XXHDPI, XXXHDPI, TVDPI
//     };
// 
//     public static Resolution[] nonVectorValues() {
//         return RESOLUTIONS_WITHOUT_SVG;
//     }
// 
//     public static Resolution from(String value) {
//         if (TextUtils.isEmpty(value)) {
//             throw new IllegalArgumentException();
//         }
//         if (value.equalsIgnoreCase(LDPI.toString())) {
//             return LDPI;
//         } else if (value.equalsIgnoreCase(MDPI.toString())) {
//             return MDPI;
//         } else if (value.equalsIgnoreCase(HDPI.toString())) {
//             return HDPI;
//         } else if (value.equalsIgnoreCase(XHDPI.toString())) {
//             return XHDPI;
//         } else if (value.equalsIgnoreCase(XXHDPI.toString())) {
//             return XXHDPI;
//         } else if (value.equalsIgnoreCase(XXXHDPI.toString())) {
//             return XXXHDPI;
//         } else if (value.equalsIgnoreCase(TVDPI.toString())) {
//             return TVDPI;
//         } else if (value.equalsIgnoreCase(ANYDPI.toString())) {
//             return ANYDPI;
//         }
//         return null;
//     }
// 
//     public static class Deserializer implements JsonDeserializer<Resolution> {
//         @Override
//         public Resolution deserialize(JsonElement jsonElement,
//                                   Type type,
//                                   JsonDeserializationContext jsonDeserializationContext) throws JsonParseException {
//             return Resolution.from(jsonElement.getAsString());
//         }
//     }
// }


import de.mprengemann.intellij.plugin.androidicons.model.Resolution;
/*
 * Copyright 2015 Marc Prengemann
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at
 *
 * 			http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for
 * the specific language governing permissions and limitations under the License.
 */

package de.mprengemann.intellij.plugin.androidicons.util;


public class RefactorUtils {

    private static final float FACTOR_LDPI = 0.75f;
    private static final float FACTOR_MDPI = 1f;
    private static final float FACTOR_HDPI = 1.5f;
    private static final float FACTOR_XHDPI = 2f;
    private static final float FACTOR_XXHDPI = 3f;
    private static final float FACTOR_XXXHDPI = 4f;
    private static final float FACTOR_TVDPI = 4f / 3f;

    private RefactorUtils() {
    }

// Path: src/main/java/de/mprengemann/intellij/plugin/androidicons/model/Resolution.java
// public enum Resolution {
//     LDPI,
//     MDPI,
//     HDPI,
//     XHDPI,
//     XXHDPI,
//     XXXHDPI,
//     TVDPI,
//     ANYDPI;
// 
//     private static final Resolution[] RESOLUTIONS_WITHOUT_SVG = new Resolution[] {
//         LDPI, MDPI, HDPI, XHDPI, XXHDPI, XXXHDPI, TVDPI
//     };
// 
//     public static Resolution[] nonVectorValues() {
//         return RESOLUTIONS_WITHOUT_SVG;
//     }
// 
//     public static Resolution from(String value) {
//         if (TextUtils.isEmpty(value)) {
//             throw new IllegalArgumentException();
//         }
//         if (value.equalsIgnoreCase(LDPI.toString())) {
//             return LDPI;
//         } else if (value.equalsIgnoreCase(MDPI.toString())) {
//             return MDPI;
//         } else if (value.equalsIgnoreCase(HDPI.toString())) {
//             return HDPI;
//         } else if (value.equalsIgnoreCase(XHDPI.toString())) {
//             return XHDPI;
//         } else if (value.equalsIgnoreCase(XXHDPI.toString())) {
//             return XXHDPI;
//         } else if (value.equalsIgnoreCase(XXXHDPI.toString())) {
//             return XXXHDPI;
//         } else if (value.equalsIgnoreCase(TVDPI.toString())) {
//             return TVDPI;
//         } else if (value.equalsIgnoreCase(ANYDPI.toString())) {
//             return ANYDPI;
//         }
//         return null;
//     }
// 
//     public static class Deserializer implements JsonDeserializer<Resolution> {
//         @Override
//         public Resolution deserialize(JsonElement jsonElement,
//                                   Type type,
//                                   JsonDeserializationContext jsonDeserializationContext) throws JsonParseException {
//             return Resolution.from(jsonElement.getAsString());
//         }
//     }
// }


// Path: src/main/java/de/mprengemann/intellij/plugin/androidicons/util/RefactorUtils.java
import de.mprengemann.intellij.plugin.androidicons.model.Resolution;

/*
 * Copyright 2015 Marc Prengemann
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at
 *
 * 			http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for
 * the specific language governing permissions and limitations under the License.
 */

package de.mprengemann.intellij.plugin.androidicons.util;


public class RefactorUtils {

    private static final float FACTOR_LDPI = 0.75f;
    private static final float FACTOR_MDPI = 1f;
    private static final float FACTOR_HDPI = 1.5f;
    private static final float FACTOR_XHDPI = 2f;
    private static final float FACTOR_XXHDPI = 3f;
    private static final float FACTOR_XXXHDPI = 4f;
    private static final float FACTOR_TVDPI = 4f / 3f;

    private RefactorUtils() {
    }

    public static float getScaleFactor(Resolution target, Resolution baseLine) {