移位运算RGB
来源:互联网 发布:易观大数据峰会 编辑:程序博客网 时间:2024/06/05 16:02
package com.xiuye.homework;public class demo26 {public static void main(String[] args) {int r = 255;int g = 99;int b = 49;outRGB(r,g,b);System.out.println("===========================");r = 0xff;g = 0xff;b = 0xff;outRGB(r,g,b);System.out.println("===========================");r = 0x01;g = 0x01;b = 0x01;outRGB(r,g,b);System.out.println("========================");outRGBOptimization(r,g,b);}public static void outRGB(int r,int g,int b){/** * 0x00 ff ff ff * alpha red green blue */r &= 0xff;g &= 0xff;b &= 0xff;int rgb = (r<<16)+(g<<8)+b;System.out.println(rgb);System.out.println(Integer.toBinaryString(rgb));}public static void outRGBOptimization(int r,int g,int b){/** * 0x00 ff ff ff * alpha red green blue */r &= 0xff;g &= 0xff;b &= 0xff;int rgb = (r<<16)|(g<<8)|b;System.out.println(rgb);System.out.println(Integer.toBinaryString(rgb));}}
0 0
- 移位运算RGB
- JAVA移位运算,INT类型颜色到RGB转换
- 移位运算
- 移位运算
- 移位运算
- 移位运算
- 移位运算
- 移位运算
- 移位运算
- 移位运算
- 移位运算
- 移位运算
- 移位运算
- 移位运算:>> << >>>
- 移位运算
- 移位运算
- 移位运算
- 移位运算
- Linux内核module_param的使用
- vc++ DLL开发小结
- Uva-548-Tree(二叉树与stream与dfs)
- 堆排序
- 抽象类、密封类及类成员(C#)
- 移位运算RGB
- Google 开源技术protobuf
- STL源码剖析 [容器](十)[Binary search tree]
- LeakCanary 中文使用说明
- 魔术索引I
- ubuntu12.04如何删除ppa源
- win7启动telnet远程服务
- 第53讲:Scala中结构类型实战详解学习笔记
- mysql客户端工具