Java Integer to Float intToFloatColor(int value)

Here you can find the source of intToFloatColor(int value)

Description

Encodes the ABGR int color as a float.

License

Open Source License

Declaration

public static float intToFloatColor(int value) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /** Encodes the ABGR int color as a float. The high bits are masked to avoid using floats in the NaN range, which unfortunately
     * means the full range of alpha cannot be used. See {@link Float#intBitsToFloat(int)} javadocs. */
    public static float intToFloatColor(int value) {
        return Float.intBitsToFloat(value & 0xfeffffff);
    }//w  w w.ja  v a  2s . co m

    public static float intBitsToFloat(int value) {
        return Float.intBitsToFloat(value);
    }
}

Related

  1. convertIntToFloat(int arr[])
  2. intToFloat(int integer)
  3. intToFloat(int[] values)
  4. IntToFloat(long x)
  5. intToFloatArray(int[] ints)