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
COIL ことはじめ
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Mizuki Furusawa
September 10, 2019
Programming
2
2.1k
COIL ことはじめ
Mizuki Furusawa
September 10, 2019
Tweet
Share
Other Decks in Programming
See All in Programming
高速開発のためのコード整理術
sutetotanuki
1
400
AI & Enginnering
codelynx
0
120
Automatic Grammar Agreementと Markdown Extended Attributes について
kishikawakatsumi
0
200
「ブロックテーマでは再現できない」は本当か?
inc2734
0
1k
AIによるイベントストーミング図からのコード生成 / AI-powered code generation from Event Storming diagrams
nrslib
2
1.9k
Fluid Templating in TYPO3 14
s2b
0
130
[KNOTS 2026登壇資料]AIで拡張‧交差する プロダクト開発のプロセス および携わるメンバーの役割
hisatake
0
290
CSC307 Lecture 03
javiergs
PRO
1
490
CSC307 Lecture 06
javiergs
PRO
0
690
なるべく楽してバックエンドに型をつけたい!(楽とは言ってない)
hibiki_cube
0
140
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
7.4k
例外処理とどう使い分ける?Result型を使ったエラー設計 #burikaigi
kajitack
16
6.1k
Featured
See All Featured
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
280
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
100
Balancing Empowerment & Direction
lara
5
890
Typedesign – Prime Four
hannesfritz
42
2.9k
Test your architecture with Archunit
thirion
1
2.2k
Evolving SEO for Evolving Search Engines
ryanjones
0
130
Why Our Code Smells
bkeepers
PRO
340
58k
Thoughts on Productivity
jonyablonski
74
5k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
110
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Writing Fast Ruby
sferik
630
62k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
450
Transcript
$"BQL ɹɹɹ͜ͱ͡Ί 2019.9.10 / Mizuki Furusawa (@mzkii)
$"BQL ɹɹɹ͜ͱ͡Ί ❌ 2019.9.10 / Mizuki Furusawa (@mzkii)
$"BQL ৄղɹɹɹͷ෦࣮ 2019.9.10 / Mizuki Furusawa (@mzkii)
Whoami • Mizuki Furusawa (@mzkii) • 2019/4 ~ CyberAgent, Inc.
• λοϓϧੜ • Android Engineer • Kotlin/Java/C/C++/Python/Cats
Coroutine Image Loader
Coroutine Image Loader “An image loading library for Android backed
by Kotlin Coroutines.” Fast / Lightweight / Easy to use / Modern
αϙʔτ͞Ε͍ͯΔσʔλܗࣜ • String (mapped to a Uri) • HttpUrl •
Uri (android.resource, content, file, http, and https schemes only) • File • @DrawableRes Int • Drawable • Bitmap +α GIF SVG (0.7.0)
ಋೖ • mavenCentral()
͍ํ • “To load an image into an ImageView,
use the load extension function:”
͍ํ • ϥϜμࣜͰΦϓγϣϯΛࢦఆ͢Δ͜ͱ͕Ͱ͖Δɻ
Transformations • Glide Piccaso ͷΑ͏ʹɺ COIL ʹҎԼͷը૾Ճ༻ͷΫϥε͕ඪ४Ͱ༻ҙ͞Ε͍ͯΔɻ • BlurTransformation
• CircleCropTransformation • GrayscaleTransformation • RoundedCornersTransformation
Dynamic image sampling
Coil-transformations • 3rd party ͷϥΠϒϥϦެ։͞Ε͍ͯΔ (relies on GPUImage) • ColorFilterTransformation
• CropTransformation (top, center, bottom) • MaskTransformation • SquareCropTransformation • PixelationFilterTransformation • ContrastFilterTransformation • …and more
Control memory cache and bitmap pool
Control memory cache and bitmap pool
Control memory cache and bitmap pool
Control memory cache and bitmap pool
Control memory cache and bitmap pool
ImageLoader ͱ?
ImageLoader • “Image Loaders are service objects that handle image
requests with load and get. They handle caching, image decoding, request management, bitmap pooling, memory management, and more.”
ImageViews.kt • “Image Loaders are service objects that handle image
requests with load and get. They handle caching, image decoding, request management, bitmap pooling, memory management, and more.”
ImageViews.kt • “Image Loaders are service objects that handle image
requests with load and get. They handle caching, image decoding, request management, bitmap pooling, memory management, and more.”
Application.kt
Application.kt
Application.kt
ImageLoader.kt
ImageLoader.kt
ImageLoader
ImageLoader
ImageLoader = RealImageLoader
RealImageLoader ͲͷΑ͏ʹը૾ΛಡΈࠐΉͷ͔
RealImageLoader • Mapper • Fetcher • Decoder
Mapper • ҙͷσʔλܕ T Λ FetcherͰѻ͏͜ͱͷͰ͖ΔܕʹϚοϐϯά͢Δɻ
Fetcher • ҙͷσʔλܕ T Λ BufferedSource ·ͨ Drawable ʹม͢Δɻ
Fetcher • ҙͷσʔλܕ T Λ BufferedSource ·ͨ Drawable ʹม͢Δɻ
Decoder • BufferedSource Λ Drawableʹม͢Δɻ
RealImageLoader • Mapper • Fetcher • Decoder 3FBM*NBHF-PBEFS )UUQ6SM'FUDIFS )UUQ6SM
#V⒎FSFE4PVSDF 4USJOH.BQQFS 63- 4USJOH 6SJ )UUQ6SJ.BQQFS 6SJ)UUQ6SM #JUNBQ'BDUPSZ %FDPEFS #V⒎FSFE4PVSDF %SBXBCMF
None
None
ImageViews.kt
ImageViews.kt
RealImageLoader.kt
None
RealImageLoader.kt
None
None
None
None
4USJOH.BQQFS 63- 4USJOH 6SJ
None
None
)UUQ6SJ.BQQFS 6SJ)UUQ6SM
None
None
)UUQ6SM'FUDIFS )UUQ6SM #V⒎FSFE4PVSDF
None
None
None
RealImageLoader.kt
RealImageLoader.kt
RealImageLoader.kt )UUQ6SM'FUDIFS )UUQ6SM #V⒎FSFE4PVSDF
)UUQ6SM'FUDIFS )UUQ6SM #V⒎FSFE4PVSDF
None
None
None
#JUNBQ'BDUPSZ %FDPEFS #V⒎FSFE4PVSDF %SBXBCMF
#JUNBQ'BDUPSZ %FDPEFS #V⒎FSFE4PVSDF %SBXBCMF
None
None
None
None
None
None
None
None
·ͱΊ • ػೳతʹ Glide Piccaso ͳͲଞͷը૾ϥΠϒϥϦͱେମҰॹ • COIL
Glide Fresco ͷը૾ϥΠϒϥϦͱൺͯܰྔ • Glide ͷ8ͷ1ͷαΠζ • ଞͷը૾ϥΠϒϥϦͱൺͯΑΓ Kotlin Ά͍ॻ͖ํ͕Ͱ͖Δ • Dynamic image sampling Λదʹ͑ UX Λམͱͣ͞ʹ ϝϞϦͷ༻ྔΛ͑Δ͜ͱ͕Ͱ͖Δ
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠