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

Java NativeBitmapFactory类代码示例

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

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



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

示例1: buildCache

import tv.cjump.jni.NativeBitmapFactory; //导入依赖的package包/类
public void buildCache(int w, int h, int density, boolean checkSizeEquals) {
        boolean reuse = checkSizeEquals ? (w == width && h == height) : (w <= width && h <= height);
        if (reuse && bitmap != null) {
//            canvas.drawColor(Color.TRANSPARENT);
//            canvas.setBitmap(null);
            bitmap.eraseColor(Color.TRANSPARENT);
            canvas.setBitmap(bitmap);
            recycleBitmapArray();
            return;
        }
        if (bitmap != null) {
            recycle();
        }
        width = w;
        height = h;
        bitmap = NativeBitmapFactory.createBitmap(w, h, Bitmap.Config.ARGB_8888);
        if (density > 0) {
            mDensity = density;
            bitmap.setDensity(density);
        }
        if (canvas == null){
            canvas = new Canvas(bitmap);
            canvas.setDensity(density);
        }else
            canvas.setBitmap(bitmap);
    }
 
开发者ID:amikey,项目名称:DanmakuFlameMaster,代码行数:27,代码来源:DrawingCacheHolder.java


示例2: buildCache

import tv.cjump.jni.NativeBitmapFactory; //导入依赖的package包/类
public void buildCache(int w, int h, int density, boolean checkSizeEquals) {
        boolean reuse = checkSizeEquals ? (w == width && h == height) : (w <= width && h <= height);
        if (reuse && bitmap != null) {
//            canvas.drawColor(Color.TRANSPARENT);
            canvas.setBitmap(null);
            bitmap.eraseColor(Color.TRANSPARENT);
            canvas.setBitmap(bitmap);
            recycleBitmapArray();
            return;
        }
        if (bitmap != null) {
            recycle();
        }
        width = w;
        height = h;
        bitmap = NativeBitmapFactory.createBitmap(w, h, Bitmap.Config.ARGB_8888);
        if (density > 0) {
            mDensity = density;
            bitmap.setDensity(density);
        }
        if (canvas == null){
            canvas = new Canvas(bitmap);
            canvas.setDensity(density);
        }else
            canvas.setBitmap(bitmap);
    }
 
开发者ID:liucloo,项目名称:ijkPlayer-Danmaku,代码行数:27,代码来源:DrawingCacheHolder.java


示例3: buildCache

import tv.cjump.jni.NativeBitmapFactory; //导入依赖的package包/类
public void buildCache(int w, int h, int density, boolean checkSizeEquals) {
        boolean reuse = checkSizeEquals ? (w == width && h == height) : (w <= width && h <= height);
        if (reuse && bitmap != null && !bitmap.isRecycled()) {
//            canvas.drawColor(Color.TRANSPARENT);
            canvas.setBitmap(null);
            bitmap.eraseColor(Color.TRANSPARENT);
            canvas.setBitmap(bitmap);            
            return;
        }
        if (bitmap != null) {
            recycle();
        }
        width = w;
        height = h;
        bitmap = NativeBitmapFactory.createBitmap(w, h, Bitmap.Config.ARGB_8888);
        if (density > 0) {
            mDensity = density;
            bitmap.setDensity(density);
        }
        if (canvas == null){
            canvas = new Canvas(bitmap);
            canvas.setDensity(density);
        }else
            canvas.setBitmap(bitmap);
    }
 
开发者ID:jiangerji,项目名称:danmaku-project,代码行数:26,代码来源:DrawingCacheHolder.java


示例4: CacheManagingDrawTask

import tv.cjump.jni.NativeBitmapFactory; //导入依赖的package包/类
public CacheManagingDrawTask(DanmakuTimer timer, DanmakuContext config, TaskListener taskListener, int maxCacheSize) {
    super(timer, config, taskListener);
    NativeBitmapFactory.loadLibs();
    this.mMaxCacheSize = maxCacheSize;
    if (NativeBitmapFactory.isInNativeAlloc()) {
        this.mMaxCacheSize = maxCacheSize * 2;
    }
    this.mCacheManager = new CacheManager(maxCacheSize, 3);
    this.mRenderer.setCacheManager(this.mCacheManager);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:11,代码来源:CacheManagingDrawTask.java


示例5: start

import tv.cjump.jni.NativeBitmapFactory; //导入依赖的package包/类
public void start() {
    super.start();
    NativeBitmapFactory.loadLibs();
    if (this.mCacheManager == null) {
        this.mCacheManager = new CacheManager(this.mMaxCacheSize, 3);
        this.mCacheManager.begin();
        this.mRenderer.setCacheManager(this.mCacheManager);
        return;
    }
    this.mCacheManager.resume();
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:12,代码来源:CacheManagingDrawTask.java


示例6: quit

import tv.cjump.jni.NativeBitmapFactory; //导入依赖的package包/类
public void quit() {
    super.quit();
    reset();
    this.mRenderer.setCacheManager(null);
    if (this.mCacheManager != null) {
        this.mCacheManager.end();
        this.mCacheManager = null;
    }
    NativeBitmapFactory.releaseLibs();
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:11,代码来源:CacheManagingDrawTask.java


示例7: buildCache

import tv.cjump.jni.NativeBitmapFactory; //导入依赖的package包/类
public void buildCache(int w, int h, int density, boolean checkSizeEquals) {
    boolean reuse = true;
    if (checkSizeEquals) {
        if (!(w == this.width && h == this.height)) {
            reuse = false;
        }
    } else if (w > this.width || h > this.height) {
        reuse = false;
    }
    if (!reuse || this.bitmap == null) {
        if (this.bitmap != null) {
            recycle();
        }
        this.width = w;
        this.height = h;
        this.bitmap = NativeBitmapFactory.createBitmap(w, h, Config.ARGB_8888);
        if (density > 0) {
            this.mDensity = density;
            this.bitmap.setDensity(density);
        }
        if (this.canvas == null) {
            this.canvas = new Canvas(this.bitmap);
            this.canvas.setDensity(density);
            return;
        }
        this.canvas.setBitmap(this.bitmap);
        return;
    }
    this.canvas.setBitmap(null);
    this.bitmap.eraseColor(0);
    this.canvas.setBitmap(this.bitmap);
    recycleBitmapArray();
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:34,代码来源:DrawingCacheHolder.java


示例8: CacheManagingDrawTask

import tv.cjump.jni.NativeBitmapFactory; //导入依赖的package包/类
public CacheManagingDrawTask(DanmakuTimer timer, DanmakuContext config, TaskListener taskListener, int maxCacheSize) {
    super(timer, config, taskListener);
    NativeBitmapFactory.loadLibs();
    mMaxCacheSize = maxCacheSize;
    if (NativeBitmapFactory.isInNativeAlloc()) {
        mMaxCacheSize = maxCacheSize * 2;
    }
    mCacheManager = new CacheManager(maxCacheSize, MAX_CACHE_SCREEN_SIZE);
    mRenderer.setCacheManager(mCacheManager);
}
 
开发者ID:lisnstatic,项目名称:live_master,代码行数:11,代码来源:CacheManagingDrawTask.java


示例9: start

import tv.cjump.jni.NativeBitmapFactory; //导入依赖的package包/类
@Override
public void start() {
    super.start();
    NativeBitmapFactory.loadLibs();
    if (mCacheManager == null) {
        mCacheManager = new CacheManager(mMaxCacheSize, MAX_CACHE_SCREEN_SIZE);
        mCacheManager.begin();
        mRenderer.setCacheManager(mCacheManager);
    } else {
        mCacheManager.resume();
    }
}
 
开发者ID:lisnstatic,项目名称:live_master,代码行数:13,代码来源:CacheManagingDrawTask.java


示例10: quit

import tv.cjump.jni.NativeBitmapFactory; //导入依赖的package包/类
@Override
public void quit() {
    super.quit();
    reset();
    mRenderer.setCacheManager(null);
    if (mCacheManager != null) {
        mCacheManager.end();
        mCacheManager = null;
    }
    NativeBitmapFactory.releaseLibs();
}
 
开发者ID:lisnstatic,项目名称:live_master,代码行数:12,代码来源:CacheManagingDrawTask.java


示例11: CacheManagingDrawTask

import tv.cjump.jni.NativeBitmapFactory; //导入依赖的package包/类
public CacheManagingDrawTask(DanmakuTimer timer, DanmakuContext config, TaskListener taskListener, int maxCacheSize) {
    super(timer, config, taskListener);
    NativeBitmapFactory.loadLibs();
    mMaxCacheSize = maxCacheSize;
    if (NativeBitmapFactory.isInNativeAlloc()) {
        mMaxCacheSize = maxCacheSize * 2;
    }
    mCacheManager = new CacheManager(maxCacheSize, MAX_CACHE_SCREEN_SIZE);
}
 
开发者ID:liucloo,项目名称:ijkPlayer-Danmaku,代码行数:10,代码来源:CacheManagingDrawTask.java


示例12: start

import tv.cjump.jni.NativeBitmapFactory; //导入依赖的package包/类
@Override
public void start() {
    super.start();
    NativeBitmapFactory.loadLibs();
    if (mCacheManager == null) {
        mCacheManager = new CacheManager(mMaxCacheSize, MAX_CACHE_SCREEN_SIZE);
        mCacheManager.begin();
    } else {
        mCacheManager.resume();
    }
}
 
开发者ID:liucloo,项目名称:ijkPlayer-Danmaku,代码行数:12,代码来源:CacheManagingDrawTask.java


示例13: quit

import tv.cjump.jni.NativeBitmapFactory; //导入依赖的package包/类
@Override
public void quit() {
    super.quit();
    reset();
    if (mCacheManager != null) {
        mCacheManager.end();
        mCacheManager = null;
    }
    NativeBitmapFactory.releaseLibs();
}
 
开发者ID:liucloo,项目名称:ijkPlayer-Danmaku,代码行数:11,代码来源:CacheManagingDrawTask.java


示例14: CacheManagingDrawTask

import tv.cjump.jni.NativeBitmapFactory; //导入依赖的package包/类
public CacheManagingDrawTask(DanmakuTimer timer, Context context, AbsDisplayer<?> disp,
        TaskListener taskListener, int maxCacheSize) {
    super(timer, context, disp, taskListener);
    NativeBitmapFactory.loadLibs();
    mMaxCacheSize = maxCacheSize;
    mCacheManager = new CacheManager(maxCacheSize, MAX_CACHE_SCREEN_SIZE);
}
 
开发者ID:jiangerji,项目名称:danmaku-project,代码行数:8,代码来源:CacheManagingDrawTask.java


示例15: start

import tv.cjump.jni.NativeBitmapFactory; //导入依赖的package包/类
@Override
public void start() {
    NativeBitmapFactory.loadLibs();
    if (mCacheManager == null) {
        mCacheManager = new CacheManager(mMaxCacheSize, MAX_CACHE_SCREEN_SIZE);
        mCacheManager.begin();
    } else {
        mCacheManager.resume();
    }
}
 
开发者ID:jiangerji,项目名称:danmaku-project,代码行数:11,代码来源:CacheManagingDrawTask.java


示例16: quit

import tv.cjump.jni.NativeBitmapFactory; //导入依赖的package包/类
@Override
public void quit() {
    super.quit();
    reset();
    if(mCacheManager!=null){
        mCacheManager.end();
        mCacheManager = null;
    }
    NativeBitmapFactory.releaseLibs();
}
 
开发者ID:jiangerji,项目名称:danmaku-project,代码行数:11,代码来源:CacheManagingDrawTask.java


示例17: splitWith

import tv.cjump.jni.NativeBitmapFactory; //导入依赖的package包/类
@SuppressLint({"NewApi"})
public void splitWith(int dispWidth, int dispHeight, int maximumCacheWidth, int maximumCacheHeight) {
    recycleBitmapArray();
    if (this.width > 0 && this.height > 0 && this.bitmap != null) {
        if (this.width > maximumCacheWidth || this.height > maximumCacheHeight) {
            maximumCacheWidth = Math.min(maximumCacheWidth, dispWidth);
            maximumCacheHeight = Math.min(maximumCacheHeight, dispHeight);
            int xCount = (this.width / maximumCacheWidth) + (this.width % maximumCacheWidth == 0 ? 0 : 1);
            int yCount = (this.height / maximumCacheHeight) + (this.height % maximumCacheHeight == 0 ? 0 : 1);
            int averageWidth = this.width / xCount;
            int averageHeight = this.height / yCount;
            Bitmap[][] bmpArray = (Bitmap[][]) Array.newInstance(Bitmap.class, new int[]{yCount, xCount});
            if (this.canvas == null) {
                this.canvas = new Canvas();
                if (this.mDensity > 0) {
                    this.canvas.setDensity(this.mDensity);
                }
            }
            Rect rectSrc = new Rect();
            Rect rectDst = new Rect();
            for (int yIndex = 0; yIndex < yCount; yIndex++) {
                for (int xIndex = 0; xIndex < xCount; xIndex++) {
                    Bitmap[] bitmapArr = bmpArray[yIndex];
                    Bitmap bmp = NativeBitmapFactory.createBitmap(averageWidth, averageHeight, Config.ARGB_8888);
                    bitmapArr[xIndex] = bmp;
                    if (this.mDensity > 0) {
                        bmp.setDensity(this.mDensity);
                    }
                    this.canvas.setBitmap(bmp);
                    int left = xIndex * averageWidth;
                    int top = yIndex * averageHeight;
                    rectSrc.set(left, top, left + averageWidth, top + averageHeight);
                    rectDst.set(0, 0, bmp.getWidth(), bmp.getHeight());
                    this.canvas.drawBitmap(this.bitmap, rectSrc, rectDst, null);
                }
            }
            this.canvas.setBitmap(this.bitmap);
            this.bitmapArray = bmpArray;
        }
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:42,代码来源:DrawingCacheHolder.java


示例18: splitWith

import tv.cjump.jni.NativeBitmapFactory; //导入依赖的package包/类
@SuppressLint("NewApi")
public void splitWith(int dispWidth, int dispHeight, int maximumCacheWidth, int maximumCacheHeight) {
    recycleBitmapArray();
    if (width <= 0 || height <= 0 || bitmap == null) {
        return;
    }
    if (width <= maximumCacheWidth && height <= maximumCacheHeight) {
        return;
    }
    maximumCacheWidth = Math.min(maximumCacheWidth, dispWidth);
    maximumCacheHeight = Math.min(maximumCacheHeight, dispHeight);
    int xCount = width / maximumCacheWidth + (width % maximumCacheWidth == 0 ? 0 : 1);
    int yCount = height / maximumCacheHeight + (height % maximumCacheHeight == 0 ? 0 : 1);
    int averageWidth = width / xCount;
    int averageHeight = height / yCount;
    final Bitmap[][] bmpArray = new Bitmap[yCount][xCount];
    if (canvas == null){
        canvas = new Canvas();
        if (mDensity > 0) {
            canvas.setDensity(mDensity);
        }
    }
    Rect rectSrc = new Rect();
    Rect rectDst = new Rect();
    for (int yIndex = 0; yIndex < yCount; yIndex++) {
        for (int xIndex = 0; xIndex < xCount; xIndex++) {
            Bitmap bmp = bmpArray[yIndex][xIndex] = NativeBitmapFactory.createBitmap(
                    averageWidth, averageHeight, Bitmap.Config.ARGB_8888);
            if (mDensity > 0) {
                bmp.setDensity(mDensity);
            }
            canvas.setBitmap(bmp);
            int left = xIndex * averageWidth, top = yIndex * averageHeight;
            rectSrc.set(left, top, left + averageWidth, top + averageHeight);
            rectDst.set(0, 0, bmp.getWidth(), bmp.getHeight());
            canvas.drawBitmap(bitmap, rectSrc, rectDst, null);
        }
    }
    canvas.setBitmap(bitmap);
    bitmapArray = bmpArray;
}
 
开发者ID:amikey,项目名称:DanmakuFlameMaster,代码行数:42,代码来源:DrawingCacheHolder.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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