饱和范围是多少 [英] what is the saturation range

查看:176
本文介绍了饱和范围是多少的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
在HSl中,饱和度值为float,范围在0到1之间
饱和度取整数值的范围是多少,这个范围是多少?

hi all
in HSl the saturtion value is float and its range between 0 and 1
is there range of saturation take int numbers and what is this range?
how can i convert from int value to double value?

推荐答案

我的第一个反应是:为什么不简单地使用0到1之间的浮点数?

但是,如果您想使用整数,则可以轻松地做到这一点.您只需要为您使用的范围设置一个上限和下限.让我们将范围从0到255.将其转换为有效的饱和度只需将值除以255.(别忘了检查零值)

祝你好运!
My first reaction would be: Why not simply use a float between 0 and 1?

But if you want to work with integers you can easily do so. You just need to set an upper and lower bound for the range you use. Let''s take a range of 0 to 255. Converting it to a valid saturation would be simply dividing the value by 255. (don''t forget to check for zero values)

Good luck!


这篇关于饱和范围是多少的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆