Last change
on this file since 68 was
68,
checked in by cbipsl, 14 years ago
|
commit v1 eccad
|
-
Property svn:executable set to
*
|
File size:
737 bytes
|
Line | |
---|
1 | package org.medias.eccad.metier.generationRaster.colorMap; |
---|
2 | |
---|
3 | import java.awt.Color; |
---|
4 | |
---|
5 | import org.medias.eccad.modele.ColorTab; |
---|
6 | |
---|
7 | |
---|
8 | |
---|
9 | public class ColorMappingJaune extends ColorMapping { |
---|
10 | private Color tab_couleur[]; |
---|
11 | |
---|
12 | |
---|
13 | public ColorMappingJaune() { |
---|
14 | tab_couleur = new Color[256]; |
---|
15 | |
---|
16 | // jaune -> rouge |
---|
17 | |
---|
18 | for (int i=0; i<256; i++) { |
---|
19 | tab_couleur[i] = new Color(255, 255-i, 0); |
---|
20 | } |
---|
21 | |
---|
22 | tab_couleur[0] = new Color(255, 255, 255); |
---|
23 | } |
---|
24 | |
---|
25 | public Color getCouleur(float valeur) { |
---|
26 | Float index = new Float(((valeur-0)/(100-0))*254); |
---|
27 | if (index <0 || index >255) |
---|
28 | return new Color(255, 255, 255); |
---|
29 | |
---|
30 | return tab_couleur[index.intValue()]; |
---|
31 | } |
---|
32 | |
---|
33 | public void setColorTable(ColorTab colortab) { |
---|
34 | // TODO Auto-generated method stub |
---|
35 | |
---|
36 | } |
---|
37 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.