• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java AlphaValue类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: applyPaintConfig

import master.flame.danmaku.danmaku.model.AlphaValue; //导入依赖的package包/类
private void applyPaintConfig(BaseDanmaku danmaku, Paint paint, boolean stroke) {
    if (this.isTranslucent) {
        if (stroke) {
            paint.setStyle(this.HAS_PROJECTION ? Style.FILL : Style.STROKE);
            paint.setColor(danmaku.textShadowColor & ViewCompat.MEASURED_SIZE_MASK);
            paint.setAlpha(this.HAS_PROJECTION ? (int) (((float) this.sProjectionAlpha) * (((float) this.transparency) / ((float) AlphaValue.MAX))) : this.transparency);
            return;
        }
        paint.setStyle(Style.FILL);
        paint.setColor(danmaku.textColor & ViewCompat.MEASURED_SIZE_MASK);
        paint.setAlpha(this.transparency);
    } else if (stroke) {
        paint.setStyle(this.HAS_PROJECTION ? Style.FILL : Style.STROKE);
        paint.setColor(danmaku.textShadowColor & ViewCompat.MEASURED_SIZE_MASK);
        paint.setAlpha(this.HAS_PROJECTION ? this.sProjectionAlpha : AlphaValue.MAX);
    } else {
        paint.setStyle(Style.FILL);
        paint.setColor(danmaku.textColor & ViewCompat.MEASURED_SIZE_MASK);
        paint.setAlpha(AlphaValue.MAX);
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:22,代码来源:AndroidDisplayer.java


示例2: setDanmakuTransparency

import master.flame.danmaku.danmaku.model.AlphaValue; //导入依赖的package包/类
public DanmakuContext setDanmakuTransparency(float p) {
    int newTransparency = (int) (((float) AlphaValue.MAX) * p);
    if (newTransparency != this.transparency) {
        this.transparency = newTransparency;
        this.mDisplayer.setTransparency(newTransparency);
        notifyConfigureChanged(DanmakuConfigTag.TRANSPARENCY, Float.valueOf(p));
    }
    return this;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:10,代码来源:DanmakuContext.java


示例3: setDanmakuTransparency

import master.flame.danmaku.danmaku.model.AlphaValue; //导入依赖的package包/类
public DanmakuContext setDanmakuTransparency(float p) {
    int newTransparency = (int) (p * AlphaValue.MAX);
    if (newTransparency != transparency) {
        transparency = newTransparency;
        mDisplayer.setTransparency(newTransparency);
        notifyConfigureChanged(DanmakuConfigTag.TRANSPARENCY, p);
    }
    return this;
}
 
开发者ID:lisnstatic,项目名称:live_master,代码行数:10,代码来源:DanmakuContext.java


示例4: setDanmakuTransparency

import master.flame.danmaku.danmaku.model.AlphaValue; //导入依赖的package包/类
public DanmakuGlobalConfig setDanmakuTransparency(float p) {
    int newTransparency = (int) (p * AlphaValue.MAX);
    if (newTransparency != transparency) {
        transparency = newTransparency;
        isTranslucent = (newTransparency != AlphaValue.MAX);
        notifyConfigureChanged(DanmakuConfigTag.TRANSPARENCY, p);
    }
    return this;
}
 
开发者ID:jiangerji,项目名称:danmaku-project,代码行数:10,代码来源:DanmakuGlobalConfig.java


示例5: setTransparency

import master.flame.danmaku.danmaku.model.AlphaValue; //导入依赖的package包/类
public void setTransparency(int newTransparency) {
    this.isTranslucent = newTransparency != AlphaValue.MAX;
    this.transparency = newTransparency;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:5,代码来源:AndroidDisplayer.java


示例6: draw

import master.flame.danmaku.danmaku.model.AlphaValue; //导入依赖的package包/类
public int draw(BaseDanmaku danmaku) {
    float top = danmaku.getTop();
    float left = danmaku.getLeft();
    if (this.canvas == null) {
        return 0;
    }
    Paint alphaPaint = null;
    boolean needRestore = false;
    if (danmaku.getType() == 7) {
        if (danmaku.getAlpha() == AlphaValue.TRANSPARENT) {
            return 0;
        }
        if (!(danmaku.rotationZ == 0.0f && danmaku.rotationY == 0.0f)) {
            saveCanvas(danmaku, this.canvas, left, top);
            needRestore = true;
        }
        if (danmaku.getAlpha() != AlphaValue.MAX) {
            alphaPaint = this.ALPHA_PAINT;
            alphaPaint.setAlpha(danmaku.getAlpha());
        }
    }
    if (alphaPaint != null && alphaPaint.getAlpha() == AlphaValue.TRANSPARENT) {
        return 0;
    }
    boolean cacheDrawn = false;
    int result = 1;
    if (danmaku.hasDrawingCache() && danmaku.cache != null) {
        DrawingCacheHolder holder = ((DrawingCache) danmaku.cache).get();
        if (holder != null) {
            cacheDrawn = holder.draw(this.canvas, left, top, alphaPaint);
        }
    }
    if (!cacheDrawn) {
        if (alphaPaint != null) {
            this.PAINT.setAlpha(alphaPaint.getAlpha());
        } else {
            resetPaintAlpha(this.PAINT);
        }
        drawDanmaku(danmaku, this.canvas, left, top, false);
        result = 2;
    }
    if (danmaku.isClickZan) {
        this.sStuffer.drawClickBg(danmaku, this.canvas, left, top);
    }
    if (needRestore) {
        restoreCanvas(this.canvas);
    }
    return result;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:50,代码来源:AndroidDisplayer.java


示例7: resetPaintAlpha

import master.flame.danmaku.danmaku.model.AlphaValue; //导入依赖的package包/类
private void resetPaintAlpha(Paint paint) {
    if (paint.getAlpha() != AlphaValue.MAX) {
        paint.setAlpha(AlphaValue.MAX);
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:6,代码来源:AndroidDisplayer.java


示例8: setTransparency

import master.flame.danmaku.danmaku.model.AlphaValue; //导入依赖的package包/类
@Override
public void setTransparency(int newTransparency) {
    isTranslucent = (newTransparency != AlphaValue.MAX);
    transparency = newTransparency;
}
 
开发者ID:lisnstatic,项目名称:live_master,代码行数:6,代码来源:AndroidDisplayer.java


示例9: draw

import master.flame.danmaku.danmaku.model.AlphaValue; //导入依赖的package包/类
@Override
public int draw(BaseDanmaku danmaku) {
    float top = danmaku.getTop();
    float left = danmaku.getLeft();
    if (canvas != null) {

        Paint alphaPaint = null;
        boolean needRestore = false;
        if (danmaku.getType() == BaseDanmaku.TYPE_SPECIAL) {
            if (danmaku.getAlpha() == AlphaValue.TRANSPARENT) {
                return IRenderer.NOTHING_RENDERING;
            }
            if (danmaku.rotationZ != 0 || danmaku.rotationY != 0) {
                saveCanvas(danmaku, canvas, left, top);
                needRestore = true;
            }

            int alpha = danmaku.getAlpha();
            if (alpha != AlphaValue.MAX) {
                alphaPaint = ALPHA_PAINT;
                alphaPaint.setAlpha(danmaku.getAlpha());
            }
        }

        // skip drawing when danmaku is transparent
        if (alphaPaint != null && alphaPaint.getAlpha() == AlphaValue.TRANSPARENT) {
            return IRenderer.NOTHING_RENDERING;
        }
        // drawing cache
        boolean cacheDrawn = false;
        int result = IRenderer.CACHE_RENDERING;
        if (danmaku.hasDrawingCache()) {
            DrawingCacheHolder holder = ((DrawingCache) danmaku.cache).get();
            if (holder != null) {
                cacheDrawn = holder.draw(canvas, left, top, alphaPaint);
            }
        }
        if (!cacheDrawn) {
            if (alphaPaint != null) {
                PAINT.setAlpha(alphaPaint.getAlpha());
            } else {
                resetPaintAlpha(PAINT);
            }
            drawDanmaku(danmaku, canvas, left, top, false);
            result = IRenderer.TEXT_RENDERING;
        }

        if (needRestore) {
            restoreCanvas(canvas);
        }

        return result;
    }

    return IRenderer.NOTHING_RENDERING;
}
 
开发者ID:lisnstatic,项目名称:live_master,代码行数:57,代码来源:AndroidDisplayer.java


示例10: draw

import master.flame.danmaku.danmaku.model.AlphaValue; //导入依赖的package包/类
@Override
public int draw(BaseDanmaku danmaku) {
    float top = danmaku.getTop();
    float left = danmaku.getLeft();
    if (canvas != null) {

        Paint alphaPaint = null;
        boolean needRestore = false;
        if (danmaku.getType() == BaseDanmaku.TYPE_SPECIAL) {
            if (danmaku.getAlpha() == AlphaValue.TRANSPARENT) {
                return IRenderer.NOTHING_RENDERING;
            }
            if (danmaku.rotationZ != 0 || danmaku.rotationY != 0) {
                saveCanvas(danmaku, canvas, left, top);
                needRestore = true;
            }

            int alpha = danmaku.getAlpha();
            if (alpha != AlphaValue.MAX) {
                alphaPaint = ALPHA_PAINT;
                alphaPaint.setAlpha(danmaku.getAlpha());
            }
        }

        // skip drawing when danmaku is transparent
        if (alphaPaint != null && alphaPaint.getAlpha() == AlphaValue.TRANSPARENT) {
            return IRenderer.NOTHING_RENDERING;
        }
        // drawing cache
        boolean cacheDrawn = false;
        int result = IRenderer.CACHE_RENDERING;
        IDrawingCache<?> cache = danmaku.getDrawingCache();
        if (cache != null) {
            DrawingCacheHolder holder = (DrawingCacheHolder) cache.get();
            if (holder != null) {
                cacheDrawn = holder.draw(canvas, left, top, alphaPaint);
            }
        }
        if (!cacheDrawn) {
            if (alphaPaint != null) {
                PAINT.setAlpha(alphaPaint.getAlpha());
            } else {
                resetPaintAlpha(PAINT);
            }
            drawDanmaku(danmaku, canvas, left, top, false);
            result = IRenderer.TEXT_RENDERING;
        }

        if (needRestore) {
            restoreCanvas(canvas);
        }

        return result;
    }

    return IRenderer.NOTHING_RENDERING;
}
 
开发者ID:amikey,项目名称:DanmakuFlameMaster,代码行数:58,代码来源:AndroidDisplayer.java


示例11: draw

import master.flame.danmaku.danmaku.model.AlphaValue; //导入依赖的package包/类
@Override
public int draw(BaseDanmaku danmaku) {
    float top = danmaku.getTop();
    float left = danmaku.getLeft();
    if (canvas != null) {

        Paint alphaPaint = null;
        boolean needRestore = false;
        if (danmaku.getType() == BaseDanmaku.TYPE_SPECIAL) {
            if (danmaku.getAlpha() == AlphaValue.TRANSPARENT) {
                return IRenderer.NOTHING_RENDERING;
            }
            if (danmaku.rotationZ != 0 || danmaku.rotationY != 0) {
                saveCanvas(danmaku, canvas, left, top);
                needRestore = true;
            }

            int alpha = danmaku.getAlpha();
            if (alpha != AlphaValue.MAX) {
                alphaPaint = ALPHA_PAINT;
                alphaPaint.setAlpha(danmaku.getAlpha());
            }
        }

        // skip drawing when danmaku is transparent
        if (alphaPaint != null && alphaPaint.getAlpha() == AlphaValue.TRANSPARENT) {
            return IRenderer.NOTHING_RENDERING;
        }
        // drawing cache
        boolean cacheDrawn = false;
        int result = IRenderer.CACHE_RENDERING;
        if (danmaku.hasDrawingCache()) {
            DrawingCacheHolder holder = ((DrawingCache) danmaku.cache).get();
            if (holder != null) {
                cacheDrawn = holder.draw(canvas, left, top, alphaPaint);
            }
        }
        if (!cacheDrawn) {
            if (alphaPaint != null) {
                PAINT.setAlpha(alphaPaint.getAlpha());
            } else {
                resetPaintAlpha(PAINT);
            }
            drawDanmaku(danmaku, canvas, left, top, true);
            result = IRenderer.TEXT_RENDERING;
        }

        if (needRestore) {
            restoreCanvas(canvas);
        }

        return result;
    }

    return IRenderer.NOTHING_RENDERING;
}
 
开发者ID:liucloo,项目名称:ijkPlayer-Danmaku,代码行数:57,代码来源:AndroidDisplayer.java


示例12: draw

import master.flame.danmaku.danmaku.model.AlphaValue; //导入依赖的package包/类
@Override
public void draw(BaseDanmaku danmaku) {
    float top = danmaku.getTop();
    float left = danmaku.getLeft();
    if (canvas != null) {

        Paint alphaPaint = null;
        boolean needRestore = false;
        if (danmaku.getType() == BaseDanmaku.TYPE_SPECIAL) {
            if (danmaku.getAlpha() == AlphaValue.TRANSPARENT) {
                return;
            }
            if (danmaku.rotationZ != 0 || danmaku.rotationY != 0) {
                saveCanvas(danmaku, canvas, left, top);
                needRestore = true;
            }

            int alpha = danmaku.getAlpha();
            if ( alpha != AlphaValue.MAX) {
                alphaPaint = ALPHA_PAINT;
                alphaPaint.setAlpha(danmaku.getAlpha());
            }
        }
        
        // skip drawing when danmaku is transparent
        if(alphaPaint!=null && alphaPaint.getAlpha()== AlphaValue.TRANSPARENT){
            return;
        }
        // drawing cache
        boolean cacheDrawn = false;
        if (danmaku.hasDrawingCache()) {
            DrawingCacheHolder holder = ((DrawingCache) danmaku.cache).get();
            if (holder != null && holder.bitmap != null && !holder.bitmap.isRecycled()) {
                canvas.drawBitmap(holder.bitmap, left, top, alphaPaint);                    
                cacheDrawn = true;
            }
        }
        if (!cacheDrawn) {
            if (alphaPaint != null) {
                PAINT.setAlpha(alphaPaint.getAlpha());
            } else {
                resetPaintAlpha(PAINT);
            }
            drawDanmaku(danmaku, canvas, left, top, true);
        }

        if (needRestore) {
            restoreCanvas(canvas);
        }
    }
}
 
开发者ID:jiangerji,项目名称:danmaku-project,代码行数:52,代码来源:AndroidDisplayer.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java OpJoin类代码示例发布时间:2022-05-22
下一篇:
Java GetDatanodeReportResponseProto类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap