pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

      <small id='1l1lf'></small><noframes id='1l1lf'>

      <i id='1l1lf'><tr id='1l1lf'><dt id='1l1lf'><q id='1l1lf'><span id='1l1lf'><b id='1l1lf'><form id='1l1lf'><ins id='1l1lf'></ins><ul id='1l1lf'></ul><sub id='1l1lf'></sub></form><legend id='1l1lf'></legend><bdo id='1l1lf'><pre id='1l1lf'><center id='1l1lf'></center></pre></bdo></b><th id='1l1lf'></th></span></q></dt></tr></i><div class="oz8ky5e" id='1l1lf'><tfoot id='1l1lf'></tfoot><dl id='1l1lf'><fieldset id='1l1lf'></fieldset></dl></div>
      <tfoot id='1l1lf'></tfoot>

      • <bdo id='1l1lf'></bdo><ul id='1l1lf'></ul>
      <legend id='1l1lf'><style id='1l1lf'><dir id='1l1lf'><q id='1l1lf'></q></dir></style></legend>

        Core Image CIColorControls 亮度濾鏡會產生錯誤的效果

        Core Image CIColorControls brightness filter creates wrong effect. How do I change my image#39;s luminance?(Core Image CIColorControls 亮度濾鏡會產生錯誤的效果.如何更改圖像的亮度?) - IT屋-程序員軟件開發技術分享

            <tbody id='CdAn0'></tbody>

            <legend id='CdAn0'><style id='CdAn0'><dir id='CdAn0'><q id='CdAn0'></q></dir></style></legend>

              <bdo id='CdAn0'></bdo><ul id='CdAn0'></ul>

              <small id='CdAn0'></small><noframes id='CdAn0'>

                <i id='CdAn0'><tr id='CdAn0'><dt id='CdAn0'><q id='CdAn0'><span id='CdAn0'><b id='CdAn0'><form id='CdAn0'><ins id='CdAn0'></ins><ul id='CdAn0'></ul><sub id='CdAn0'></sub></form><legend id='CdAn0'></legend><bdo id='CdAn0'><pre id='CdAn0'><center id='CdAn0'></center></pre></bdo></b><th id='CdAn0'></th></span></q></dt></tr></i><div class="85w0htd" id='CdAn0'><tfoot id='CdAn0'></tfoot><dl id='CdAn0'><fieldset id='CdAn0'></fieldset></dl></div>
                <tfoot id='CdAn0'></tfoot>
                  本文介紹了Core Image CIColorControls 亮度濾鏡會產生錯誤的效果.如何更改圖像的亮度?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我正在為 iOS 創建一個顏色選擇器.我想讓用戶選擇亮度(亮度)并讓色輪反映這種變化.我正在使用 Core Image 通過 CIColorControls 過濾器修改亮度.這是我的代碼:

                  I'm creating a color picker for iOS. I would like to enable the user to select the brightness (luminance) and have the color wheel reflect this change. I'm using Core Image to modify the brightness with the CIColorControls filter. Here's my code:

                  -(CIImage *)oldPhoto:(CIImage *)img withBrightness:(float)intensity
                  {
                      CIFilter *lighten = [CIFilter filterWithName:@"CIColorControls"];
                      [lighten setValue:img forKey:kCIInputImageKey];
                      [lighten setValue:@((intensity * 2.0) - 1.0) forKey:@"inputBrightness"];
                      return lighten.outputImage;
                  }
                  

                  以下是強度 = 0.5 (inputBrightness = 0) 時色輪的外觀:

                  Here's how the color wheel looks with intensity = 0.5 (inputBrightness = 0):

                  問題是當強度

                  時色輪看起來不對.0.5.例如,以下是強度 = 0.3 (inputBrightness = -0.4) 時的樣子:

                  The problem is that the color wheel looks wrong when intensity < 0.5. For example, here's how it looks with intensity = 0.3 (inputBrightness = -0.4):

                  請注意,中間有一個黑色圓圈,圖像的其余部分也沒有正確變暗.這應該是一個HSL色輪,所以我想我真正想要改變的是亮度,而不是亮度.

                  Notice that there's a black circle in the middle, and the rest of the image hasn't been darkened correctly either. This is supposed to be an HSL color wheel, so I guess that what I actually want to change is the luminance, not the brightness.

                  首先,誰能解釋一下為什么圖片看起來像這樣?我不是色彩專家.奇怪的是,圓的中心很快就變黑了,而它的邊緣卻沒有變暗很多.

                  First, can anyone explain why the image looks like this? I'm not an expert on color; it seems odd that the center of the circle quickly clips to black while the edges of it don't darken much.

                  二、怎樣才能達到我想要的效果?

                  Second, how can I achieve the effect I want?

                  這就是我真正想要的圖像外觀:

                  Here's how I actually WANT the image to look:

                  這是使用自定義 HSL 函數和亮度 = 0.3 創建的.這在 CPU 上運行,所以它對我的需要來說太慢了.我很樂意發布此 HSL 函數的代碼,但我沒有包含它,因為它似乎沒有立即相關.想看就問吧.

                  This was created with a custom HSL function and luminance = 0.3. This runs on the CPU, so it's far too slow for my needs. I'd be happy to post the code for this HSL function, but I didn't include it because it didn't seem immediately relevant. If you want to see it, just ask.

                  如果您有任何問題,或者有任何不清楚的地方,請告訴我.謝謝!

                  Please let me know if you have any questions, or if anything seems unclear. Thanks!

                  推薦答案

                  我還發現CIColorControlskCIInputBrightnessKey的非線性很煩人.我采用了線性 CIToneCurve:

                  I also found the non-linearity of the kCIInputBrightnessKey of CIColorControls to be annoying. I employed a linear CIToneCurve:

                  /** Change luminosity of `CIImage`
                  
                   @param inputImage The `CIImage` of the image to have it's luminosity changed.
                   @param luminosity The percent change of the luminosity, ranging from -1.0 to 1.0.
                  
                   @return `CIImage` of image with luminosity changed. If luminosity of 0.0 used, original `inputImage` is returned.
                   */
                  
                  - (CIImage *)changeLuminosityOfCIImage:(CIImage *)inputImage luminosity:(CGFloat)luminosity
                  {
                      if (luminosity == 0)
                          return inputImage;
                  
                      NSParameterAssert(luminosity >= -1.0 && luminosity <= 1.0);
                  
                      CIFilter *toneCurveFilter = [CIFilter filterWithName:@"CIToneCurve"];
                      [toneCurveFilter setDefaults];
                      [toneCurveFilter setValue:inputImage forKey:kCIInputImageKey];
                  
                      if (luminosity > 0)
                      {
                          [toneCurveFilter setValue:[CIVector vectorWithX:0.0  Y:luminosity]                           forKey:@"inputPoint0"];
                          [toneCurveFilter setValue:[CIVector vectorWithX:0.25 Y:luminosity + 0.25 * (1 - luminosity)] forKey:@"inputPoint1"];
                          [toneCurveFilter setValue:[CIVector vectorWithX:0.50 Y:luminosity + 0.50 * (1 - luminosity)] forKey:@"inputPoint2"];
                          [toneCurveFilter setValue:[CIVector vectorWithX:0.75 Y:luminosity + 0.75 * (1 - luminosity)] forKey:@"inputPoint3"];
                          [toneCurveFilter setValue:[CIVector vectorWithX:1.0  Y:1.0]                                  forKey:@"inputPoint4"];
                      }
                      else
                      {
                          [toneCurveFilter setValue:[CIVector vectorWithX:0.0  Y:0.0]                     forKey:@"inputPoint0"];
                          [toneCurveFilter setValue:[CIVector vectorWithX:0.25 Y:0.25 * (1 + luminosity)] forKey:@"inputPoint1"];
                          [toneCurveFilter setValue:[CIVector vectorWithX:0.50 Y:0.50 * (1 + luminosity)] forKey:@"inputPoint2"];
                          [toneCurveFilter setValue:[CIVector vectorWithX:0.75 Y:0.75 * (1 + luminosity)] forKey:@"inputPoint3"];
                          [toneCurveFilter setValue:[CIVector vectorWithX:1.0  Y:1 + luminosity]          forKey:@"inputPoint4"];
                      }
                  
                      return [toneCurveFilter outputImage];
                  }
                  

                  這是您的圖像,使用上述例程將亮度降低 30%:

                  Here is your image, reducing the luminosity by 30% using the above routine:

                  可以使用 CIToneCurve 來完成.無論它是否比您的例行程序更快,您都會對其進行基準測試.

                  It can be done with CIToneCurve. Whether it's faster than your routine, you'll have benchmark it.

                  這篇關于Core Image CIColorControls 亮度濾鏡會產生錯誤的效果.如何更改圖像的亮度?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How to animate a UIImageview to display fullscreen by tapping on it?(如何通過點擊動畫 UIImageview 以顯示全屏?)
                  To stop segue and show alert(停止 segue 并顯示警報)
                  iOS 5 storyboard, programmatically determine path(iOS 5 故事板,以編程方式確定路徑)
                  Icon already includes gloss effects(圖標已經包含光澤效果)
                  How does UIEdgeInsetsMake work?(UIEdgeInsetsMake 是如何工作的?)
                  UIProgressView and Custom Track and Progress Images (iOS 5 properties)(UIProgressView 和自定義跟蹤和進度圖像(iOS 5 屬性))

                  <small id='OhbzK'></small><noframes id='OhbzK'>

                  <i id='OhbzK'><tr id='OhbzK'><dt id='OhbzK'><q id='OhbzK'><span id='OhbzK'><b id='OhbzK'><form id='OhbzK'><ins id='OhbzK'></ins><ul id='OhbzK'></ul><sub id='OhbzK'></sub></form><legend id='OhbzK'></legend><bdo id='OhbzK'><pre id='OhbzK'><center id='OhbzK'></center></pre></bdo></b><th id='OhbzK'></th></span></q></dt></tr></i><div class="80ogqlr" id='OhbzK'><tfoot id='OhbzK'></tfoot><dl id='OhbzK'><fieldset id='OhbzK'></fieldset></dl></div>

                      • <bdo id='OhbzK'></bdo><ul id='OhbzK'></ul>
                        <legend id='OhbzK'><style id='OhbzK'><dir id='OhbzK'><q id='OhbzK'></q></dir></style></legend>

                            <tbody id='OhbzK'></tbody>
                          <tfoot id='OhbzK'></tfoot>

                          • 主站蜘蛛池模板: 沈阳网站建设_沈阳网站制作_沈阳网页设计-做网站就找示剑新零售 沈阳缠绕膜价格_沈阳拉伸膜厂家_沈阳缠绕膜厂家直销 | 北京西风东韵品牌与包装设计公司,创造视觉销售力! | 游泳池设计|设备|配件|药品|吸污机-东莞市太平洋康体设施有限公司 | 深圳活动策划公司|庆典策划|专业公关活动策划|深圳艺典文化传媒 重庆中专|职高|技校招生-重庆中专招生网 | 十字轴_十字轴万向节_十字轴总成-南京万传机械有限公司 | PU树脂_水性聚氨酯树脂_聚氨酯固化剂_聚氨酯树脂厂家_宝景化工 | 上海盐水喷雾试验机_两厢式冷热冲击试验箱-巨怡环试 | 广西正涛环保工程有限公司【官网】| 高防护蠕动泵-多通道灌装系统-高防护蠕动泵-www.bjhuiyufluid.com慧宇伟业(北京)流体设备有限公司 | 烟气换热器_GGH烟气换热器_空气预热器_高温气气换热器-青岛康景辉 | 杭州实验室尾气处理_实验台_实验室家具_杭州秋叶实验设备有限公司 | 培训无忧网-教育培训咨询招生第三方平台| 拖链电缆_柔性电缆_伺服电缆_坦克链电缆-深圳市顺电工业电缆有限公司 | 杭州高温泵_热水泵_高温油泵|昆山奥兰克泵业制造有限公司 | 巨野电机维修-水泵维修-巨野县飞宇机电维修有限公司 | 收录网| 北京律师事务所_房屋拆迁律师_24小时免费法律咨询_云合专业律师网 | 合肥礼品公司-合肥礼品定制-商务礼品定制公司-安徽柏榽商贸有限公司 | 电缆故障测试仪_电缆故障定位仪_探测仪_检测仪器_陕西意联电气厂家 | 体视显微镜_荧光生物显微镜_显微镜报价-微仪光电生命科学显微镜有限公司 | 京马网,京马建站,网站定制,营销型网站建设,东莞建站,东莞网站建设-首页-京马网 | (中山|佛山|江门)环氧地坪漆,停车场地板漆,车库地板漆,聚氨酯地板漆-中山永旺地坪漆厂家 | 厂房出租_厂房出售_产业园区招商_工业地产&nbsp;-&nbsp;中工招商网 | 优秀的临床医学知识库,临床知识库,医疗知识库,满足电子病历四级要求,免费试用 | 乐之康护 - 专业护工服务平台,提供医院陪护-居家照护-居家康复 | 南京交通事故律师-专打交通事故的南京律师 | 等离子表面处理机-等离子表面活化机-真空等离子清洗机-深圳市东信高科自动化设备有限公司 | 杭州中策电线|中策电缆|中策电线|杭州中策电缆|杭州中策电缆永通集团有限公司 | 炒货机-炒菜机-炒酱机-炒米机@霍氏机械| 水平筛厂家-三轴椭圆水平振动筛-泥沙震动筛设备_山东奥凯诺矿机 包装设计公司,产品包装设计|包装制作,包装盒定制厂家-汇包装【官方网站】 | 河南空气能热水器-洛阳空气能采暖-洛阳太阳能热水工程-洛阳润达高科空气能商行 | 北京晚会活动策划|北京节目录制后期剪辑|北京演播厅出租租赁-北京龙视星光文化传媒有限公司 | 整合营销推广|营销网络推广公司|石家庄网站优化推广公司|智营销 好物生环保网、环保论坛 - 环保人的学习交流平台 | 水冷式工业冷水机组_风冷式工业冷水机_水冷螺杆冷冻机组-深圳市普威机械设备有限公司 | 小型铜米机-干式铜米机-杂线全自动铜米机-河南鑫世昌机械制造有限公司 | 制冷采购电子商务平台——制冷大市场 | 济南办公室装修-厂房装修-商铺装修-工装公司-山东鲁工装饰设计 | 上海盐水喷雾试验机_两厢式冷热冲击试验箱-巨怡环试 | 全温恒温摇床-水浴气浴恒温摇床-光照恒温培养摇床-常州金坛精达仪器制造有限公司 | 置顶式搅拌器-优莱博化学防爆冰箱-磁驱搅拌器-天津市布鲁克科技有限公司 | 天津市能谱科技有限公司-专业的红外光谱仪_红外测油仪_紫外测油仪_红外制样附件_傅里叶红外光谱技术生产服务厂商 |