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
360
既存アプリをvisionOS対応してリリースした話/visionOS LT vol5
noppefoxwolf
0
170
UIのブラックボックスを探る/iOSDC23
noppefoxwolf
3
3.9k
CoreGraphicsでドット絵を描こう/iOSDC22
noppefoxwolf
0
2.2k
ランタイムデバッグのススメ/iOSDC21
noppefoxwolf
1
4.3k
google/mediapipe で始めるARアプリ開発/iOSDC2020
noppefoxwolf
1
1.4k
モバイルファーストなアプリを作るためにvearがしたこと/xRDCC
noppefoxwolf
0
99
ソーシャルライブサービスにおけるデジタル化粧の仕組みと実装/iOSDC19
noppefoxwolf
4
5.3k
Limited import clarification and its effect/tryswift2019
noppefoxwolf
2
1.2k
Other Decks in Programming
See All in Programming
Zoneless Testing
rainerhahnekamp
0
120
nekko cloudにおけるProxmox VE利用事例
irumaru
3
420
선언형 UI에서의 상태관리
l2hyunwoo
0
140
return文におけるstd::moveについて
onihusube
1
860
KubeCon + CloudNativeCon NA 2024 Overviewat Kubernetes Meetup Tokyo #68 / amsy810_k8sjp68
masayaaoyama
0
250
生成AIでGitHubソースコード取得して仕様書を作成
shukob
0
270
tidymodelsによるtidyな生存時間解析 / Japan.R2024
dropout009
1
750
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
300
Keeping it Ruby: Why Your Product Needs a Ruby SDK - RubyWorld 2024
envek
0
180
Monixと常駐プログラムの勘どころ / Scalaわいわい勉強会 #4
stoneream
0
270
Cloudflare MCP ServerでClaude Desktop からWeb APIを構築
kutakutat
1
530
競技プログラミングへのお誘い@阪大BOOSTセミナー
kotamanegi
0
350
Featured
See All Featured
Rails Girls Zürich Keynote
gr2m
94
13k
The Cult of Friendly URLs
andyhume
78
6.1k
Done Done
chrislema
181
16k
Testing 201, or: Great Expectations
jmmastey
40
7.1k
A better future with KSS
kneath
238
17k
We Have a Design System, Now What?
morganepeng
51
7.3k
A Philosophy of Restraint
colly
203
16k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
0
96
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
2
290
It's Worth the Effort
3n
183
28k
Building Applications with DynamoDB
mza
91
6.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Λ࡞Δ ɾϢʔεέʔε ɾར