Java RGB Color Convert To rgb8ToRgbRBXG(byte[] rgb)

Here you can find the source of rgb8ToRgbRBXG(byte[] rgb)

Description

rgb To Rgb RBXG

License

Open Source License

Parameter

Parameter Description
bs a parameter

Declaration

public static short rgb8ToRgbRBXG(byte[] rgb) 

Method Source Code

//package com.java2s;
/*/*  w  w w . j ava2s . c  om*/
  V99ColorMapUtils.java
    
  (c) 2012 Edward Swartz
    
  All rights reserved. This program and the accompanying materials
  are made available under the terms of the Eclipse Public License v1.0
  which accompanies this distribution, and is available at
  http://www.eclipse.org/legal/epl-v10.html
 */

public class Main {
    /**
     * @param bs
     * @return
     */
    public static short rgb8ToRgbRBXG(byte[] rgb) {
        return (short) ((((rgb[0] >> 5) & 0x7) << 12) | (((rgb[2] >> 5) & 0x7) << 8)
                | (((rgb[1] >> 5) & 0x7) << 0));
    }
}

Related

  1. RGB2YCbCr(int r, int g, int b, boolean useBT601)
  2. RGB2YCbCr(int[] rgb, float[][] Y, float[][] Cb, float[][] Cr, int imageWidth, int imageHeight)
  3. rgb2yuv(float r, float g, float b, float[] yuv)
  4. rgb565ToRGB(short pixel, byte[] rgb)
  5. rgb8ToPixel(byte[] nrgb)
  6. rgbaToColor(int r, int g, int b, int a)
  7. rgbaToHex(String color)
  8. RGBAtoI(byte r, byte g, byte b, byte a)
  9. rgbBitfieldToString(int rgb)