Search in sources :

Example 1 with GPUImageLookupFilter

use of jp.co.cyberagent.lansongsdk.gpuimage.GPUImageLookupFilter in project LanSoEditor_advance by LanSoSdk.

the class BeautyManager method addBeauty.

/**
 * 增加美颜
 *
 * @param camlayer
 */
public void addBeauty(CameraLayer camlayer) {
    if (camlayer != null) {
        isTuneBeauting = true;
        ArrayList<GPUImageFilter> filters = new ArrayList<GPUImageFilter>();
        beautyTuneFilter = new LanSongBeautyTuneFilter();
        filters.add(beautyTuneFilter);
        // 设置亮度;
        camlayer.setBeautyBrightness(1);
        String bmpStr = CopyFileFromAssets.copyAssets(mContext, "lansongbeauty.png");
        if (bmpStr != null) {
            mlookupFilter = new GPUImageLookupFilter(0.22f);
            Bitmap bmp = BitmapFactory.decodeFile(bmpStr);
            mlookupFilter.setBitmap(bmp);
            filters.add(mlookupFilter);
        } else {
            Log.e(TAG, "无法获取lansongbeauty图片文件");
        }
        camlayer.switchFilterList(filters);
    } else {
        Log.e(TAG, "add beauty error. camlayer is null");
    }
}
Also used : GPUImageFilter(jp.co.cyberagent.lansongsdk.gpuimage.GPUImageFilter) Bitmap(android.graphics.Bitmap) GPUImageLookupFilter(jp.co.cyberagent.lansongsdk.gpuimage.GPUImageLookupFilter) ArrayList(java.util.ArrayList) LanSongBeautyTuneFilter(jp.co.cyberagent.lansongsdk.gpuimage.LanSongBeautyTuneFilter)

Aggregations

Bitmap (android.graphics.Bitmap)1 ArrayList (java.util.ArrayList)1 GPUImageFilter (jp.co.cyberagent.lansongsdk.gpuimage.GPUImageFilter)1 GPUImageLookupFilter (jp.co.cyberagent.lansongsdk.gpuimage.GPUImageLookupFilter)1 LanSongBeautyTuneFilter (jp.co.cyberagent.lansongsdk.gpuimage.LanSongBeautyTuneFilter)1