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
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
MCP連携で加速するAI駆動開発/mcp integration accelerates ai-driven-development
bpstudy
0
290
『リコリス・リコイル』に学ぶ!! 〜キャリア戦略における計画的偶発性理論と変わる勇気の重要性〜
wanko_it
1
350
ZeroETLで始めるDynamoDBとS3の連携
afooooil
0
150
技術的負債で信頼性が限界だったWordPress運用をShifterで完全復活させた話
rvirus0817
0
840
No Install CMS戦略 〜 5年先を見据えたフロントエンド開発を考える / no_install_cms
rdlabo
0
480
プロダクトという一杯を作る - プロダクトチームが味の責任を持つまでの煮込み奮闘記
hiliteeternal
0
440
CEDEC 2025 『ゲームにおけるリアルタイム通信への QUIC導入事例の紹介』
segadevtech
3
810
Constant integer division faster than compiler-generated code
herumi
2
560
202507_ADKで始めるエージェント開発の基本 〜デモを通じて紹介〜(奥田りさ)The Basics of Agent Development with ADK — A Demo-Focused Introduction
risatube
PRO
6
1.4k
Nuances on Kubernetes - RubyConf Taiwan 2025
envek
0
130
管你要 trace 什麼、bpftrace 用下去就對了 — COSCUP 2025
shunghsiyu
0
350
Terraform やるなら公式スタイルガイドを読もう 〜重要項目 10選〜
hiyanger
12
3k
Featured
See All Featured
A better future with KSS
kneath
239
17k
Being A Developer After 40
akosma
90
590k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.4k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
6k
Balancing Empowerment & Direction
lara
1
540
Building Adaptive Systems
keathley
43
2.7k
What's in a price? How to price your products and services
michaelherold
246
12k
The Invisible Side of Design
smashingmag
301
51k
Code Reviewing Like a Champion
maltzj
524
40k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3.1k
Automating Front-end Workflow
addyosmani
1370
200k
GitHub's CSS Performance
jonrohan
1031
460k
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 Λམͱͣ͞ʹ ϝϞϦͷ༻ྔΛ͑Δ͜ͱ͕Ͱ͖Δ
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠