content: package com.faceunity.nama.repo;
  
  import com.faceunity.core.controller.facebeauty.FaceBeautyParam;
  import com.faceunity.core.entity.FUBundleData;
  import com.faceunity.core.model.facebeauty.FaceBeauty;
  import com.faceunity.core.model.facebeauty.FaceBeautyBlurTypeEnum;
  import com.faceunity.core.model.facebeauty.FaceBeautyFilterEnum;
  import com.faceunity.nama.R;
  import com.faceunity.nama.entity.FaceBeautyBean;
  import com.faceunity.nama.entity.FaceBeautyFilterBean;
  import com.faceunity.nama.entity.ModelAttributeData;
  
  import java.io.File;
  import java.util.ArrayList;
  import java.util.HashMap;
  
  /**
   * DESC：美颜数据构造
   * Created on 2021/3/27
   */
  public class FaceBeautySource {
  
      public static String BUNDLE_FACE_BEAUTIFICATION = "graphics" + File.separator + "face_beautification.bundle";
  
  
  
      /**
       * 获取默认推荐美颜模型
       *
       * @return
       */
      public static FaceBeauty getDefaultFaceBeauty() {
          FaceBeauty recommendFaceBeauty = new FaceBeauty(new FUBundleData(BUNDLE_FACE_BEAUTIFICATION));
          recommendFaceBeauty.setFilterName(FaceBeautyFilterEnum.ZIRAN_1);
          recommendFaceBeauty.setFilterIntensity(0.4);
          /*美肤*/
          recommendFaceBeauty.setBlurType(FaceBeautyBlurTypeEnum.FineSkin);
          recommendFaceBeauty.setSharpenIntensity(0.2);
          recommendFaceBeauty.setColorIntensity(0.3);
          recommendFaceBeauty.setRedIntensity(0.3);
          recommendFaceBeauty.setBlurIntensity(4.2);
          /*美型*/
          recommendFaceBeauty.setFaceShapeIntensity(1.0);
          recommendFaceBeauty.setEyeEnlargingIntensityV2(0.4);
          recommendFaceBeauty.setCheekVIntensity(0.5);
          recommendFaceBeauty.setNoseIntensityV2(0.5);
          recommendFaceBeauty.setForHeadIntensityV2(0.3);
          recommendFaceBeauty.setMouthIntensityV2(0.4);
          recommendFaceBeauty.setChinIntensity(0.3);
          return recommendFaceBeauty;
      }
  
  
      /**
       * 初始化美肤参数
       *
       * @return ArrayList<FaceBeautyBean>
       */
      public static ArrayList<FaceBeautyBean> buildSkinParams() {
          ArrayList<FaceBeautyBean> params = new ArrayList<>();
          params.add(new FaceBeautyBean(
                          FaceBeautyParam.BLUR_INTENSITY, R.string.beauty_box_heavy_blur_fine,
                          R.drawable.icon_beauty_skin_buffing_close_selector, R.drawable.icon_beauty_skin_buffing_open_selector
                  )
          );
          params.add(
                  new FaceBeautyBean(
                          FaceBeautyParam.COLOR_INTENSITY, R.string.beauty_box_color_level,
                          R.drawable.icon_beauty_skin_color_close_selector, R.drawable.icon_beauty_skin_color_open_selector
                  )
          );
          params.add(
                  new FaceBeautyBean(
                          FaceBeautyParam.RED_INTENSITY, R.string.beauty_box_red_level,
                          R.drawable.icon_beauty_skin_red_close_selector, R.drawable.icon_beauty_skin_red_open_selector
                  )
          );
          params.add(
                  new FaceBeautyBean(
                          FaceBeautyParam.SHARPEN_INTENSITY, R.string.beauty_box_sharpen,
                          R.drawable.icon_beauty_skin_sharpen_close_selector, R.drawable.icon_beauty_skin_sharpen_open_selector
                  )
          );
          params.add(
                  new FaceBeautyBean(
                          FaceBeautyParam.EYE_BRIGHT_INTENSITY, R.string.beauty_box_eye_bright,
                          R.drawable.icon_beauty_skin_eyes_bright_close_selector, R.drawable.icon_beauty_skin_eyes_bright_open_selector
                  )
          );
          params.add(
                  new FaceBeautyBean(
                          FaceBeautyParam.TOOTH_WHITEN_INTENSITY, R.string.beauty_box_tooth_whiten,
                          R.drawable.icon_beauty_skin_teeth_close_selector, R.drawable.icon_beauty_skin_teeth_open_selector
                  )
          );
          params.add(
                  new FaceBeautyBean(
                          FaceBeautyParam.REMOVE_POUCH_INTENSITY, R.string.beauty_micro_pouch,
                          R.drawable.icon_beauty_skin_dark_circles_close_selector, R.drawable.icon_beauty_skin_dark_circles_open_selector
                  )
          );
          params.add(
                  new FaceBeautyBean(
                          FaceBeautyParam.REMOVE_NASOLABIAL_FOLDS_INTENSITY, R.string.beauty_micro_nasolabial,
                          R.drawable.icon_beauty_skin_wrinkle_close_selector, R.drawable.icon_beauty_skin_wrinkle_open_selector
                  )
          );
          return params;
      }
  
      /**
       * 初始化美型参数
       *
       * @return ArrayList<FaceBeautyBean>
       */
      public static ArrayList<FaceBeautyBean> buildShapeParams() {
          ArrayList<FaceBeautyBean> params = new ArrayList<>();
          params.add(
                  new FaceBeautyBean(
                          FaceBeautyParam.CHEEK_THINNING_INTENSITY, R.string.beauty_box_cheek_thinning,
                          R.drawable.icon_beauty_shape_face_cheekthin_close_selector, R.drawable.icon_beauty_shape_face_cheekthin_open_selector
                  )
          );
          params.add(
                  new FaceBeautyBean(
                          FaceBeautyParam.CHEEK_V_INTENSITY, R.string.beauty_box_cheek_v,
                          R.drawable.icon_beauty_shape_face_v_close_selector, R.drawable.icon_beauty_shape_face_v_open_selector
                  )
          );
          params.add(
                  new FaceBeautyBean(
                          FaceBeautyParam.CHEEK_NARROW_INTENSITY_V2, R.string.beauty_box_cheek_narrow,
                          R.drawable.icon_beauty_shape_face_narrow_close_selector, R.drawable.icon_beauty_shape_face_narrow_open_selector
                  )
          );
          params.add(
                  new FaceBeautyBean(
                          FaceBeautyParam.CHEEK_SHORT_INTENSITY, R.string.beauty_box_cheek_short,
                          R.drawable.icon_beauty_shape_face_short_close_selector, R.drawable.icon_beauty_shape_face_short_open_selector
                  )
          );
          params.add(
                  new FaceBeautyBean(
                          FaceBeautyParam.CHEEK_SMALL_INTENSITY_V2, R.string.beauty_box_cheek_small,
                          R.drawable.icon_beauty_shape_face_little_close_selector, R.drawable.icon_beauty_shape_face_little_open_selector
                  )
          );
          params.add(
                  new FaceBeautyBean(
                          FaceBeautyParam.INTENSITY_CHEEKBONES_INTENSITY, R.string.beauty_box_cheekbones,
                          R.drawable.icon_beauty_shape_cheek_bones_close_selector, R.drawable.icon_beauty_shape_cheek_bones_open_selector
                  )
          );
          params.add(
                  new FaceBeautyBean(
                          FaceBeautyParam.INTENSITY_LOW_JAW_INTENSITY, R.string.beauty_box_lower_jaw,
                          R.drawable.icon_beauty_shape_lower_jaw_close_selector, R.drawable.icon_beauty_shape_lower_jaw_open_selector
                  )
          );
          params.add(
                  new FaceBeautyBean(
                          FaceBeautyParam.EYE_ENLARGING_INTENSITY_V2, R.string.beauty_box_eye_enlarge,
                          R.drawable.icon_beauty_shape_enlarge_eye_close_selector, R.drawable.icon_beauty_shape_enlarge_eye_open_selector
                  )
          );
          params.add(
                  new FaceBeautyBean(
                          FaceBeautyParam.EYE_CIRCLE_INTENSITY, R.string.beauty_box_eye_circle,
                          R.drawable.icon_beauty_shape_round_eye_close_selector, R.drawable.icon_beauty_shape_round_eye_open_selector
                  )
          );
          params.add(
                  new FaceBeautyBean(
                          FaceBeautyParam.CHIN_INTENSITY, R.string.beauty_box_intensity_chin,
                          R.drawable.icon_beauty_shape_chin_close_selector, R.drawable.icon_beauty_shape_chin_open_selector
                  )
          );
          params.add(
                  new FaceBeautyBean(
                          FaceBeautyParam.FOREHEAD_INTENSITY_V2, R.string.beauty_box_intensity_forehead,
                          R.drawable.icon_beauty_shape_forehead_close_selector, R.drawable.icon_beauty_shape_forehead_open_selector
                  )
          );
          params.add(
                  new FaceBeautyBean(
                          FaceBeautyParam.NOSE_INTENSITY_V2, R.string.beauty_box_intensity_nose,
                          R.drawable.icon_beauty_shape_thin_nose_close_selector, R.drawable.icon_beauty_shape_thin_nose_open_selector
                  )
          );
          params.add(
                  new FaceBeautyBean(
                          FaceBeautyParam.MOUTH_INTENSITY_V2, R.string.beauty_box_intensity_mouth,
                          R.drawable.icon_beauty_shape_mouth_close_selector, R.drawable.icon_beauty_shape_mouth_open_selector
                  )
          );
          params.add(
                  new FaceBeautyBean(
                          FaceBeautyParam.CANTHUS_INTENSITY, R.string.beauty_micro_canthus,
                          R.drawable.icon_beauty_shape_open_eyes_close_selector, R.drawable.icon_beauty_shape_open_eyes_open_selector
                  )
          );
          params.add(
                  new FaceBeautyBean(
                          FaceBeautyParam.EYE_SPACE_INTENSITY, R.string.beauty_micro_eye_space,
                          R.drawable.icon_beauty_shape_distance_close_selector, R.drawable.icon_beauty_shape_distance_open_selector
                  )
          );
          params.add(
                  new FaceBeautyBean(
                          FaceBeautyParam.EYE_ROTATE_INTENSITY, R.string.beauty_micro_eye_rotate,
                          R.drawable.icon_beauty_shape_angle_close_selector, R.drawable.icon_beauty_shape_angle_open_selector
                  )
          );
          params.add(
                  new FaceBeautyBean(
                          FaceBeautyParam.LONG_NOSE_INTENSITY, R.string.beauty_micro_long_nose,
                          R.drawable.icon_beauty_shape_proboscis_close_selector, R.drawable.icon_beauty_shape_proboscis_open_selector
                  )
          );
          params.add(
                  new FaceBeautyBean(
                          FaceBeautyParam.PHILTRUM_INTENSITY, R.string.beauty_micro_philtrum,
                          R.drawable.icon_beauty_shape_shrinking_close_selector, R.drawable.icon_beauty_shape_shrinking_open_selector
                  )
          );
          params.add(
                  new FaceBeautyBean(
                          FaceBeautyParam.SMILE_INTENSITY, R.string.beauty_micro_smile,
                          R.drawable.icon_beauty_shape_smile_close_selector, R.drawable.icon_beauty_shape_smile_open_selector
                  )
          );
          return params;
      }
  
      /**
       * 初始化参数扩展列表
       *
       * @return HashMap<String, ModelAttributeData>
       */
      public static HashMap<String, ModelAttributeData> buildModelAttributeRange() {
          HashMap<String, ModelAttributeData> params = new HashMap<>();
          /*美肤*/
          params.put(FaceBeautyParam.COLOR_INTENSITY, new ModelAttributeData(0.3, 0.0, 0.0, 1.0));
          params.put(FaceBeautyParam.BLUR_INTENSITY, new ModelAttributeData(4.2, 0.0, 0.0, 6.0));
          params.put(FaceBeautyParam.RED_INTENSITY, new ModelAttributeData(0.3, 0.0, 0.0, 1.0));
          params.put(FaceBeautyParam.SHARPEN_INTENSITY, new ModelAttributeData(0.2, 0.0, 0.0, 1.0));
          params.put(FaceBeautyParam.EYE_BRIGHT_INTENSITY, new ModelAttributeData(0.0, 0.0, 0.0, 1.0));
          params.put(FaceBeautyParam.TOOTH_WHITEN_INTENSITY, new ModelAttributeData(0.0, 0.0, 0.0, 1.0));
          params.put(FaceBeautyParam.REMOVE_POUCH_INTENSITY, new ModelAttributeData(0.0, 0.0, 0.0, 1.0));
          params.put(FaceBeautyParam.REMOVE_NASOLABIAL_FOLDS_INTENSITY, new ModelAttributeData(0.0, 0.0, 0.0, 1.0));
          /*美型*/
          params.put(FaceBeautyParam.FACE_SHAPE_INTENSITY, new ModelAttributeData(1.0, 0.0, 0.0, 1.0));
          params.put(FaceBeautyParam.CHEEK_THINNING_INTENSITY, new ModelAttributeData(0.0, 0.0, 0.0, 1.0));
          params.put(FaceBeautyParam.CHEEK_LONG_INTENSITY, new ModelAttributeData(0.0, 0.0, 0.0, 1.0));
          params.put(FaceBeautyParam.CHEEK_CIRCLE_INTENSITY, new ModelAttributeData(0.0, 0.0, 0.0, 1.0));
          params.put(FaceBeautyParam.CHEEK_V_INTENSITY, new ModelAttributeData(0.5, 0.0, 0.0, 1.0));
          params.put(FaceBeautyParam.CHEEK_NARROW_INTENSITY_V2, new ModelAttributeData(0.0, 0.0, 0.0, 1.0));
          params.put(FaceBeautyParam.CHEEK_SHORT_INTENSITY, new ModelAttributeData(0.0, 0.0, 0.0, 1.0));
          params.put(FaceBeautyParam.CHEEK_SMALL_INTENSITY_V2, new ModelAttributeData(0.0, 0.0, 0.0, 1.0));
          params.put(FaceBeautyParam.INTENSITY_CHEEKBONES_INTENSITY, new ModelAttributeData(0.0, 0.0, 0.0, 1.0));
          params.put(FaceBeautyParam.INTENSITY_LOW_JAW_INTENSITY, new ModelAttributeData(0.0, 0.0, 0.0, 1.0));
          params.put(FaceBeautyParam.EYE_ENLARGING_INTENSITY_V2, new ModelAttributeData(0.4, 0.0, 0.0, 1.0));
          params.put(FaceBeautyParam.EYE_CIRCLE_INTENSITY, new ModelAttributeData(0.0, 0.0, 0.0, 1.0));
          params.put(FaceBeautyParam.CHIN_INTENSITY, new ModelAttributeData(0.3, 0.5, 0.0, 1.0));
          params.put(FaceBeautyParam.FOREHEAD_INTENSITY_V2, new ModelAttributeData(0.3, 0.5, 0.0, 1.0));
          params.put(FaceBeautyParam.NOSE_INTENSITY_V2, new ModelAttributeData(0.5, 0.0, 0.0, 1.0));
          params.put(FaceBeautyParam.MOUTH_INTENSITY_V2, new ModelAttributeData(0.4, 0.5, 0.0, 1.0));
          params.put(FaceBeautyParam.CANTHUS_INTENSITY, new ModelAttributeData(0.0, 0.0, 0.0, 1.0));
          params.put(FaceBeautyParam.EYE_SPACE_INTENSITY, new ModelAttributeData(0.5, 0.5, 0.0, 1.0));
          params.put(FaceBeautyParam.EYE_ROTATE_INTENSITY, new ModelAttributeData(0.5, 0.5, 0.0, 1.0));
          params.put(FaceBeautyParam.LONG_NOSE_INTENSITY, new ModelAttributeData(0.5, 0.5, 0.0, 1.0));
          params.put(FaceBeautyParam.PHILTRUM_INTENSITY, new ModelAttributeData(0.5, 0.5, 0.0, 1.0));
          params.put(FaceBeautyParam.SMILE_INTENSITY, new ModelAttributeData(0.0, 0.0, 0.0, 1.0));
          return params;
      }
  
  
      /**
       * 初始化滤镜参数
       *
       * @return ArrayList<FaceBeautyFilterBean>
       */
      public static ArrayList<FaceBeautyFilterBean> buildFilters() {
          ArrayList<FaceBeautyFilterBean> filters = new ArrayList<>();
          filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.ORIGIN, R.mipmap.icon_beauty_filter_cancel, R.string.origin, 0.0));
          filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.ZIRAN_1, R.mipmap.icon_beauty_filter_natural_1, R.string.ziran_1));
          filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.ZHIGANHUI_1, R.mipmap.icon_beauty_filter_texture_gray_1, R.string.zhiganhui_1));
          filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.BAILIANG_1, R.mipmap.icon_beauty_filter_bailiang_1, R.string.bailiang_1));
          filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.FENNEN_1, R.mipmap.icon_beauty_filter_fennen_1, R.string.fennen_1));
          filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.LENGSEDIAO_1, R.mipmap.icon_beauty_filter_lengsediao_1, R.string.lengsediao_1));
          return filters;
      }
  
  }
  