Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
What is CVBuffer/ROPPONGI.swift
Search
noppefoxwolf
December 27, 2018
Programming
0
370
What is CVBuffer/ROPPONGI.swift
noppefoxwolf
December 27, 2018
Tweet
Share
More Decks by noppefoxwolf
See All by noppefoxwolf
iOSの隠されたAPIを解明し、開発効率を向上させる方法/iOSDC24
noppefoxwolf
2
410
既存アプリをvisionOS対応してリリースした話/visionOS LT vol5
noppefoxwolf
0
170
UIのブラックボックスを探る/iOSDC23
noppefoxwolf
3
4k
CoreGraphicsでドット絵を描こう/iOSDC22
noppefoxwolf
0
2.3k
ランタイムデバッグのススメ/iOSDC21
noppefoxwolf
1
4.4k
google/mediapipe で始めるARアプリ開発/iOSDC2020
noppefoxwolf
1
1.4k
モバイルファーストなアプリを作るためにvearがしたこと/xRDCC
noppefoxwolf
0
110
ソーシャルライブサービスにおけるデジタル化粧の仕組みと実装/iOSDC19
noppefoxwolf
4
5.3k
Limited import clarification and its effect/tryswift2019
noppefoxwolf
2
1.2k
Other Decks in Programming
See All in Programming
shadcn/uiを使ってReactでの開発を加速させよう!
lef237
0
300
GitHub CopilotでTypeScriptの コード生成するワザップ
starfish719
26
6k
functionalなアプローチで動的要素を排除する
ryopeko
1
210
Azure AI Foundryのご紹介
qt_luigi
1
210
Lookerは可視化だけじゃない。UIコンポーネントもあるんだ!
ymd65536
1
130
PSR-15 はあなたのための ものではない? - phpcon2024
myamagishi
0
400
PicoRubyと暮らす、シェアハウスハック
ryosk7
0
220
HTML/CSS超絶浅い説明
yuki0329
0
190
BEエンジニアがFEの業務をできるようになるまでにやったこと
yoshida_ryushin
0
200
React 19でお手軽にCSS-in-JSを自作する
yukukotani
5
560
선언형 UI에서의 상태관리
l2hyunwoo
0
270
ErdMap: Thinking about a map for Rails applications
makicamel
1
650
Featured
See All Featured
We Have a Design System, Now What?
morganepeng
51
7.3k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
28
4.5k
Why Our Code Smells
bkeepers
PRO
335
57k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Building a Scalable Design System with Sketch
lauravandoore
460
33k
Into the Great Unknown - MozCon
thekraken
34
1.6k
Making the Leap to Tech Lead
cromwellryan
133
9k
For a Future-Friendly Web
brad_frost
176
9.5k
RailsConf 2023
tenderlove
29
970
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Mobile First: as difficult as doing things right
swwweet
222
9k
Transcript
$7#V⒎FSͷ 30110/(*TXJGUୈճձ
OPQQF ! 1PDPDIBJ04ΤϯδχΞ " ͖ͭͶ͔Θ͍͍ # 30110/(*TXJGUॳࢀઓ $ J04%$ͰඳըपΓͷΛ͠·͠ ͨW
ಈըΛѻ͏ػձͷ૿Ճ w ಈը৴ΞϓϦIFWDͷొɺ$PSF7JEFPʹ৮ΕΔػ ձ͕૿͍͑ͯΔ w σʔλϝσΟΞΛѻ͏#V⒎FSܥΫϥεͷར༻ස ૿Ճ w ΈΜͳɺؾ࣋ͪͰ$71JYFM#V⒎FSΛ͍ͬͯ·ͤΜ͔ʁ
#V⒎FSܥΫϥεͷۙگ w ݹ͍ΫϥεͳͷͰɺ΄΅มߋͳ͍ w ͔͠͠ڥมԽɺΫϥΠΞϯτͰͷσίʔυ 0QFO(-&4.FUBMͷσʔλ͠ʹར༻͞ΕΔ
$7#V⒎FS
$7#V⒎FS w $7#V⒎FSͷ$7$PSF7JEFPͷ$7 σʔλόοϑΝΛ৮Βͣʹ؆୯ʹಡΈॻ͖͢Δͨ Ίͷ*'
දతͳ$7#V⒎FSͷੜ w $7*NBHF#V⒎FS w $71JYFM#V⒎FS w $70QFO(-&45FYUVSF
$7#V⒎FS͡Όͳ͍ํ w $.4BNQMF#V⒎FS ͜Εҧ͏ w $.#MPDL#V⒎FS ͜Εҧ͏
ͲΜͳ࣌ʹऔಘͰ͖Δͷ͔ DJ*NBHFQJYFM#V⒎FS@d ͱ͔ MFUJC$.4BNQMF#V⒎FS(FU*NBHF#V⒎FS TC
$7#V⒎FSͷਖ਼ମ w $7*NBHF#V⒎FS public typealias CVImageBuffer = CVBuffer w $71JYFM#V⒎FS
public typealias CVPixelBuffer = CVImageBuffer w $70QFO(-&45FYUVSF public typealias CVOpenGLESTexture = CVImageBuffer
$71JYFM#V⒎FSWT$7*NBHF#V⒎FS w 2UZQFBMJBTͳΜͩ͠ಉ͡Ͱ͠ΐʁ w "ԶʹΘ͔ΒΜ
$71JYFM#V⒎FSWT$7*NBHF#V⒎FS w $71JYFM#VGGFS ϝϞϦͷϐΫηϧόοϑΝʹΞΫηε͢ΔͨΊͷΫϥ ε w $7*NBHF#VGGFS ϝϞϦͷը૾ʹΞΫηε͢ΔͨΊͷΫϥε
ϐΫηϧใΞΫηεͷྫ w ॎԣͷαΠζ w σʔλαΠζ ը૾ΞΫηεͷྫ w Χϥʔεϖʔε
υΩϡϝϯτ $7*NBHF#VGGFS(FU%JTQMBZ4J[F @ "$(4J[FTUSVDUVSFEFpOJOHUIFOPNJOBMEJTQMBZ TJ[FPGUIFCV⒎FS3FUVSOT[FSPTJ[FJGDBMMFE XJUIBOPO$7*NBHF#VGGFS3FGUZQFPS /6--
ݕূ var pb: CVPixelBuffer? = nil CVPixelBufferCreate(kCFAllocatorDefault, 128, 128, kCVPixelFormatType_32BGRA,
nil, &pb) CVImageBufferGetDisplaySize(pb!) // -> (128.0, 128.0)
ಈըΛѻ͏ػձͷ૿Ճ w ಈը৴ΞϓϦIFWDͷొɺ$PSF7JEFPʹ৮ΕΔػ ձ͕૿͍͑ͯΔ w σʔλϝσΟΞΛѻ͏#V⒎FSܥΫϥεͷར༻ස ૿Ճ w ΈΜͳɺؾ࣋ͪͰ$71JYFM#V⒎FSΛ͍ͬͯ·ͤΜ͔ʁ
ؾ࣋ͪͰ͍ͬͯΔ
6**NBHFͱͷҧ͍
6**NBHFͱͷҧ͍ w $7#V⒎FS ΞυϨεΛࢀর͍ͯ͠Δ͚ͩͳͷͰɺϩοΫ͢Δ͕ ίϐʔΩϟογϡ͞Εͳ͍ தؒϨϯμϦϯάউखʹ͞Εͳ͍ ϏσΦͷΑ͏ʹߴʹॲཧ͢Δඞཁ͕͋ΔՕॴʹ࠷ద
ΞυϨεͷϩοΫ $7#V⒎FSͷσʔλόοϑΝʹ$16͔ΒΞΫηε͢Δ ߹ΞυϨεΛϩοΫ͢Δඞཁ͕͋Δ CVPixelBufferLockBaseAddress(pb, .readOnly) defer { CVPixelBufferUnlockBaseAddress(pb, .readOnly) }
$71JYFM#V⒎FSͷதΛදࣔ͢Δ
Ұ൪؆୯ͳํ๏ $71JYFM#V⒎FS$**NBHF6**NBHF CIImage(cvPixelBuffer: CVPixelBuffer) UIImage(ciImage: ciImage)
.FUBMͰදࣔ͢Δ CVMetalTextureCacheܦ༝Ͱ $71JYFM#V⒎FS.5-5FYUVSF .5,7JFXͳͲͰදࣔ
0QFO(-&4Ͱදࣔ͢Δ CVOpenGLESTextureCacheܦ༝Ͱ $71JYFM#V⒎FS0QFO(-&45FYUVSF (-,7JFXͳͲͰදࣔ
$.4BNQMF#V⒎FSͱ
$.4BNQMF#V⒎FSͱ ɾඞͣ͠$71JYFM#V⒎FS͕ೖ͍ͬͯΔͱݶΒͳ͍
ͦ͏ͱࢥ͍ͬͯͨ ɾ$71JYFM#V⒎FS͔Β$.4BNQMF#V⒎FSΛ࡞Δ ɾϢʔεέʔε ɾར