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:
509 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 | public class ColorMappingLineaire extends ColorMapping { |
---|
8 | |
---|
9 | public ColorMappingLineaire() { |
---|
10 | |
---|
11 | } |
---|
12 | |
---|
13 | public Color getCouleur(float valeur) { |
---|
14 | if (valeur == 0) |
---|
15 | return new Color(0,0,0); |
---|
16 | Float f = new Float((valeur-table_couleur.getMin())/(table_couleur.getMax()-table_couleur.getMin())); |
---|
17 | f = f*table_couleur.getLength(); |
---|
18 | |
---|
19 | return table_couleur.getColor(f.intValue()); |
---|
20 | } |
---|
21 | |
---|
22 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.