[翻译] CRPixellatedView-用CIPixellate滤镜动态渲染UIView
动态 渲染 翻译 滤镜 uiview
2023-09-14 08:57:17 时间
CRPixellatedView-用CIPixellate滤镜动态渲染UIView
https://github.com/chroman/CRPixellatedView
本人测试的效果:
Usage
To use CRPixellatedView, create a CRPixellatedView, configure and animate!
要使用CRPixellatedView的话,创建一个CRPixellatedView,配置以及做动画!
An example of making a CRPixellatedView:
以下是一个使用CRPixellatedView的例子:
CRPixellatedView *pixellatedView = [[CRPixellatedView alloc] initWithFrame:CGRectMake(0, 0, 320, 320)]; pixellatedView.image = [UIImage imageNamed:@"Image"]; [self.view addSubview:pixellatedView]; // Add to your view [pixellatedView animate];
You can configure this settings, customizable example:
以下是配置设置,自定义的例子:
CRPixellatedView *pixellatedView = [[CRPixellatedView alloc] initWithFrame:CGRectMake(0, 0, 320, 320)]; pixellatedView.image = [UIImage imageNamed:@"Image"]; pixellatedView.pixelScale = 20.0f; pixellatedView.animationDuration = 0.8f; [self.view addSubview:pixellatedView]; // Add to your view [pixellatedView animateWithCompletion:^(BOOL finished) { NSLog(@"completed");
Also, you can customize the animation effect using the reverse property:
以下是你使用反转效果的例子:
CRPixellatedView *pixellatedView = [[CRPixellatedView alloc] initWithFrame:CGRectMake(0, 0, 320, 320)]; pixellatedView.image = [UIImage imageNamed:@"Image"]; pixellatedView.pixelScale = 20.0f; pixellatedView.animationDuration = 0.8f; pixellatedView.reverse = YES; // Reverse effect [self.view addSubview:pixellatedView]; // Add to your view [pixellatedView animateWithCompletion:^(BOOL finished) { NSLog(@"completed");
Examples
pixellatedView.reverse = YES; // Reverse effect
pixellatedView.reverse = NO; // (default) pixellatedView.pixelScale = 30.0f;
核心的地方:
使用了3个CoreImage的滤镜用来重绘View:)
将 WebGL 动画作为背景 大家好我是FLy哥,又到了周末了, 这次分享的文章不是很长,如果你正在或者将来会涉及到你的博客,就是如何在正常的网页中加入酷炫的3D效果: webgl 动画 上面的3D动画 其实就是整个网页的背景,然后你的html 页面 还是正常写的,互不干涉,其实还就是一个字, 让自己的页面看着更加花里胡哨的 我们看看如何解决吧??? 有 2 种方法: 将画布的 CSS 属性 position 设置成 fixed #canvas { position: fixed; left: 0; top: 0; z-index: -1; ...} 并将 z-index 设置成 -
OpenGL图像渲染以及渲染问题解决方案 在绘制3D场景的时候,我们需要决定哪些部分是对观察者可见的,或者哪些部分是对观察者不可见的,对于不可见的部分,应该及早丢弃。例如在一个不透明的墙壁后,就不应该有渲染,这种情况叫做隐藏面消除(Hidden surface elimination).
【Unity3D Shader】学习笔记-图片滤镜① 效果和上面的比较相似,Photoshop CS图像黑白调整功能的计算公式为: gray= (max - mid) * ratio_max + (mid - min) * ratio_max_mid + min 公式中:gray为像素灰度值,max、mid和min分别为图像像素R、G、B分量颜色的最大值、中间值和最小值,ratio_max为max所代表的分量颜色(单色)比率,ratio_max_mid则为max与mid两种分量颜色所形成的复色比率。 默认的单色及复色比率为:
一种动画框架Lottie的解析(一)—— 基本介绍(一)一种动画框架Lottie的解析(二)—— 基本介绍(二)一种动画框架Lottie的解析(三)—— 框架结构
相关文章
- DLL动态库多次加载问题
- ASP.NET Core WebApi如何动态生成树形Json格式数据
- Java实现 蓝桥杯 算法训练 动态数组使用
- 跟我学SpringCloud | 第十七篇:服务网关Zuul基于Apollo动态路由
- MySQL · 捉虫动态 · 删除索引导致表无法打开
- 【 【henuacm2016级暑期训练】动态规划专题 K】 Really Big Numbers
- element table表格表头动态渲染效果demo(整理)
- 记一次echarts作死经历:echarts 动态 赋值成功。却不渲染不显示?value 不能是百分比!!!
- android 10.0 两个laucher动态相互切换(退出一个launcher到另外一个launcher桌面 )(RK 展讯 MTK等平台都适用)
- 【Android 逆向】类加载器 ClassLoader ( 使用 DexClassLoader 动态加载字节码文件 | 准备 DEX 字节码文件 )
- 动态规划0—1背包问题
- tensorflow 动态数组 TensorArray
- 类图用来表示系统中类和类与类之间的关系,它是对系统动态结构的描述。(选择1项)
- 基于bootstrap动态分页
- 22. PE结构-PE详解之输入表(导入表)、屠龙刀W32Dasm(静态)、LordPE(动态)工具入门(查找dll、调用函数)
- 动态多态与静态多态
- 基于扩展卡尔曼滤波的自适应智能无人车辆行驶matlab仿真,输出三维动态行驶动画
- 一文解析动态规划中的背包问题