Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import android.graphics.Bitmap;

import android.graphics.Color;

public class Main {
    public static Bitmap convert(float[] normals, int width, int height) {
        int[] pixels = new int[width * height];
        for (int i = 0; i < width * height; i++) {
            pixels[i] = Color.rgb((int) normals[4 * i + 0], (int) normals[4 * i + 1], (int) normals[4 * i + 2]);
        }

        return Bitmap.createBitmap(pixels, width, height, Bitmap.Config.ARGB_8888);
    }
}