• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java LxProtocolLight类的典型用法和代码示例

java 3次浏览

本文整理汇总了Java中lifx.java.android.entities.internal.structle.LxProtocolLight的典型用法代码示例。如果您正苦于以下问题:Java LxProtocolLight类的具体用法?Java LxProtocolLight怎么用?Java LxProtocolLight使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

LxProtocolLight类属于lifx.java.android.entities.internal.structle包,在下文中一共展示了LxProtocolLight类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getLXProtocolLightHsbkFromLFXHSBKColor

点赞 3

import lifx.java.android.entities.internal.structle.LxProtocolLight; //导入依赖的package包/类
public static LxProtocolLight.Hsbk getLXProtocolLightHsbkFromLFXHSBKColor(LFXHSBKColor color) {
    int hue = (int) (color.getHue() / 360.0 * (float) UInt16.MAX_U16_VALUE);
    int saturation = (int) (color.getSaturation() * (float) UInt16.MAX_U16_VALUE);
    int brightness = (int) (color.getBrightness() * (float) UInt16.MAX_U16_VALUE);
    int kelvin = color.getKelvin();

    UInt16 wrappedHue = new UInt16(hue);
    UInt16 wrappedSaturation = new UInt16(saturation);
    UInt16 wrappedBrightness = new UInt16(brightness);
    UInt16 wrappedKelvin = new UInt16(kelvin);

    Object padding = new Object();

    LxProtocolLight.Hsbk lightHSBK = new LxProtocolLight.Hsbk(padding, wrappedHue, wrappedSaturation, wrappedBrightness, wrappedKelvin);

    return lightHSBK;
}
 

开发者ID:getsenic,
项目名称:lifx-sdk-android,
代码行数:18,
代码来源:LFXBinaryTypes.java

示例2: getLXProtocolLightHsbkFromLFXHSBKColor

点赞 3

import lifx.java.android.entities.internal.structle.LxProtocolLight; //导入依赖的package包/类
public static LxProtocolLight.Hsbk getLXProtocolLightHsbkFromLFXHSBKColor( LFXHSBKColor color)
{
	int hue = (int)( color.getHue() / 360.0 * (float) UInt16.MAX_U16_VALUE);
	int saturation = (int)( color.getSaturation() * (float) UInt16.MAX_U16_VALUE);
	int brightness = (int)( color.getBrightness() * (float) UInt16.MAX_U16_VALUE);
	int kelvin = color.getKelvin();
	
	UInt16 wrappedHue = new UInt16( hue);
	UInt16 wrappedSaturation = new UInt16( saturation);
	UInt16 wrappedBrightness = new UInt16( brightness);
	UInt16 wrappedKelvin = new UInt16( kelvin);
	
	Object padding = new Object();
	
	LxProtocolLight.Hsbk lightHSBK = new LxProtocolLight.Hsbk( padding, wrappedHue, wrappedSaturation, wrappedBrightness, wrappedKelvin);
	
	return lightHSBK;
}
 

开发者ID:jmcgill,
项目名称:lifx-alarm,
代码行数:19,
代码来源:LFXBinaryTypes.java

示例3: setColorOverDuration

点赞 2

import lifx.java.android.entities.internal.structle.LxProtocolLight; //导入依赖的package包/类
public void setColorOverDuration(LFXHSBKColor color, long duration) {
    LFXMessage lightSet = LFXMessage.messageWithTypeAndTarget(Type.LX_PROTOCOL_LIGHT_SET, getTarget());
    Object padding = new Object();
    UInt8 stream = new UInt8(0);
    Hsbk protocolColor = LFXBinaryTypes.getLXProtocolLightHsbkFromLFXHSBKColor(color);
    UInt32 protocolDuration = new UInt32(duration);
    LxProtocolLight.Set payload = new LxProtocolLight.Set(padding, stream, protocolColor, protocolDuration);
    lightSet.setPayload(payload);
    networkContext.sendMessage(lightSet);
}
 

开发者ID:getsenic,
项目名称:lifx-sdk-android,
代码行数:11,
代码来源:LFXAllLightsCollection.java

示例4: setColorOverDuration

点赞 2

import lifx.java.android.entities.internal.structle.LxProtocolLight; //导入依赖的package包/类
public void setColorOverDuration(LFXHSBKColor color, long duration) {
    super.setColorOverDuration(color, duration);
    LFXMessage lightSet = LFXMessage.messageWithTypeAndTarget(Type.LX_PROTOCOL_LIGHT_SET, getTarget());
    Object padding = new Object();
    UInt8 stream = new UInt8(0);
    Hsbk protocolColor = LFXBinaryTypes.getLXProtocolLightHsbkFromLFXHSBKColor(color);
    UInt32 protocolDuration = new UInt32(duration);
    LxProtocolLight.Set payload = new LxProtocolLight.Set(padding, stream, protocolColor, protocolDuration);
    lightSet.setPayload(payload);
    networkContext.sendMessage(lightSet);
}
 

开发者ID:getsenic,
项目名称:lifx-sdk-android,
代码行数:12,
代码来源:LFXTaggedLightCollection.java

示例5: setColorOverDuration

点赞 2

import lifx.java.android.entities.internal.structle.LxProtocolLight; //导入依赖的package包/类
public void setColorOverDuration(@NonNull LFXHSBKColor color, long duration) {
    LFXMessage lightSet = LFXMessage.messageWithTypeAndTarget(Type.LX_PROTOCOL_LIGHT_SET, getTarget());
    Object padding = new Object();
    UInt8 stream = new UInt8(0);
    Hsbk protocolColor = LFXBinaryTypes.getLXProtocolLightHsbkFromLFXHSBKColor(color);
    UInt32 protocolDuration = new UInt32(duration);
    LxProtocolLight.Set payload = new LxProtocolLight.Set(padding, stream, protocolColor, protocolDuration);
    lightSet.setPayload(payload);
    networkContext.sendMessage(lightSet);
}
 

开发者ID:getsenic,
项目名称:lifx-sdk-android,
代码行数:11,
代码来源:LFXLight.java

示例6: getLFXHSBKColorFromLXProtocolLightHsbk

点赞 2

import lifx.java.android.entities.internal.structle.LxProtocolLight; //导入依赖的package包/类
public static LFXHSBKColor getLFXHSBKColorFromLXProtocolLightHsbk(LxProtocolLight.Hsbk protocolHsbk) {
    float hue = (float) protocolHsbk.getHue().getValue() * 360.0f / (float) UInt16.MAX_U16_VALUE;
    float saturation = (float) protocolHsbk.getSaturation().getValue() / (float) UInt16.MAX_U16_VALUE;
    float brightness = (float) protocolHsbk.getBrightness().getValue() / (float) UInt16.MAX_U16_VALUE;
    int kelvin = protocolHsbk.getKelvin().getValue();

    LFXHSBKColor color = LFXHSBKColor.getColor(hue, saturation, brightness, kelvin);

    return color;
}
 

开发者ID:getsenic,
项目名称:lifx-sdk-android,
代码行数:11,
代码来源:LFXBinaryTypes.java

示例7: setColorOverDuration

点赞 2

import lifx.java.android.entities.internal.structle.LxProtocolLight; //导入依赖的package包/类
public void setColorOverDuration( LFXHSBKColor color, long duration)
{
	LFXMessage lightSet = LFXMessage.messageWithTypeAndTarget( Type.LX_PROTOCOL_LIGHT_SET, getTarget());
	Object padding = new Object();
	UInt8 stream = new UInt8( 0);
	Hsbk protocolColor = LFXBinaryTypes.getLXProtocolLightHsbkFromLFXHSBKColor( color);
	UInt32 protocolDuration = new UInt32( duration);
	LxProtocolLight.Set payload = new LxProtocolLight.Set( padding, stream, protocolColor, protocolDuration);
	lightSet.setPayload( payload);
	networkContext.sendMessage( lightSet);
}
 

开发者ID:jmcgill,
项目名称:lifx-alarm,
代码行数:12,
代码来源:LFXAllLightsCollection.java

示例8: setColorOverDuration

点赞 2

import lifx.java.android.entities.internal.structle.LxProtocolLight; //导入依赖的package包/类
public void setColorOverDuration( LFXHSBKColor color, long duration)
{
	super.setColorOverDuration( color, duration);
	LFXMessage lightSet = LFXMessage.messageWithTypeAndTarget( Type.LX_PROTOCOL_LIGHT_SET, getTarget());
	Object padding = new Object();
	UInt8 stream = new UInt8( 0);
	Hsbk protocolColor = LFXBinaryTypes.getLXProtocolLightHsbkFromLFXHSBKColor( color);
	UInt32 protocolDuration = new UInt32( duration);
	LxProtocolLight.Set payload = new LxProtocolLight.Set( padding, stream, protocolColor, protocolDuration);
	lightSet.setPayload( payload);
	networkContext.sendMessage( lightSet);
}
 

开发者ID:jmcgill,
项目名称:lifx-alarm,
代码行数:13,
代码来源:LFXTaggedLightCollection.java

示例9: getLFXHSBKColorFromLXProtocolLightHsbk

点赞 2

import lifx.java.android.entities.internal.structle.LxProtocolLight; //导入依赖的package包/类
public static LFXHSBKColor getLFXHSBKColorFromLXProtocolLightHsbk( LxProtocolLight.Hsbk protocolHsbk)
{
	float hue = (float) protocolHsbk.getHue().getValue() * 360.0f / (float) UInt16.MAX_U16_VALUE;
	float saturation = (float) protocolHsbk.getSaturation().getValue() / (float) UInt16.MAX_U16_VALUE;
	float brightness = (float) protocolHsbk.getBrightness().getValue() / (float) UInt16.MAX_U16_VALUE;
	int kelvin = protocolHsbk.getKelvin().getValue();
	
	LFXHSBKColor color = LFXHSBKColor.getColor( hue, saturation, brightness, kelvin);
	
	return color;
}
 

开发者ID:jmcgill,
项目名称:lifx-alarm,
代码行数:12,
代码来源:LFXBinaryTypes.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)