ASCII Cam
来源:互联网 发布:mac air windows10 编辑:程序博客网 时间:2024/05/02 16:19
ASCII Cam is an iOS application that turns a video feed into ASCII art. The ASCII generation code is based on my previous project, Ascii Generator.
How it works
The application reads a video feed from the default device camera. Each frame is split up into cells of pixels, each of which represents an ASCII letter in the final rendering. The app then computes the average color of each cell and stores it in a BlockGrid
object. BlockGrid
is an objective-C wrapper around a buffer of CGFloats.
The main ViewController passes the BlockGrid
to a custom UIView subclass ASCIIView
. For each cell in the grid, ASCIIView:
- Computes the darkness of the cell on a scale of 1.0 to 0.0
- Searches through a predefined binary tree of darkness/letter pairs. For example, this would match the darkness value 1.0 to a space and darkness 0.0 to an @.
- Draws the appropriate character in the cell, using the cell's color
All drawing is done with Quartz. The app averages around 10 FPS, which feels fairly smooth. In the future, it might be an interesting exercise to port it to OpenGL instead.
- ASCII Cam
- CAM
- CAM软件
- CAM表
- IP cam 与模拟cam
- CAM 与数控编程
- 专业CAD/CAM软件
- UG和CAM编程
- CAM存储器概述
- cam 知识点搜索
- usb CAM 调试
- CAM-CRP-1064
- Galileo+wifi+cam
- 人脸识别 cam
- ASCII
- ASCII
- ASCII
- ASCII
- 17周项目一:体会函数参数传递(二)。
- 安装ADT时报Cannot complete the install because one or more required items could not be found.错误
- Ubuntu的shell之bash和dash
- C语言平面几何4-两线段是否相交
- HTML中meta标签
- ASCII Cam
- 第十七周 项目2--采用引用类型做参数排序三个数
- solr 层面搜索
- UIView手册中的说明
- 线程demo2
- 将字符串str1复制为字符串str2
- 奇数因子
- FreeBSD之netgraph简要解析(备份)
- DiskFileItemFactory类