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
Stackless и stackful? Корутины и асинхронность в Go
lamodatech
0
810
tidymodelsによるtidyな生存時間解析 / Japan.R2024
dropout009
1
790
生成AIでGitHubソースコード取得して仕様書を作成
shukob
0
460
採用事例の少ないSvelteを選んだ理由と それを正解にするためにやっていること
oekazuma
2
1k
創造的活動から切り拓く新たなキャリア 好きから始めてみる夜勤オペレーターからSREへの転身
yjszk
1
130
testcontainers のススメ
sgash708
1
120
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
140
LLM Supervised Fine-tuningの理論と実践
datanalyticslabo
7
1.3k
たのしいparse.y
ydah
3
120
テストコードのガイドライン 〜作成から運用まで〜
riku929hr
5
660
MCP with Cloudflare Workers
yusukebe
2
220
良いユニットテストを書こう
mototakatsu
8
2.6k
Featured
See All Featured
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
Imperfection Machines: The Place of Print at Facebook
scottboms
266
13k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
2
170
Fireside Chat
paigeccino
34
3.1k
How to Think Like a Performance Engineer
csswizardry
22
1.2k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
520
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Documentation Writing (for coders)
carmenintech
66
4.5k
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Λ࡞Δ ɾϢʔεέʔε ɾར