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
350
What is CVBuffer/ROPPONGI.swift
noppefoxwolf
December 27, 2018
Tweet
Share
More Decks by noppefoxwolf
See All by noppefoxwolf
iOSの隠されたAPIを解明し、開発効率を向上させる方法/iOSDC24
noppefoxwolf
2
280
既存アプリをvisionOS対応してリリースした話/visionOS LT vol5
noppefoxwolf
0
170
UIのブラックボックスを探る/iOSDC23
noppefoxwolf
3
3.9k
CoreGraphicsでドット絵を描こう/iOSDC22
noppefoxwolf
0
2.1k
ランタイムデバッグのススメ/iOSDC21
noppefoxwolf
1
4.3k
google/mediapipe で始めるARアプリ開発/iOSDC2020
noppefoxwolf
1
1.4k
モバイルファーストなアプリを作るためにvearがしたこと/xRDCC
noppefoxwolf
0
93
ソーシャルライブサービスにおけるデジタル化粧の仕組みと実装/iOSDC19
noppefoxwolf
4
5.3k
Limited import clarification and its effect/tryswift2019
noppefoxwolf
2
1.2k
Other Decks in Programming
See All in Programming
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
1
290
Quine, Polyglot, 良いコード
qnighy
4
640
Arm移行タイムアタック
qnighy
0
320
Tauriでネイティブアプリを作りたい
tsucchinoko
0
370
Creating a Free Video Ad Network on the Edge
mizoguchicoji
0
120
距離関数を極める! / SESSIONS 2024
gam0022
0
280
Remix on Hono on Cloudflare Workers
yusukebe
1
280
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
9
3.3k
TypeScriptでライブラリとの依存を限定的にする方法
tutinoko
2
660
Better Code Design in PHP
afilina
PRO
0
120
LLM生成文章の精度評価自動化とプロンプトチューニングの効率化について
layerx
PRO
2
190
ActiveSupport::Notifications supporting instrumentation of Rails apps with OpenTelemetry
ymtdzzz
1
230
Featured
See All Featured
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Writing Fast Ruby
sferik
627
61k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Typedesign – Prime Four
hannesfritz
40
2.4k
Fireside Chat
paigeccino
34
3k
Ruby is Unlike a Banana
tanoku
97
11k
4 Signs Your Business is Dying
shpigford
180
21k
Making the Leap to Tech Lead
cromwellryan
133
8.9k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
28
2k
What's in a price? How to price your products and services
michaelherold
243
12k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
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Λ࡞Δ ɾϢʔεέʔε ɾར