Package com.mattibal.meshnet.utils.color

Examples of com.mattibal.meshnet.utils.color.LightSource


   
    HashMap<LightSource, Double> map = colorCalc.getSourceLumiForColor(color);
    Set<Entry<LightSource, Double>> entries = map.entrySet();
    int r=0, g=0, b=0, a=0, w=0;
    for(Entry<LightSource, Double> entry : entries){
      LightSource source = entry.getKey();
      double lumi = entry.getValue();
      int pwm = source.getPwmValue(lumi, 255);
      if(source==red){
        r = pwm;
      } else if(source==green){
        g = pwm;
      } else if(source==blue){
View Full Code Here


   
    // Create the LightSource object, one for each led type
   
    // LedEngin LZ9-K0WW00-0030 White LED - 2,1 Ampere total
    // http://www.ledengin.com/files/products/LZ9/LZ9-00WW00.pdf
    white = new LightSource(0.434, 0.403, 1350 / 2); // TODO this is for 700 mA!!
   
    // LedEngin LZ4-20MA00-0000 RGBA LED - 700 mA for each LED
    // http://www.ledengin.com/files/products/LZ4/LZ4-00MA00.pdf
    // Chromaticity data taken from:
    // http://www.nichia.co.jp/en/product/led_color.html
    red = new LightSource(0.68, 0.3, 100 * 4);   // 4 LEDs
    green = new LightSource(0.18, 0.7, 160 * 4); // 4 LEDs
    blue = new LightSource(0.13, 0.06, 30 * 4)// 4 LEDs
    amber = new LightSource(0.57, 0.43, 90 * 2); // 2 LEDs
   
    // Sources in order of decrescent priority
    LightSource[] sources = {
      white, green, red, blue, amber
    };
View Full Code Here

TOP

Related Classes of com.mattibal.meshnet.utils.color.LightSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.