日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

IOS – OPenGL ES 调节图像饱和度 GPUImageSaturationFilter

發(fā)布時間:2024/9/27 编程问答 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 IOS – OPenGL ES 调节图像饱和度 GPUImageSaturationFilter 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

目錄

  • 一.簡介
  • 二.效果演示
  • 三.源碼下載
  • 四.猜你喜歡

零基礎(chǔ) OpenGL (ES) 學習路線推薦 : OpenGL (ES) 學習目錄 >> OpenGL ES 基礎(chǔ)

零基礎(chǔ) OpenGL (ES) 學習路線推薦 : OpenGL (ES) 學習目錄 >> OpenGL ES 轉(zhuǎn)場

零基礎(chǔ) OpenGL (ES) 學習路線推薦 : OpenGL (ES) 學習目錄 >> OpenGL ES 特效

零基礎(chǔ) OpenGL (ES) 學習路線推薦 : OpenGL (ES) 學習目錄 >> OpenGL ES 函數(shù)

零基礎(chǔ) OpenGL (ES) 學習路線推薦 : OpenGL (ES) 學習目錄 >> OpenGL ES GPUImage 使用

零基礎(chǔ) OpenGL (ES) 學習路線推薦 : OpenGL (ES) 學習目錄 >> OpenGL ES GLSL 編程

一.簡介

GPUImage 共 125 個濾鏡, 分為四類

1、Color adjustments : 31 filters , 顏色處理相關(guān)
2、Image processing : 40 filters , 圖像處理相關(guān).
3、Blending modes : 29 filters , 混合模式相關(guān).
4、Visual effects : 25 filters , 視覺效果相關(guān).

GPUImageSaturationFilter 屬于 GPUImage 顏色處理相關(guān),用來處理圖片飽和度,shader 源碼如下:

/******************************************************************************************/ //@Author:猿說編程 //@Blog(個人博客地址): www.codersrc.com //@File:IOS – OPenGL ES 調(diào)節(jié)圖像飽和度 GPUImageSaturationFilter //@Time:2022/03/12 07:30 //@Motto:不積跬步無以至千里,不積小流無以成江海,程序人生的精彩需要堅持不懈地積累! /******************************************************************************************/#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE NSString *const kGPUImageSaturationFragmentShaderString = SHADER_STRING (varying highp vec2 textureCoordinate;uniform sampler2D inputImageTexture;uniform lowp float saturation;// Values from "Graphics Shaders: Theory and Practice" by Bailey and Cunninghamconst mediump vec3 luminanceWeighting = vec3(0.2125, 0.7154, 0.0721);void main(){lowp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate);lowp float luminance = dot(textureColor.rgb, luminanceWeighting);lowp vec3 greyScaleColor = vec3(luminance);gl_FragColor = vec4(mix(greyScaleColor, textureColor.rgb, saturation), textureColor.w);} ); #else NSString *const kGPUImageSaturationFragmentShaderString = SHADER_STRING (varying vec2 textureCoordinate;uniform sampler2D inputImageTexture;uniform float saturation;// Values from "Graphics Shaders: Theory and Practice" by Bailey and Cunninghamconst vec3 luminanceWeighting = vec3(0.2125, 0.7154, 0.0721);void main(){vec4 textureColor = texture2D(inputImageTexture, textureCoordinate);float luminance = dot(textureColor.rgb, luminanceWeighting);vec3 greyScaleColor = vec3(luminance);gl_FragColor = vec4(mix(greyScaleColor, textureColor.rgb, saturation), textureColor.w);}); #endif

二.效果演示

三.源碼下載

下載地址:IOS – OPenGL ES 調(diào)節(jié)圖像飽和度 GPUImageSaturationFilter

四.猜你喜歡

  • IOS – OPenGL ES 設置圖像亮度 GPUImageBrightnessFilter
  • IOS – OPenGL ES 調(diào)節(jié)圖像曝光度 GPUImageExposureFilter
  • IOS – OpenGL ES 調(diào)節(jié)圖像對比度 GPUImageContrastFilter
  • IOS – OPenGL ES 調(diào)節(jié)圖像飽和度 GPUImageSaturationFilter

總結(jié)

以上是生活随笔為你收集整理的IOS – OPenGL ES 调节图像饱和度 GPUImageSaturationFilter的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。