codecamp

Pillow ImageCms.isIntentSupported

PIL.ImageCms.isIntentSupported(profileintentdirection)

(Pycms)检查是否支持给定的意图。

使用此功能可以验证您是否可以使用所需 intentprofile,并且profile可以根据需要将其用于输入/输出/校样配置文件。

有些配置文件是专门为一个“方向”创建的,不能用于其他方向。某些配置文件只能用于某些渲染意图,因此最好在尝试使用它们创建变换之前验证这一点(使用此函数),或者捕捉PyCMSError如果它们不支持您选择的模式将发生的可能性。

参数
  • profile -- 有效的CmsProfile对象或ICC配置文件的文件名字符串。

  • intent -- 整数 (0-3) 指定您希望与此配置文件一起使用的渲染意图

    ImageCms.INTENT_PERCEPTUAL = 0(默认)

     ImageCms.INTENT_RELATIVE_COLORIMETRIC = 1 

    ImageCms.INTENT_SATURATION = 2 

    ImageCms.INTENT_ABSOLUTE_COLORIMETRIC = 3

  • direction -- 指定配置文件是否用于输入、输出或证明的整数

    INPUT = 0(或使用 ImageCms.DIRECTION_INPUT) 

    OUTPUT = 1(或使用 ImageCms.DIRECTION_OUTPUT) 

    PROOF = 2(或使用 ImageCms.DIRECTION_PROOF)

​​​

返回
   如果支持意图/方向,则为 1,如果不支持,则为 -1。
引发

PyCMSError ​-


Pillow ImageCms.get_display_profile
Pillow ImageCms.profileToProfile
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

Pillow 参考

Pillow ImageChops模块

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }