PowerLUT.java 文件源码

java
阅读 18 收藏 0 点赞 0 评论 0

项目:DoubleHelix 作者:
/** W power will be in luminance, and H power will be in alpha**/
public PowerLUT(float powerW, float intensityW, float powerH, float intensityH, int width, int height){

    Pixmap pixmap = new Pixmap(width, height, Format.RGBA8888);
    for (int i=0; i<width; i++){
        float valueW = (float)Math.pow((float)i/width, powerW) * intensityW;
           for (int j = 0; j < height; j++) {
               float valueH = (float)Math.pow((float)j/height, powerH) * intensityH;
               pixmap.setColor(valueW, valueH, 1.0f, 1.0f);
               pixmap.drawPixel(i, j);
           }
    }

    PixmapTextureData data = new PixmapTextureData(pixmap, Format.RGBA8888, false, false, true);

    texture = new Texture(data);
    texture.setWrap(TextureWrap.ClampToEdge, TextureWrap.ClampToEdge);
    texture.setFilter(TextureFilter.Linear, TextureFilter.Linear);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号