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
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
250
Enabling DevOps and Team Topologies Through Architecture: Architecting for Fast Flow
cer
PRO
0
330
cmp.Or に感動した
otakakot
3
200
イベント駆動で成長して委員会
happymana
1
320
카카오페이는 어떻게 수천만 결제를 처리할까? 우아한 결제 분산락 노하우
kakao
PRO
0
110
Less waste, more joy, and a lot more green: How Quarkus makes Java better
hollycummins
0
100
Compose 1.7のTextFieldはPOBox Plusで日本語変換できない
tomoya0x00
0
190
最新TCAキャッチアップ
0si43
0
190
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
10
1.3k
Flutterを言い訳にしない!アプリの使い心地改善テクニック5選🔥
kno3a87
1
190
CSC509 Lecture 13
javiergs
PRO
0
110
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
520
Featured
See All Featured
Visualization
eitanlees
145
15k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
Designing Experiences People Love
moore
138
23k
Into the Great Unknown - MozCon
thekraken
32
1.5k
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
Embracing the Ebb and Flow
colly
84
4.5k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
720
What's in a price? How to price your products and services
michaelherold
243
12k
Become a Pro
speakerdeck
PRO
25
5k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.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Λ࡞Δ ɾϢʔεέʔε ɾར