Java Number Swap swap32(int rgb)

Here you can find the source of swap32(int rgb)

Description

swap

License

Open Source License

Declaration

public static int swap32(int rgb) 

Method Source Code

//package com.java2s;

public class Main {
    public static int swap32(int rgb) {
        int a = (rgb >> 24) & 0xFF;
        int r = (rgb >> 16) & 0xff;
        int g = (rgb >> 8) & 0xff;
        int b = rgb & 0xff;

        return (b << 24) | (g << 16) | (r << 8) | a;
    }/*from w w  w . j ava 2 s. c o m*/
}

Related

  1. swap(StringBuffer s, int i, int j)
  2. swap(T a, T b)
  3. swap(T... args)
  4. swap16(final int aValue)
  5. swap16(short rgb)
  6. swapAddresses(T o1, T o2)
  7. swapBits(byte in)
  8. swapBits(int b, int i, int j)
  9. swapByte(byte b)