Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
COIL ことはじめ
Search
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
DSPy Meetup Tokyo #1 - はじめてのDSPy
masahiro_nishimi
1
160
LLMで複雑な検索条件アセットから脱却する!! 生成的検索インタフェースの設計論
po3rin
2
690
AIコーディングエージェント(NotebookLM)
kondai24
0
180
AIエージェントを活かすPM術 AI駆動開発の現場から
gyuta
0
400
20251127_ぼっちのための懇親会対策会議
kokamoto01_metaps
2
430
20251212 AI 時代的 Legacy Code 營救術 2025 WebConf
mouson
0
110
非同期処理の迷宮を抜ける: 初学者がつまづく構造的な原因
pd1xx
1
710
JETLS.jl ─ A New Language Server for Julia
abap34
1
380
Socio-Technical Evolution: Growing an Architecture and Its Organization for Fast Flow
cer
PRO
0
330
AWS CDKの推しポイントN選
akihisaikeda
1
240
モデル駆動設計をやってみようワークショップ開催報告(Modeling Forum2025) / model driven design workshop report
haru860
0
260
30分でDoctrineの仕組みと使い方を完全にマスターする / phpconkagawa 2025 Doctrine
ttskch
3
830
Featured
See All Featured
How STYLIGHT went responsive
nonsquared
100
6k
Fireside Chat
paigeccino
41
3.7k
We Have a Design System, Now What?
morganepeng
54
7.9k
[RailsConf 2023] Rails as a piece of cake
palkan
58
6.2k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Thoughts on Productivity
jonyablonski
73
5k
Why Our Code Smells
bkeepers
PRO
340
57k
Visualization
eitanlees
150
16k
Context Engineering - Making Every Token Count
addyosmani
9
500
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
14k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
Building Flexible Design Systems
yeseniaperezcruz
330
39k
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 Λམͱͣ͞ʹ ϝϞϦͷ༻ྔΛ͑Δ͜ͱ͕Ͱ͖Δ
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠