David Morrissey | d94cb88 | 2017-11-16 14:55:41 +0000 | [diff] [blame] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| 2 | <!-- NewPage --> |
| 3 | <html lang="en"> |
| 4 | <head> |
David Morrissey | 3b0a9d1 | 2017-12-03 09:13:27 +0000 | [diff] [blame] | 5 | <!-- Generated by javadoc --> |
David Morrissey | dea2a39 | 2017-12-02 08:46:32 +0000 | [diff] [blame] | 6 | <title>SkiaImageRegionDecoder (library 3.9.0 API)</title> |
David Morrissey | d94cb88 | 2017-11-16 14:55:41 +0000 | [diff] [blame] | 7 | <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> |
| 8 | <script type="text/javascript" src="../../../../../script.js"></script> |
| 9 | </head> |
| 10 | <body> |
| 11 | <script type="text/javascript"><!-- |
| 12 | try { |
| 13 | if (location.href.indexOf('is-external=true') == -1) { |
David Morrissey | dea2a39 | 2017-12-02 08:46:32 +0000 | [diff] [blame] | 14 | parent.document.title="SkiaImageRegionDecoder (library 3.9.0 API)"; |
David Morrissey | d94cb88 | 2017-11-16 14:55:41 +0000 | [diff] [blame] | 15 | } |
| 16 | } |
| 17 | catch(err) { |
| 18 | } |
| 19 | //--> |
| 20 | var methods = {"i0":10,"i1":10,"i2":10,"i3":10}; |
| 21 | var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; |
| 22 | var altColor = "altColor"; |
| 23 | var rowColor = "rowColor"; |
| 24 | var tableTab = "tableTab"; |
| 25 | var activeTableTab = "activeTableTab"; |
| 26 | </script> |
| 27 | <noscript> |
| 28 | <div>JavaScript is disabled on your browser.</div> |
| 29 | </noscript> |
| 30 | <!-- ========= START OF TOP NAVBAR ======= --> |
| 31 | <div class="topNav"><a name="navbar.top"> |
| 32 | <!-- --> |
| 33 | </a> |
| 34 | <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| 35 | <a name="navbar.top.firstrow"> |
| 36 | <!-- --> |
| 37 | </a> |
| 38 | <ul class="navList" title="Navigation"> |
| 39 | <li><a href="../../../../../overview-summary.html">Overview</a></li> |
| 40 | <li><a href="package-summary.html">Package</a></li> |
| 41 | <li class="navBarCell1Rev">Class</li> |
| 42 | <li><a href="package-tree.html">Tree</a></li> |
| 43 | <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> |
| 44 | <li><a href="../../../../../index-all.html">Index</a></li> |
| 45 | <li><a href="../../../../../help-doc.html">Help</a></li> |
| 46 | </ul> |
| 47 | </div> |
| 48 | <div class="subNav"> |
| 49 | <ul class="navList"> |
| 50 | <li><a href="../../../../../com/davemorrissey/labs/subscaleview/decoder/SkiaImageDecoder.html" title="class in com.davemorrissey.labs.subscaleview.decoder"><span class="typeNameLink">Prev Class</span></a></li> |
David Morrissey | dea2a39 | 2017-12-02 08:46:32 +0000 | [diff] [blame] | 51 | <li><a href="../../../../../com/davemorrissey/labs/subscaleview/decoder/SkiaPooledImageRegionDecoder.html" title="class in com.davemorrissey.labs.subscaleview.decoder"><span class="typeNameLink">Next Class</span></a></li> |
David Morrissey | d94cb88 | 2017-11-16 14:55:41 +0000 | [diff] [blame] | 52 | </ul> |
| 53 | <ul class="navList"> |
| 54 | <li><a href="../../../../../index.html?com/davemorrissey/labs/subscaleview/decoder/SkiaImageRegionDecoder.html" target="_top">Frames</a></li> |
| 55 | <li><a href="SkiaImageRegionDecoder.html" target="_top">No Frames</a></li> |
| 56 | </ul> |
| 57 | <ul class="navList" id="allclasses_navbar_top"> |
| 58 | <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> |
| 59 | </ul> |
| 60 | <div> |
| 61 | <script type="text/javascript"><!-- |
| 62 | allClassesLink = document.getElementById("allclasses_navbar_top"); |
| 63 | if(window==top) { |
| 64 | allClassesLink.style.display = "block"; |
| 65 | } |
| 66 | else { |
| 67 | allClassesLink.style.display = "none"; |
| 68 | } |
| 69 | //--> |
| 70 | </script> |
| 71 | </div> |
| 72 | <div> |
| 73 | <ul class="subNavList"> |
| 74 | <li>Summary: </li> |
| 75 | <li>Nested | </li> |
| 76 | <li>Field | </li> |
| 77 | <li><a href="#constructor.summary">Constr</a> | </li> |
| 78 | <li><a href="#method.summary">Method</a></li> |
| 79 | </ul> |
| 80 | <ul class="subNavList"> |
| 81 | <li>Detail: </li> |
| 82 | <li>Field | </li> |
| 83 | <li><a href="#constructor.detail">Constr</a> | </li> |
| 84 | <li><a href="#method.detail">Method</a></li> |
| 85 | </ul> |
| 86 | </div> |
| 87 | <a name="skip.navbar.top"> |
| 88 | <!-- --> |
| 89 | </a></div> |
| 90 | <!-- ========= END OF TOP NAVBAR ========= --> |
| 91 | <!-- ======== START OF CLASS DATA ======== --> |
| 92 | <div class="header"> |
| 93 | <div class="subTitle">com.davemorrissey.labs.subscaleview.decoder</div> |
| 94 | <h2 title="Class SkiaImageRegionDecoder" class="title">Class SkiaImageRegionDecoder</h2> |
| 95 | </div> |
| 96 | <div class="contentContainer"> |
| 97 | <ul class="inheritance"> |
David Morrissey | fed3d78 | 2017-12-04 08:03:42 +0000 | [diff] [blame] | 98 | <li><a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li> |
David Morrissey | d94cb88 | 2017-11-16 14:55:41 +0000 | [diff] [blame] | 99 | <li> |
| 100 | <ul class="inheritance"> |
| 101 | <li>com.davemorrissey.labs.subscaleview.decoder.SkiaImageRegionDecoder</li> |
| 102 | </ul> |
| 103 | </li> |
| 104 | </ul> |
| 105 | <div class="description"> |
| 106 | <ul class="blockList"> |
| 107 | <li class="blockList"> |
| 108 | <dl> |
| 109 | <dt>All Implemented Interfaces:</dt> |
| 110 | <dd><a href="../../../../../com/davemorrissey/labs/subscaleview/decoder/ImageRegionDecoder.html" title="interface in com.davemorrissey.labs.subscaleview.decoder">ImageRegionDecoder</a></dd> |
| 111 | </dl> |
| 112 | <hr> |
| 113 | <br> |
| 114 | <pre>public class <span class="typeNameLabel">SkiaImageRegionDecoder</span> |
David Morrissey | fed3d78 | 2017-12-04 08:03:42 +0000 | [diff] [blame] | 115 | extends <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> |
David Morrissey | d94cb88 | 2017-11-16 14:55:41 +0000 | [diff] [blame] | 116 | implements <a href="../../../../../com/davemorrissey/labs/subscaleview/decoder/ImageRegionDecoder.html" title="interface in com.davemorrissey.labs.subscaleview.decoder">ImageRegionDecoder</a></pre> |
| 117 | <div class="block">Default implementation of <a href="../../../../../com/davemorrissey/labs/subscaleview/decoder/ImageRegionDecoder.html" title="interface in com.davemorrissey.labs.subscaleview.decoder"><code>ImageRegionDecoder</code></a> |
David Morrissey | fed3d78 | 2017-12-04 08:03:42 +0000 | [diff] [blame] | 118 | using Android's <a href="https://developer.android.com/reference/android/graphics/BitmapRegionDecoder.html?is-external=true" title="class or interface in android.graphics"><code>BitmapRegionDecoder</code></a>, based on the Skia library. This |
David Morrissey | d94cb88 | 2017-11-16 14:55:41 +0000 | [diff] [blame] | 119 | works well in most circumstances and has reasonable performance due to the cached decoder instance, |
David Morrissey | dea2a39 | 2017-12-02 08:46:32 +0000 | [diff] [blame] | 120 | however it has some problems with grayscale, indexed and CMYK images. |
| 121 | |
David Morrissey | fed3d78 | 2017-12-04 08:03:42 +0000 | [diff] [blame] | 122 | A <a href="https://developer.android.com/reference/java/util/concurrent/locks/ReadWriteLock.html?is-external=true" title="class or interface in java.util.concurrent.locks"><code>ReadWriteLock</code></a> is used to delegate responsibility for multi threading behaviour to the |
| 123 | <a href="https://developer.android.com/reference/android/graphics/BitmapRegionDecoder.html?is-external=true" title="class or interface in android.graphics"><code>BitmapRegionDecoder</code></a> instance on SDK >= 21, whilst allowing this class to block until no |
| 124 | tiles are being loaded before recycling the decoder. In practice, <a href="https://developer.android.com/reference/android/graphics/BitmapRegionDecoder.html?is-external=true" title="class or interface in android.graphics"><code>BitmapRegionDecoder</code></a> is |
David Morrissey | dea2a39 | 2017-12-02 08:46:32 +0000 | [diff] [blame] | 125 | synchronized internally so this has no real impact on performance.</div> |
David Morrissey | d94cb88 | 2017-11-16 14:55:41 +0000 | [diff] [blame] | 126 | </li> |
| 127 | </ul> |
| 128 | </div> |
| 129 | <div class="summary"> |
| 130 | <ul class="blockList"> |
| 131 | <li class="blockList"> |
| 132 | <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| 133 | <ul class="blockList"> |
| 134 | <li class="blockList"><a name="constructor.summary"> |
| 135 | <!-- --> |
| 136 | </a> |
| 137 | <h3>Constructor Summary</h3> |
| 138 | <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> |
| 139 | <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| 140 | <tr> |
| 141 | <th class="colOne" scope="col">Constructor and Description</th> |
| 142 | </tr> |
| 143 | <tr class="altColor"> |
| 144 | <td class="colOne"><code><span class="memberNameLink"><a href="../../../../../com/davemorrissey/labs/subscaleview/decoder/SkiaImageRegionDecoder.html#SkiaImageRegionDecoder--">SkiaImageRegionDecoder</a></span>()</code> </td> |
| 145 | </tr> |
| 146 | <tr class="rowColor"> |
David Morrissey | fed3d78 | 2017-12-04 08:03:42 +0000 | [diff] [blame] | 147 | <td class="colOne"><code><span class="memberNameLink"><a href="../../../../../com/davemorrissey/labs/subscaleview/decoder/SkiaImageRegionDecoder.html#SkiaImageRegionDecoder-android.graphics.Bitmap.Config-">SkiaImageRegionDecoder</a></span>(<a href="https://developer.android.com/reference/android/graphics/Bitmap.Config.html?is-external=true" title="class or interface in android.graphics">Bitmap.Config</a> bitmapConfig)</code> </td> |
David Morrissey | d94cb88 | 2017-11-16 14:55:41 +0000 | [diff] [blame] | 148 | </tr> |
| 149 | </table> |
| 150 | </li> |
| 151 | </ul> |
| 152 | <!-- ========== METHOD SUMMARY =========== --> |
| 153 | <ul class="blockList"> |
| 154 | <li class="blockList"><a name="method.summary"> |
| 155 | <!-- --> |
| 156 | </a> |
| 157 | <h3>Method Summary</h3> |
| 158 | <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> |
| 159 | <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> |
| 160 | <tr> |
| 161 | <th class="colFirst" scope="col">Modifier and Type</th> |
| 162 | <th class="colLast" scope="col">Method and Description</th> |
| 163 | </tr> |
| 164 | <tr id="i0" class="altColor"> |
David Morrissey | fed3d78 | 2017-12-04 08:03:42 +0000 | [diff] [blame] | 165 | <td class="colFirst"><code><a href="https://developer.android.com/reference/android/graphics/Bitmap.html?is-external=true" title="class or interface in android.graphics">Bitmap</a></code></td> |
| 166 | <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/davemorrissey/labs/subscaleview/decoder/SkiaImageRegionDecoder.html#decodeRegion-android.graphics.Rect-int-">decodeRegion</a></span>(<a href="https://developer.android.com/reference/android/graphics/Rect.html?is-external=true" title="class or interface in android.graphics">Rect</a> sRect, |
David Morrissey | d94cb88 | 2017-11-16 14:55:41 +0000 | [diff] [blame] | 167 | int sampleSize)</code> |
David Morrissey | c2d55e0 | 2017-12-03 09:43:51 +0000 | [diff] [blame] | 168 | <div class="block"> |
| 169 | Decode a region of the image with the given sample size.</div> |
David Morrissey | d94cb88 | 2017-11-16 14:55:41 +0000 | [diff] [blame] | 170 | </td> |
| 171 | </tr> |
| 172 | <tr id="i1" class="rowColor"> |
David Morrissey | fed3d78 | 2017-12-04 08:03:42 +0000 | [diff] [blame] | 173 | <td class="colFirst"><code><a href="https://developer.android.com/reference/android/graphics/Point.html?is-external=true" title="class or interface in android.graphics">Point</a></code></td> |
| 174 | <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/davemorrissey/labs/subscaleview/decoder/SkiaImageRegionDecoder.html#init-android.content.Context-android.net.Uri-">init</a></span>(<a href="https://developer.android.com/reference/android/content/Context.html?is-external=true" title="class or interface in android.content">Context</a> context, |
| 175 | <a href="https://developer.android.com/reference/android/net/Uri.html?is-external=true" title="class or interface in android.net">Uri</a> uri)</code> |
David Morrissey | d94cb88 | 2017-11-16 14:55:41 +0000 | [diff] [blame] | 176 | <div class="block">Initialise the decoder.</div> |
| 177 | </td> |
| 178 | </tr> |
| 179 | <tr id="i2" class="altColor"> |
| 180 | <td class="colFirst"><code>boolean</code></td> |
| 181 | <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/davemorrissey/labs/subscaleview/decoder/SkiaImageRegionDecoder.html#isReady--">isReady</a></span>()</code> |
| 182 | <div class="block">Status check.</div> |
| 183 | </td> |
| 184 | </tr> |
| 185 | <tr id="i3" class="rowColor"> |
| 186 | <td class="colFirst"><code>void</code></td> |
| 187 | <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/davemorrissey/labs/subscaleview/decoder/SkiaImageRegionDecoder.html#recycle--">recycle</a></span>()</code> |
| 188 | <div class="block">This method will be called when the decoder is no longer required.</div> |
| 189 | </td> |
| 190 | </tr> |
| 191 | </table> |
| 192 | <ul class="blockList"> |
| 193 | <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> |
| 194 | <!-- --> |
| 195 | </a> |
David Morrissey | fed3d78 | 2017-12-04 08:03:42 +0000 | [diff] [blame] | 196 | <h3>Methods inherited from class java.lang.<a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3> |
| 197 | <code><a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li> |
David Morrissey | d94cb88 | 2017-11-16 14:55:41 +0000 | [diff] [blame] | 198 | </ul> |
| 199 | </li> |
| 200 | </ul> |
| 201 | </li> |
| 202 | </ul> |
| 203 | </div> |
| 204 | <div class="details"> |
| 205 | <ul class="blockList"> |
| 206 | <li class="blockList"> |
| 207 | <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| 208 | <ul class="blockList"> |
| 209 | <li class="blockList"><a name="constructor.detail"> |
| 210 | <!-- --> |
| 211 | </a> |
| 212 | <h3>Constructor Detail</h3> |
| 213 | <a name="SkiaImageRegionDecoder--"> |
| 214 | <!-- --> |
| 215 | </a> |
| 216 | <ul class="blockList"> |
| 217 | <li class="blockList"> |
| 218 | <h4>SkiaImageRegionDecoder</h4> |
| 219 | <pre>public SkiaImageRegionDecoder()</pre> |
| 220 | </li> |
| 221 | </ul> |
| 222 | <a name="SkiaImageRegionDecoder-android.graphics.Bitmap.Config-"> |
| 223 | <!-- --> |
| 224 | </a> |
| 225 | <ul class="blockListLast"> |
| 226 | <li class="blockList"> |
| 227 | <h4>SkiaImageRegionDecoder</h4> |
David Morrissey | fed3d78 | 2017-12-04 08:03:42 +0000 | [diff] [blame] | 228 | <pre>public SkiaImageRegionDecoder(<a href="https://developer.android.com/reference/android/graphics/Bitmap.Config.html?is-external=true" title="class or interface in android.graphics">Bitmap.Config</a> bitmapConfig)</pre> |
David Morrissey | d94cb88 | 2017-11-16 14:55:41 +0000 | [diff] [blame] | 229 | </li> |
| 230 | </ul> |
| 231 | </li> |
| 232 | </ul> |
| 233 | <!-- ============ METHOD DETAIL ========== --> |
| 234 | <ul class="blockList"> |
| 235 | <li class="blockList"><a name="method.detail"> |
| 236 | <!-- --> |
| 237 | </a> |
| 238 | <h3>Method Detail</h3> |
| 239 | <a name="init-android.content.Context-android.net.Uri-"> |
| 240 | <!-- --> |
| 241 | </a> |
| 242 | <ul class="blockList"> |
| 243 | <li class="blockList"> |
| 244 | <h4>init</h4> |
David Morrissey | fed3d78 | 2017-12-04 08:03:42 +0000 | [diff] [blame] | 245 | <pre>public <a href="https://developer.android.com/reference/android/graphics/Point.html?is-external=true" title="class or interface in android.graphics">Point</a> init(<a href="https://developer.android.com/reference/android/content/Context.html?is-external=true" title="class or interface in android.content">Context</a> context, |
| 246 | <a href="https://developer.android.com/reference/android/net/Uri.html?is-external=true" title="class or interface in android.net">Uri</a> uri) |
| 247 | throws <a href="https://developer.android.com/reference/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></pre> |
David Morrissey | d94cb88 | 2017-11-16 14:55:41 +0000 | [diff] [blame] | 248 | <div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="../../../../../com/davemorrissey/labs/subscaleview/decoder/ImageRegionDecoder.html#init-android.content.Context-android.net.Uri-">ImageRegionDecoder</a></code></span></div> |
David Morrissey | c2d55e0 | 2017-12-03 09:43:51 +0000 | [diff] [blame] | 249 | <div class="block">Initialise the decoder. When possible, perform initial setup work once in this method. The |
| 250 | dimensions of the image must be returned. The URI can be in one of the following formats: |
| 251 | <br> |
| 252 | File: <code>file:///scard/picture.jpg</code> |
| 253 | <br> |
| 254 | Asset: <code>file:///android_asset/picture.png</code> |
| 255 | <br> |
| 256 | Resource: <code>android.resource://com.example.app/drawable/picture</code></div> |
David Morrissey | d94cb88 | 2017-11-16 14:55:41 +0000 | [diff] [blame] | 257 | <dl> |
| 258 | <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| 259 | <dd><code><a href="../../../../../com/davemorrissey/labs/subscaleview/decoder/ImageRegionDecoder.html#init-android.content.Context-android.net.Uri-">init</a></code> in interface <code><a href="../../../../../com/davemorrissey/labs/subscaleview/decoder/ImageRegionDecoder.html" title="interface in com.davemorrissey.labs.subscaleview.decoder">ImageRegionDecoder</a></code></dd> |
| 260 | <dt><span class="paramLabel">Parameters:</span></dt> |
| 261 | <dd><code>context</code> - Application context. A reference may be held, but must be cleared on recycle.</dd> |
| 262 | <dd><code>uri</code> - URI of the image.</dd> |
| 263 | <dt><span class="returnLabel">Returns:</span></dt> |
| 264 | <dd>Dimensions of the image.</dd> |
| 265 | <dt><span class="throwsLabel">Throws:</span></dt> |
David Morrissey | fed3d78 | 2017-12-04 08:03:42 +0000 | [diff] [blame] | 266 | <dd><code><a href="https://developer.android.com/reference/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></code> - if initialisation fails.</dd> |
David Morrissey | d94cb88 | 2017-11-16 14:55:41 +0000 | [diff] [blame] | 267 | </dl> |
| 268 | </li> |
| 269 | </ul> |
| 270 | <a name="decodeRegion-android.graphics.Rect-int-"> |
| 271 | <!-- --> |
| 272 | </a> |
| 273 | <ul class="blockList"> |
| 274 | <li class="blockList"> |
| 275 | <h4>decodeRegion</h4> |
David Morrissey | fed3d78 | 2017-12-04 08:03:42 +0000 | [diff] [blame] | 276 | <pre>public <a href="https://developer.android.com/reference/android/graphics/Bitmap.html?is-external=true" title="class or interface in android.graphics">Bitmap</a> decodeRegion(<a href="https://developer.android.com/reference/android/graphics/Rect.html?is-external=true" title="class or interface in android.graphics">Rect</a> sRect, |
| 277 | int sampleSize)</pre> |
David Morrissey | d94cb88 | 2017-11-16 14:55:41 +0000 | [diff] [blame] | 278 | <div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="../../../../../com/davemorrissey/labs/subscaleview/decoder/ImageRegionDecoder.html#decodeRegion-android.graphics.Rect-int-">ImageRegionDecoder</a></code></span></div> |
David Morrissey | c2d55e0 | 2017-12-03 09:43:51 +0000 | [diff] [blame] | 279 | <div class="block"><p> |
| 280 | Decode a region of the image with the given sample size. This method is called off the UI |
| 281 | thread so it can safely load the image on the current thread. It is called from |
David Morrissey | fed3d78 | 2017-12-04 08:03:42 +0000 | [diff] [blame] | 282 | <a href="https://developer.android.com/reference/android/os/AsyncTask.html?is-external=true" title="class or interface in android.os"><code>AsyncTask</code></a>s running in an executor that may have multiple threads, so |
David Morrissey | c2d55e0 | 2017-12-03 09:43:51 +0000 | [diff] [blame] | 283 | implementations must be thread safe. Adding <code>synchronized</code> to the method signature |
| 284 | is the simplest way to achieve this, but bear in mind the <a href="../../../../../com/davemorrissey/labs/subscaleview/decoder/ImageRegionDecoder.html#recycle--"><code>ImageRegionDecoder.recycle()</code></a> method can be |
| 285 | called concurrently. |
| 286 | </p><p> |
| 287 | See <a href="../../../../../com/davemorrissey/labs/subscaleview/decoder/SkiaImageRegionDecoder.html" title="class in com.davemorrissey.labs.subscaleview.decoder"><code>SkiaImageRegionDecoder</code></a> and <a href="../../../../../com/davemorrissey/labs/subscaleview/decoder/SkiaPooledImageRegionDecoder.html" title="class in com.davemorrissey.labs.subscaleview.decoder"><code>SkiaPooledImageRegionDecoder</code></a> for examples of |
| 288 | internal locking and synchronization. |
| 289 | </p></div> |
David Morrissey | d94cb88 | 2017-11-16 14:55:41 +0000 | [diff] [blame] | 290 | <dl> |
| 291 | <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| 292 | <dd><code><a href="../../../../../com/davemorrissey/labs/subscaleview/decoder/ImageRegionDecoder.html#decodeRegion-android.graphics.Rect-int-">decodeRegion</a></code> in interface <code><a href="../../../../../com/davemorrissey/labs/subscaleview/decoder/ImageRegionDecoder.html" title="interface in com.davemorrissey.labs.subscaleview.decoder">ImageRegionDecoder</a></code></dd> |
| 293 | <dt><span class="paramLabel">Parameters:</span></dt> |
| 294 | <dd><code>sRect</code> - Source image rectangle to decode.</dd> |
| 295 | <dd><code>sampleSize</code> - Sample size.</dd> |
| 296 | <dt><span class="returnLabel">Returns:</span></dt> |
| 297 | <dd>The decoded region. It is safe to return null if decoding fails.</dd> |
| 298 | </dl> |
| 299 | </li> |
| 300 | </ul> |
| 301 | <a name="isReady--"> |
| 302 | <!-- --> |
| 303 | </a> |
| 304 | <ul class="blockList"> |
| 305 | <li class="blockList"> |
| 306 | <h4>isReady</h4> |
| 307 | <pre>public boolean isReady()</pre> |
| 308 | <div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="../../../../../com/davemorrissey/labs/subscaleview/decoder/ImageRegionDecoder.html#isReady--">ImageRegionDecoder</a></code></span></div> |
| 309 | <div class="block">Status check. Should return false before initialisation and after recycle.</div> |
| 310 | <dl> |
| 311 | <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| 312 | <dd><code><a href="../../../../../com/davemorrissey/labs/subscaleview/decoder/ImageRegionDecoder.html#isReady--">isReady</a></code> in interface <code><a href="../../../../../com/davemorrissey/labs/subscaleview/decoder/ImageRegionDecoder.html" title="interface in com.davemorrissey.labs.subscaleview.decoder">ImageRegionDecoder</a></code></dd> |
| 313 | <dt><span class="returnLabel">Returns:</span></dt> |
| 314 | <dd>true if the decoder is ready to be used.</dd> |
| 315 | </dl> |
| 316 | </li> |
| 317 | </ul> |
| 318 | <a name="recycle--"> |
| 319 | <!-- --> |
| 320 | </a> |
| 321 | <ul class="blockListLast"> |
| 322 | <li class="blockList"> |
| 323 | <h4>recycle</h4> |
| 324 | <pre>public void recycle()</pre> |
| 325 | <div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="../../../../../com/davemorrissey/labs/subscaleview/decoder/ImageRegionDecoder.html#recycle--">ImageRegionDecoder</a></code></span></div> |
| 326 | <div class="block">This method will be called when the decoder is no longer required. It should clean up any resources still in use.</div> |
| 327 | <dl> |
| 328 | <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| 329 | <dd><code><a href="../../../../../com/davemorrissey/labs/subscaleview/decoder/ImageRegionDecoder.html#recycle--">recycle</a></code> in interface <code><a href="../../../../../com/davemorrissey/labs/subscaleview/decoder/ImageRegionDecoder.html" title="interface in com.davemorrissey.labs.subscaleview.decoder">ImageRegionDecoder</a></code></dd> |
| 330 | </dl> |
| 331 | </li> |
| 332 | </ul> |
| 333 | </li> |
| 334 | </ul> |
| 335 | </li> |
| 336 | </ul> |
| 337 | </div> |
| 338 | </div> |
| 339 | <!-- ========= END OF CLASS DATA ========= --> |
| 340 | <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| 341 | <div class="bottomNav"><a name="navbar.bottom"> |
| 342 | <!-- --> |
| 343 | </a> |
| 344 | <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| 345 | <a name="navbar.bottom.firstrow"> |
| 346 | <!-- --> |
| 347 | </a> |
| 348 | <ul class="navList" title="Navigation"> |
| 349 | <li><a href="../../../../../overview-summary.html">Overview</a></li> |
| 350 | <li><a href="package-summary.html">Package</a></li> |
| 351 | <li class="navBarCell1Rev">Class</li> |
| 352 | <li><a href="package-tree.html">Tree</a></li> |
| 353 | <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> |
| 354 | <li><a href="../../../../../index-all.html">Index</a></li> |
| 355 | <li><a href="../../../../../help-doc.html">Help</a></li> |
| 356 | </ul> |
| 357 | </div> |
| 358 | <div class="subNav"> |
| 359 | <ul class="navList"> |
| 360 | <li><a href="../../../../../com/davemorrissey/labs/subscaleview/decoder/SkiaImageDecoder.html" title="class in com.davemorrissey.labs.subscaleview.decoder"><span class="typeNameLink">Prev Class</span></a></li> |
David Morrissey | dea2a39 | 2017-12-02 08:46:32 +0000 | [diff] [blame] | 361 | <li><a href="../../../../../com/davemorrissey/labs/subscaleview/decoder/SkiaPooledImageRegionDecoder.html" title="class in com.davemorrissey.labs.subscaleview.decoder"><span class="typeNameLink">Next Class</span></a></li> |
David Morrissey | d94cb88 | 2017-11-16 14:55:41 +0000 | [diff] [blame] | 362 | </ul> |
| 363 | <ul class="navList"> |
| 364 | <li><a href="../../../../../index.html?com/davemorrissey/labs/subscaleview/decoder/SkiaImageRegionDecoder.html" target="_top">Frames</a></li> |
| 365 | <li><a href="SkiaImageRegionDecoder.html" target="_top">No Frames</a></li> |
| 366 | </ul> |
| 367 | <ul class="navList" id="allclasses_navbar_bottom"> |
| 368 | <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> |
| 369 | </ul> |
| 370 | <div> |
| 371 | <script type="text/javascript"><!-- |
| 372 | allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| 373 | if(window==top) { |
| 374 | allClassesLink.style.display = "block"; |
| 375 | } |
| 376 | else { |
| 377 | allClassesLink.style.display = "none"; |
| 378 | } |
| 379 | //--> |
| 380 | </script> |
| 381 | </div> |
| 382 | <div> |
| 383 | <ul class="subNavList"> |
| 384 | <li>Summary: </li> |
| 385 | <li>Nested | </li> |
| 386 | <li>Field | </li> |
| 387 | <li><a href="#constructor.summary">Constr</a> | </li> |
| 388 | <li><a href="#method.summary">Method</a></li> |
| 389 | </ul> |
| 390 | <ul class="subNavList"> |
| 391 | <li>Detail: </li> |
| 392 | <li>Field | </li> |
| 393 | <li><a href="#constructor.detail">Constr</a> | </li> |
| 394 | <li><a href="#method.detail">Method</a></li> |
| 395 | </ul> |
| 396 | </div> |
| 397 | <a name="skip.navbar.bottom"> |
| 398 | <!-- --> |
| 399 | </a></div> |
| 400 | <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| 401 | </body> |
| 402 | </html> |