由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
ComputerGraphics版 - 请教一个IndexColorModel的问题
相关主题
问个GDI+的问题。。一道很奇怪的面试题
问一道题目Java2D ComponentColorModel question
真心请教A家verbal offer问题Java drawImage help please. Urgent!
讨论:这个题怎么解Graphics question
HashTable space complexity?Net Neutrality 是个宗教
how to calculate binary in java?几道微软面试题
convert array to blob请教:string pattern match 题
一个fortran问题:分享一道电面题,兼下午Onsite攒人品求祝福
相关话题的讨论汇总
话题: byte话题: 256话题: new
进入ComputerGraphics版参与讨论
1 (共1页)
C********g
发帖数: 1548
1
我有一段Java程序,如下。我想请问,对于rgb,为什么不用单个数值,而是用一个256
长度的数组?
static IndexColorModel getLUTColorModel( )
{
byte[] r = new byte[ 256 ];
byte[] g = new byte[ 256 ];
byte[] b = new byte[ 256 ];
// fill in the r,g, and b arrays with a ramp or 0
for ( int i = 0; i < 256 ; i++ ){
r[i] = (byte) i;
g[i] = (byte) i;
b[i] = (byte) i;
}
return new IndexColorModel( 8, 256, r, g, b );
}
A***l
发帖数: 461
2
查一下RBG配色表,这个是标准定义,色阶。

256

【在 C********g 的大作中提到】
: 我有一段Java程序,如下。我想请问,对于rgb,为什么不用单个数值,而是用一个256
: 长度的数组?
: static IndexColorModel getLUTColorModel( )
: {
: byte[] r = new byte[ 256 ];
: byte[] g = new byte[ 256 ];
: byte[] b = new byte[ 256 ];
: // fill in the r,g, and b arrays with a ramp or 0
: for ( int i = 0; i < 256 ; i++ ){
: r[i] = (byte) i;

1 (共1页)
进入ComputerGraphics版参与讨论
相关主题
分享一道电面题,兼下午Onsite攒人品求祝福HashTable space complexity?
GF面经how to calculate binary in java?
讨论一下FB的经典题read和readline吧convert array to blob
这个G题是DFS还是DP一个fortran问题:
问个GDI+的问题。。一道很奇怪的面试题
问一道题目Java2D ComponentColorModel question
真心请教A家verbal offer问题Java drawImage help please. Urgent!
讨论:这个题怎么解Graphics question
相关话题的讨论汇总
话题: byte话题: 256话题: new