当前位置: 首页>>代码示例>>Java>>正文


Java GPUImageDarkenBlendFilter类代码示例

本文整理汇总了Java中jp.co.cyberagent.android.gpuimage.GPUImageDarkenBlendFilter的典型用法代码示例。如果您正苦于以下问题:Java GPUImageDarkenBlendFilter类的具体用法?Java GPUImageDarkenBlendFilter怎么用?Java GPUImageDarkenBlendFilter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


GPUImageDarkenBlendFilter类属于jp.co.cyberagent.android.gpuimage包,在下文中一共展示了GPUImageDarkenBlendFilter类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createRenderEntities

import jp.co.cyberagent.android.gpuimage.GPUImageDarkenBlendFilter; //导入依赖的package包/类
@NonNull
private List<CaseEntity> createRenderEntities() {
    List<CaseEntity> renderEntityList = new ArrayList<>(100);

    BasicTextureFilter basicTextureFilter = new BasicTextureFilter();
    renderEntityList.add(new CaseEntity(basicTextureFilter, new GPUImageFilter(), firstBitmap));

    ContrastFilter contrastFilter = new ContrastFilter(3.0f);
    GPUImageContrastFilter gpuImageContrastFilter = new GPUImageContrastFilter(3.0f);
    renderEntityList.add(new CaseEntity(contrastFilter, gpuImageContrastFilter, firstBitmap));

    SaturationFilter saturationFilter = new SaturationFilter(0.5f);
    GPUImageSaturationFilter gpuImageSaturationFilter = new GPUImageSaturationFilter(0.5f);
    renderEntityList.add(new CaseEntity(saturationFilter, gpuImageSaturationFilter, firstBitmap));

    List<TextureFilter> filters = new ArrayList<>();
    filters.add(new ContrastFilter(3.0f));
    filters.add(new SaturationFilter(0.5f));
    FilterGroup filterGroup = new FilterGroup(filters);
    GPUImageFilterGroup gpuImageFilterGroup = new GPUImageFilterGroup();
    gpuImageFilterGroup.addFilter(new GPUImageContrastFilter(3.0f));
    gpuImageFilterGroup.addFilter(new GPUImageSaturationFilter(0.5f));
    renderEntityList.add(new CaseEntity(filterGroup, gpuImageFilterGroup, firstBitmap));

    HueFilter hueFilter = new HueFilter(190);
    GPUImageHueFilter gpuImageHueFilter = new GPUImageHueFilter(190);
    renderEntityList.add(new CaseEntity(hueFilter, gpuImageHueFilter, firstBitmap));

    PixelationFilter pixelationFilter = new PixelationFilter(36);
    GPUImagePixelationFilter gpuImagePixelationFilter = new GPUImagePixelationFilter();
    gpuImagePixelationFilter.setPixel(36);
    renderEntityList.add(new CaseEntity(pixelationFilter, gpuImagePixelationFilter, firstBitmap));

    LightenBlendFilter lightenBlendFilter = new LightenBlendFilter(secondBitmap);
    GPUImageLightenBlendFilter gpuImageLightenBlendFilter = new GPUImageLightenBlendFilter();
    gpuImageLightenBlendFilter.setBitmap(secondBitmap);
    renderEntityList.add(new CaseEntity(lightenBlendFilter, gpuImageLightenBlendFilter, firstBitmap));

    DarkenBlendFilter darkenBlendFilter = new DarkenBlendFilter(secondBitmap);
    GPUImageDarkenBlendFilter gpuImageDarkenBlendFilter = new GPUImageDarkenBlendFilter();
    gpuImageDarkenBlendFilter.setBitmap(secondBitmap);
    renderEntityList.add(new CaseEntity(darkenBlendFilter, gpuImageDarkenBlendFilter, firstBitmap));

    GammaFilter gammaFilter = new GammaFilter(2.0f);
    GPUImageGammaFilter gpuImageGammaFilter = new GPUImageGammaFilter(2.0f);
    renderEntityList.add(new CaseEntity(gammaFilter, gpuImageGammaFilter, firstBitmap));

    DirectionalSobelEdgeDetectionFilter directionalSobelEdgeDetectionFilter = new DirectionalSobelEdgeDetectionFilter(4.0f);
    GPUImageDirectionalSobelEdgeDetectionFilter gpuImageDirectionalSobelEdgeDetectionFilter = new GPUImageDirectionalSobelEdgeDetectionFilter();
    gpuImageDirectionalSobelEdgeDetectionFilter.setLineSize(4.0f);
    renderEntityList.add(new CaseEntity(directionalSobelEdgeDetectionFilter, gpuImageDirectionalSobelEdgeDetectionFilter, firstBitmap));

    RGBFilter rgbFilter = new RGBFilter(1.0f, 0.3f, 0.5f);
    GPUImageRGBFilter gpuImageRGBFilter = new GPUImageRGBFilter(1.0f, 0.3f, 0.5f);
    renderEntityList.add(new CaseEntity(rgbFilter, gpuImageRGBFilter, firstBitmap));

    float[] matrix4 = {
            1.0f, 0.0f, 0.0f, 0.3f,
            0.0f, 1.0f, 0.0f, 0.4f,
            0.0f, 0.0f, 1.0f, 0.0f,
            0.0f, 0.0f, 0.0f, 1.0f
    };
    ColorMatrixFilter colorMatrixFilter = new ColorMatrixFilter(0.3f, matrix4);
    GPUImageColorMatrixFilter gpuImageColorMatrixFilter = new GPUImageColorMatrixFilter(0.3f, matrix4);
    renderEntityList.add(new CaseEntity(colorMatrixFilter, gpuImageColorMatrixFilter, firstBitmap));

    return renderEntityList;
}
 
开发者ID:ChillingVan,项目名称:android-openGL-canvas,代码行数:69,代码来源:FilterActivity.java


注:本文中的jp.co.cyberagent.android.gpuimage.GPUImageDarkenBlendFilter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。