[
  {
    "path": ".editorconfig",
    "content": "[*]\nindent_size = 2\nmax_line_length = off\ninsert_final_newline = true\n\n[*.{kt, kts}]\nkotlin_imports_layout = ascii\n\n"
  },
  {
    "path": ".github/FUNDING.yml",
    "content": "# These are supported funding model platforms\n\ngithub: wasabeef # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]\npatreon: # Replace with a single Patreon username\nopen_collective: # Replace with a single Open Collective username\nko_fi: # Replace with a single Ko-fi username\ntidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel\ncommunity_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry\nliberapay: # Replace with a single Liberapay username\nissuehunt: # Replace with a single IssueHunt username\notechie: # Replace with a single Otechie username\ncustom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE.md",
    "content": "# Future Task\n\n## What is the motivation?\n\n## What kind of solution can be considered?\n\n## What do you want to discuss?\n\n*Please add relevant labels*\n\n-----\n\n# Bug Reporting\n\n## Steps to Reproduce\n\n## Actual Results (include screenshots)\n\n## Expected Results (include screenshots)\n\n## URL\n\n## OS details\n\n- Device:\n- OS:\n\n*Please add relevant labels*\n"
  },
  {
    "path": ".github/PULL_REQUEST_TEMPLATE.md",
    "content": "## What does this change?\n\n## What is the value of this and can you measure success?\n\n## Screenshots\n\n"
  },
  {
    "path": ".gitignore",
    "content": "# Mac OS\n.DS_store\n\n# Built application files\n*.apk\n*.ap_\n\n# Files for the ART/Dalvik VM\n*.dex\n\n# Java class files\n*.class\n\n# Generated files\nbin/\ngen/\nout/\n\n# Gradle files\n.gradle/\nbuild/\n\n# Local configuration file (sdk path, etc)\nlocal.properties\n\n# Proguard folder generated by Eclipse\nproguard/\n\n# Log Files\n*.log\n\n# Android Studio Navigation editor temp files\n.navigation/\n\n# Android Studio captures folder\ncaptures/\n\n# IntelliJ\n*.iml\n.idea/workspace.xml\n.idea/tasks.xml\n.idea/gradle.xml\n.idea/assetWizardSettings.xml\n.idea/dictionaries\n.idea/libraries\n.idea/caches\n.idea/misc.xml\n.idea/modules.xml\n.idea/navEditor.xml\n.idea/markdown*\n.idea/jarRepositories.xml\n.idea/inspectionProfiles/Project_Default.xml\n.idea/compiler.xml\nprojectFilesBackup/\n\n# Keystore files\n# Uncomment the following line if you do not want to check your keystore files in.\n#*.jks\n\n# External native build folder generated in Android Studio 2.2 and later\n.externalNativeBuild\n\n# Google Services (e.g. APIs or Firebase)\ngoogle-services.json\n\n"
  },
  {
    "path": ".idea/codeStyles/Project.xml",
    "content": "<component name=\"ProjectCodeStyleConfiguration\">\n  <code_scheme name=\"Project\" version=\"173\">\n    <codeStyleSettings language=\"XML\">\n      <indentOptions>\n        <option name=\"CONTINUATION_INDENT_SIZE\" value=\"4\" />\n      </indentOptions>\n      <arrangement>\n        <rules>\n          <section>\n            <rule>\n              <match>\n                <AND>\n                  <NAME>xmlns:android</NAME>\n                  <XML_ATTRIBUTE />\n                  <XML_NAMESPACE>^$</XML_NAMESPACE>\n                </AND>\n              </match>\n            </rule>\n          </section>\n          <section>\n            <rule>\n              <match>\n                <AND>\n                  <NAME>xmlns:.*</NAME>\n                  <XML_ATTRIBUTE />\n                  <XML_NAMESPACE>^$</XML_NAMESPACE>\n                </AND>\n              </match>\n              <order>BY_NAME</order>\n            </rule>\n          </section>\n          <section>\n            <rule>\n              <match>\n                <AND>\n                  <NAME>.*:id</NAME>\n                  <XML_ATTRIBUTE />\n                  <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>\n                </AND>\n              </match>\n            </rule>\n          </section>\n          <section>\n            <rule>\n              <match>\n                <AND>\n                  <NAME>.*:name</NAME>\n                  <XML_ATTRIBUTE />\n                  <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>\n                </AND>\n              </match>\n            </rule>\n          </section>\n          <section>\n            <rule>\n              <match>\n                <AND>\n                  <NAME>name</NAME>\n                  <XML_ATTRIBUTE />\n                  <XML_NAMESPACE>^$</XML_NAMESPACE>\n                </AND>\n              </match>\n            </rule>\n          </section>\n          <section>\n            <rule>\n              <match>\n                <AND>\n                  <NAME>style</NAME>\n                  <XML_ATTRIBUTE />\n                  <XML_NAMESPACE>^$</XML_NAMESPACE>\n                </AND>\n              </match>\n            </rule>\n          </section>\n          <section>\n            <rule>\n              <match>\n                <AND>\n                  <NAME>.*</NAME>\n                  <XML_ATTRIBUTE />\n                  <XML_NAMESPACE>^$</XML_NAMESPACE>\n                </AND>\n              </match>\n              <order>BY_NAME</order>\n            </rule>\n          </section>\n          <section>\n            <rule>\n              <match>\n                <AND>\n                  <NAME>.*</NAME>\n                  <XML_ATTRIBUTE />\n                  <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>\n                </AND>\n              </match>\n              <order>ANDROID_ATTRIBUTE_ORDER</order>\n            </rule>\n          </section>\n          <section>\n            <rule>\n              <match>\n                <AND>\n                  <NAME>.*</NAME>\n                  <XML_ATTRIBUTE />\n                  <XML_NAMESPACE>.*</XML_NAMESPACE>\n                </AND>\n              </match>\n              <order>BY_NAME</order>\n            </rule>\n          </section>\n        </rules>\n      </arrangement>\n    </codeStyleSettings>\n  </code_scheme>\n</component>"
  },
  {
    "path": ".idea/codeStyles/codeStyleConfig.xml",
    "content": "<component name=\"ProjectCodeStyleConfiguration\">\n  <state>\n    <option name=\"PREFERRED_PROJECT_CODE_STYLE\" value=\"Default\" />\n  </state>\n</component>"
  },
  {
    "path": ".idea/encodings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"Encoding\" addBOMForNewFiles=\"with NO BOM\" />\n</project>"
  },
  {
    "path": ".idea/runConfigurations.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"RunConfigurationProducerService\">\n    <option name=\"ignoredProducers\">\n      <set>\n        <option value=\"com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer\" />\n        <option value=\"org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer\" />\n        <option value=\"org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer\" />\n        <option value=\"org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer\" />\n      </set>\n    </option>\n  </component>\n</project>"
  },
  {
    "path": ".idea/vcs.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"VcsDirectoryMappings\">\n    <mapping directory=\"\" vcs=\"Git\" />\n  </component>\n</project>"
  },
  {
    "path": "CHANGELOG.md",
    "content": "Change Log\n==========\n\nVersion 4.3.0 *(2020-09-27)*\n----------------------------\n\nFeature\n- Remove support v8 renderscript (Please use BlurTransformation)\n\nUpdate\n- minSdkVersion -> 21\n- GPUImage -> 2.1.0\n- Cleanup codes\n\nVersion 4.2.0 *(2020-09-15)*\n----------------------------\n\nUpdate:\n- Compile & Target SDK Version 28 -> 30\n- GPUImage 2.0.3 -> 2.0.4\n- Glide 4.9.0 -> 4.11.0\n\nBugfix:\n- RoundedCornersTransformation with DIAGONAL_FROM_TOP_LEFT does not work [#178](https://github.com/wasabeef/glide-transformations/pull/178)\n\nVersion 4.1.0 *(2019-08-15)*\n----------------------------\n\nAdd:\n- Support to CropCircle with Border [#136](https://github.com/wasabeef/glide-transformations/pull/136)\n\nUpdate:\n- Glide to 4.9.0\n- Android Gradle plugin to 3.6.0-alpha05\n- Kotlin to 1.3.41\t\n\nBug Fix:\n- Fix diffrent density [#147](https://github.com/wasabeef/glide-transformations/pull/147)\n\n\nVersion 4.0.1 *(2018-11-20)*\n----------------------------\n\nAdd:\n- consumerProguardFiles setting\n\nVersion 4.0.0 *(2018-11-16)*\n----------------------------\n\nUpdate:\n- Migrate to AndroidX\n- Remove novoda-bintray-plugin\n\nVersion 3.3.0 *(2018-04-23)*\n----------------------------\n\nUpdate:  \n- Support Library 27.1.0 -> 27.1.1  \n- Glide 4.6.1 -> 4.7.1  \n\nFeature:  \n- SupportRSBlurTransformation [#125](https://github.com/wasabeef/glide-transformations/pull/125)   \n  it's using RenderScript support mode but can you choose to use or not.   \n  Thank you [@fougere-mike](https://github.com/fougere-mike)  \n\nBug Fix: \n- Set detail of Cache key [#119](https://github.com/wasabeef/glide-transformations/issues/119)     \n\nVersion 3.2.0 *(2018-04-10)*\n----------------------------\n\nUpdate:  \n- Support Library 27.0.2 -> 27.1.0  \n\nBug Fix:  \n- We quit use the RenderScript [#120](https://github.com/wasabeef/glide-transformations/issues/120)     \n\nVersion 3.1.1 *(2018-02-13)*\n----------------------------\n\nUpdate:  \n- Glide 4.5.0 -> 4.6.1  \n\nBug Fix:  \n- Fix settings fot proguard.\n\nVersion 3.1.0 *(2018-01-26)*\n----------------------------\n\nUpdate:  \n- Compile & Target SDK Version 25 -> 27  \n- Build Tools 26.0.1 -> 27.0.3  \n- Support Library 25.3.1 -> 27.0.2  \n- Glide 4.0.0 -> 4.5.0  \n\nBug Fix:  \n- [Implement equals() and hashCode() methods #105](https://github.com/wasabeef/glide-transformations/pull/105)  \n- Use RenderScript#releaseAllContexts  \n\nVersion 3.0.1 *(2017-09-08)*\n----------------------------\n\nBug Fix:\n- [Deleted a setting for DexGuard #86](https://github.com/wasabeef/glide-transformations/issues/86)\n\nVersion 3.0.0 *(2017-09-06)*\n----------------------------\n\nUpdate:\n- Build Tools 25.0.2 -> 26.0.1\n- Min SDK Version 11 -> 14\n- Glide 3.7.0 -> 4.0.0\n\nFeature: \n- Supported Glide 4.0.0\n\nVersion 2.0.2 *(2017-03-17)*\n----------------------------\n\nUpdate:\n- Compile & Target SDK Version 23 -> 25\n- Build Tools 23.0.2 -> 25.0.2\n- Support Library 23.2.1 -> 25.3.0\n- GPUImage for Android 1.3.0 -> 1.4.1\n\nBug Fix:\n- [Additional resource cleanup in RSBlur #45](https://github.com/wasabeef/glide-transformations/pull/45)\n \nVersion 2.0.1 *(2016-04-21)*\n----------------------------\n\nFix:\n [#35](https://github.com/wasabeef/glide-transformations/issues/35)\n RSInvalidStateException\n\nVersion 2.0.0 *(2016-03-02)*\n----------------------------\n\nSay v8.RenderScript goodbye\n\nVersion 1.4.0 *(2016-02-28)*\n----------------------------\n\nfix Issue [#29](https://github.com/wasabeef/glide-transformations/issues/29)\n Use FastBlur as a fallback upon RenderScript failure.\n\nVersion 1.3.1 *(2015-11-27)*\n----------------------------\n\nChange the renderscriptTargetApi down to 20.  \n Warning:Renderscript support mode is not currently supported with renderscript target 21+\n\nfix: memory leak.\n\nVersion 1.3.0 *(2015-11-10)*\n----------------------------\n\nadd round corner type to RoundedCornersTransformation.  \nThanks to [kaelaela](https://github.com/kaelaela)\n\nVersion 1.2.1 *(2015-09-18)*\n----------------------------\n\nMerged NinePatchMaskTransformation to MaskTransformation.\n\nVersion 1.2.0 *(2015-09-16)*\n----------------------------\n\nadd new transformations MaskTransformation and NinePatchMaskTransformation.  \nThanks to [start141](https://github.com/start141)\n\nVersion 1.1.0 *(2015-09-05)*\n----------------------------\n\nAdjustment of default parameters.\n\nVersion 1.0.8 *(2015-07-24)*\n----------------------------\n\nadd DownSampling to BlurTransform\n\nVersion 1.0.7 *(2015-07-18)*\n----------------------------\n\nBug fix : Blur not working.\n\nVersion 1.0.6 *(2015-04-23)*\n----------------------------\n\nadd: CropType(Top, Center, Bottom) for CropTransformation.\n\nVersion 1.0.5 *(2015-03-09)*\n----------------------------\n\nBug fix: Transparency.\n\nVersion 1.0.4 *(2015-02-13)*\n----------------------------\n\nBug fix : remove original bitmap resource recycling.\n\nVersion 1.0.3 *(2015-02-05)*\n----------------------------\n\nBug fix\n\nVersion 1.0.2 *(2015-02-04)*\n----------------------------\n\nRefactor: use BimapPool\n\nVersion 1.0.1 *(2015-01-21)*\n----------------------------\n\nfix: Blur Transformation now woking at Android 4.3\nadd: GPUImage to Gradle dependency \n\nVersion 1.0.0 *(2015-01-12)*\n----------------------------\n\nInitial release.\n"
  },
  {
    "path": "LICENSE",
    "content": "Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"{}\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright {yyyy} {name of copyright owner}\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n\n"
  },
  {
    "path": "README.md",
    "content": "Glide Transformations\n======================\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-glide--transformations-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/1363)\n[![License](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/jp.wasabeef/glide-transformations/badge.svg)](https://search.maven.org/artifact/jp.wasabeef/glide-transformations)\n\nAn Android transformation library providing a variety of image transformations for [Glide](https://github.com/bumptech/glide).\n\nPlease feel free to use this.\n\n\n#### Are you using Picasso or Fresco?\n[Picasso Transformations](https://github.com/wasabeef/picasso-transformations)  \n[Fresco Processors](https://github.com/wasabeef/fresco-processors)\n\n# Demo\n\n### Original Image\n<img src=\"art/demo-org.jpg\" width=\"30%\">\n\n### Transformations\n<img src=\"art/demo.gif\" width=\"50%\">\n\n# How do I use it?\n\n## Step 1\n\n#### Gradle\n```groovy\nrepositories {\n  mavenCentral()\n}\n\ndependencies {\n  implementation 'jp.wasabeef:glide-transformations:4.3.0'\n  // If you want to use the GPU Filters\n  implementation 'jp.co.cyberagent.android:gpuimage:2.1.0'\n}\n```\n\n## Step 2\n\nSet Glide Transform.\n\n```kotlin\nGlide.with(this).load(R.drawable.demo)\n  .apply(RequestOptions.bitmapTransform(BlurTransformation(25, 3)))\n  .into(imageView)\n```\n\n## Advanced Step 3\n\nYou can set a multiple transformations.\n\n```kotlin\nval multi = MultiTransformation<Bitmap>(\n  BlurTransformation(25),\n  RoundedCornersTransformation(128, 0, CornerType.BOTTOM))))\nGlide.with(this).load(R.drawable.demo)\n  .apply(RequestOptions.bitmapTransform(multi))\n  .into(imageView))\n```\n\n## Transformations\n\n### Crop\n- `CropTransformation`\n- `CropCircleTransformation`\n- `CropCircleWithBorderTransformation`\n- `CropSquareTransformation`\n- `RoundedCornersTransformation`\n\n### Color\n- `ColorFilterTransformation`\n- `GrayscaleTransformation`\n\n### Blur\n- `BlurTransformation`\n\n### Mask\n- `MaskTransformation`\n\n### GPU Filter (use [GPUImage](https://github.com/CyberAgent/android-gpuimage))\n**Will require add dependencies for GPUImage.**  \n\n- `ToonFilterTransformation`\n- `SepiaFilterTransformation`\n- `ContrastFilterTransformation`\n- `InvertFilterTransformation`\n- `PixelationFilterTransformation`\n- `SketchFilterTransformation`\n- `SwirlFilterTransformation`\n- `BrightnessFilterTransformation`\n- `KuwaharaFilterTransformation`\n- `VignetteFilterTransformation`\n\n\nApplications using Glide Transformations\n---\n\nPlease [ping](mailto:dadadada.chop@gmail.com) me or send a pull request if you would like to be added here.\n\nIcon | Application\n------------ | -------------\n<img src=\"https://lh6.ggpht.com/6zKH_uQY1bxCwXL4DLo_uoFEOXdShi3BgmN6XRHlaJ-oA1svmq6y1PZkmO50nWQn2Lg=w300-rw\" width=\"48\" height=\"48\" /> | [Ameba Ownd](https://play.google.com/store/apps/details?id=jp.co.cyberagent.madrid)\n<img src=\"https://lh3.googleusercontent.com/ZOrekp-ho-ecWG1TyvuOs0LoB5M4QYWCCLS5lFbAHhp_SklSd06544ENG3uC97zGWes=w300-rw\" width=\"48\" height=\"48\" /> | [AbemaTV](https://play.google.com/store/apps/details?id=tv.abema)\n<img src=\"https://lh3.googleusercontent.com/eikxMAKKMU2O-rV-oUg04dGp-O4Aoje91kffDlnCB_3DCIPDzzADxdBOdPCW18Lmqw=w300-rw\" width=\"48\" height=\"48\" /> | [TV Time](https://play.google.com/store/apps/details?id=com.tozelabs.tvshowtime)\n<img src=\"https://play-lh.googleusercontent.com/sGt1rxE4naYmO_6sCquGLa5zHeh_3AZQGtBKhU8PGuXDa-MeUK25aSI-iZJlMDUVli9c=s300-rw\" width=\"48\" height=\"48\" /> | [Christmas Radio](https://play.google.com/store/apps/details?id=nl.netwaves.christmasradio)\n\n\n\nDeveloped By\n-------\nDaichi Furiya (Wasabeef) - <dadadada.chop@gmail.com>\n\n<a href=\"https://twitter.com/wasabeef_jp\">\n<img alt=\"Follow me on Twitter\"\nsrc=\"https://raw.githubusercontent.com/wasabeef/art/master/twitter.png\" width=\"75\"/>\n</a>\n\nContributions\n-------\n\nAny contributions are welcome!\n\nContributors\n-------\n\n* [start141](https://github.com/start141)\n* [squeeish](https://github.com/squeeish)\n\nThanks\n-------\n\n* Inspired by `Picasso Transformations` in [TannerPerrien](https://github.com/TannerPerrien).\n\nLicense\n-------\n\n    Copyright (C) 2020 Wasabeef\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n"
  },
  {
    "path": "build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n  ext {\n    kotlin_version = '1.3.72'\n    glide_version = '4.11.0'\n    gpuimage_version = '2.1.0'\n  }\n\n  repositories {\n    google()\n    jcenter()\n  }\n  dependencies {\n    classpath 'com.android.tools.build:gradle:4.2.0-beta04'\n    classpath \"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version\"\n\n    // TODO: Close JCenter on May 1st https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/\n//    classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5'\n//    classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'\n  }\n}\n\nallprojects {\n  repositories {\n    google()\n    mavenCentral()\n    jcenter()\n  }\n}\n"
  },
  {
    "path": "example/build.gradle",
    "content": "apply plugin: 'com.android.application'\napply plugin: 'kotlin-android'\napply plugin: 'kotlin-kapt'\n\nandroid {\n  compileSdkVersion COMPILE_SDK_VERSION as int\n\n  defaultConfig {\n    minSdkVersion MIN_SDK_VERSION as int\n    targetSdkVersion TARGET_SDK_VERSION as int\n    versionCode VERSION_CODE as int\n    versionName VERSION_NAME\n  }\n\n  // SigningConfigs\n  apply from: '../signingConfigs/debug.gradle', to: android\n\n  buildTypes {\n    debug {\n      debuggable true\n      signingConfig signingConfigs.debug\n    }\n    release {\n      debuggable false\n      zipAlignEnabled true\n      minifyEnabled true\n      shrinkResources true\n    }\n  }\n}\n\nrepositories {\n//     maven { url = \"https://oss.sonatype.org/content/repositories/snapshots\"}\n}\n\ndependencies {\n//  implementation project(':transformations')\n  implementation 'jp.wasabeef:glide-transformations:4.3.0'\n  implementation \"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version\"\n  implementation \"com.github.bumptech.glide:glide:$glide_version\"\n  kapt \"com.github.bumptech.glide:compiler:$glide_version\"\n  implementation \"jp.co.cyberagent.android:gpuimage:$gpuimage_version\"\n  implementation \"androidx.appcompat:appcompat:1.3.0-beta01\"\n  implementation \"androidx.recyclerview:recyclerview:1.2.0-beta01\"\n  implementation 'androidx.constraintlayout:constraintlayout:2.0.4'\n}\n"
  },
  {
    "path": "example/proguard-rules.pro",
    "content": ""
  },
  {
    "path": "example/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  xmlns:tools=\"http://schemas.android.com/tools\"\n  package=\"jp.wasabeef.example.glide\">\n\n  <application\n    android:allowBackup=\"true\"\n    android:icon=\"@drawable/ic_launcher\"\n    android:label=\"@string/app_name\"\n    android:theme=\"@style/AppTheme\"\n    tools:ignore=\"GoogleAppIndexingWarning\">\n    <activity\n      android:name=\".MainActivity\"\n      android:label=\"@string/app_name\">\n      <intent-filter>\n        <action android:name=\"android.intent.action.MAIN\" />\n\n        <category android:name=\"android.intent.category.LAUNCHER\" />\n      </intent-filter>\n    </activity>\n  </application>\n\n</manifest>\n"
  },
  {
    "path": "example/src/main/java/jp/wasabeef/example/glide/Ext.kt",
    "content": "package jp.wasabeef.example.glide\n\n/**\n * Copyright (C) 2020 Wasabeef\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport android.content.res.Resources\n\nval Float.px: Float get() = (this * Resources.getSystem().displayMetrics.density)\n\nval Int.px: Int get() = ((this * Resources.getSystem().displayMetrics.density).toInt())\n"
  },
  {
    "path": "example/src/main/java/jp/wasabeef/example/glide/MainActivity.kt",
    "content": "package jp.wasabeef.example.glide\n\nimport android.os.Bundle\nimport androidx.appcompat.app.AppCompatActivity\nimport androidx.recyclerview.widget.LinearLayoutManager\nimport androidx.recyclerview.widget.RecyclerView\nimport jp.wasabeef.example.glide.MainAdapter.Type.*\n\nclass MainActivity : AppCompatActivity() {\n\n  override fun onCreate(savedInstanceState: Bundle?) {\n    super.onCreate(savedInstanceState)\n    setContentView(R.layout.activity_main)\n\n    findViewById<RecyclerView>(R.id.list).apply {\n      layoutManager = LinearLayoutManager(context)\n      adapter = MainAdapter(context, mutableListOf(\n        Mask, NinePatchMask, RoundedCorners, CropTop, CropCenter, CropBottom, CropSquare, CropCircle,\n        CropCircleWithBorder, Grayscale, BlurLight, BlurDeep, Toon, Sepia, Contrast, Invert,\n        Pixel, Sketch, Swirl, Brightness, Kuawahara, Vignette\n      ))\n    }\n  }\n}\n"
  },
  {
    "path": "example/src/main/java/jp/wasabeef/example/glide/MainAdapter.kt",
    "content": "package jp.wasabeef.example.glide\n\nimport android.content.Context\nimport android.graphics.Bitmap\nimport android.graphics.Color\nimport android.graphics.PointF\nimport android.view.LayoutInflater\nimport android.view.View\nimport android.view.ViewGroup\nimport android.widget.ImageView\nimport android.widget.TextView\nimport androidx.recyclerview.widget.RecyclerView\nimport com.bumptech.glide.Glide\nimport com.bumptech.glide.load.MultiTransformation\nimport com.bumptech.glide.load.resource.bitmap.CenterCrop\nimport com.bumptech.glide.request.RequestOptions.bitmapTransform\nimport com.bumptech.glide.request.RequestOptions.overrideOf\nimport jp.wasabeef.example.glide.MainAdapter.Type.*\nimport jp.wasabeef.glide.transformations.*\nimport jp.wasabeef.glide.transformations.CropTransformation.CropType\nimport jp.wasabeef.glide.transformations.gpu.*\nimport jp.wasabeef.glide.transformations.internal.Utils\n\n/**\n * Created by Wasabeef on 2015/01/11.\n */\nclass MainAdapter(\n  private val context: Context,\n  private val dataSet: MutableList<Type>\n) : RecyclerView.Adapter<MainAdapter.ViewHolder>() {\n\n  enum class Type {\n    Mask,\n    NinePatchMask,\n    CropTop,\n    CropCenter,\n    CropBottom,\n    CropSquare,\n    CropCircle,\n    CropCircleWithBorder,\n    ColorFilter,\n    Grayscale,\n    RoundedCorners,\n    BlurLight,\n    BlurDeep,\n    Toon,\n    Sepia,\n    Contrast,\n    Invert,\n    Pixel,\n    Sketch,\n    Swirl,\n    Brightness,\n    Kuawahara,\n    Vignette\n  }\n\n  override fun getItemCount(): Int {\n    return dataSet.size\n  }\n\n  override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {\n    val v = LayoutInflater.from(context).inflate(R.layout.layout_list_item, parent, false)\n    return ViewHolder(v)\n  }\n\n  override fun onBindViewHolder(holder: ViewHolder, position: Int) {\n\n    when (dataSet[position]) {\n      Mask -> {\n        Glide.with(context)\n          .load(R.drawable.check)\n          .apply(overrideOf(266.px, 252.px))\n          .apply(bitmapTransform(MultiTransformation<Bitmap>(CenterCrop(),\n            MaskTransformation(R.drawable.mask_starfish))))\n          .into(holder.image)\n      }\n      NinePatchMask -> {\n        Glide.with(context)\n          .load(R.drawable.check)\n          .apply(overrideOf(300.px, 200.px))\n          .apply(bitmapTransform(MultiTransformation<Bitmap>(CenterCrop(),\n            MaskTransformation(R.drawable.mask_chat_right))))\n          .into(holder.image)\n      }\n\n      CropTop -> Glide.with(context)\n        .load(R.drawable.demo)\n        .apply(bitmapTransform(CropTransformation(300.px, 100.px, CropType.TOP)))\n        .into(holder.image)\n\n      CropCenter -> Glide.with(context)\n        .load(R.drawable.demo)\n        .apply(bitmapTransform(CropTransformation(300.px, 100.px, CropType.CENTER)))\n        .into(holder.image)\n\n      CropBottom -> Glide.with(context)\n        .load(R.drawable.demo)\n        .apply(bitmapTransform(CropTransformation(300.px, 100.px, CropType.BOTTOM)))\n        .into(holder.image)\n\n      CropSquare -> Glide.with(context)\n        .load(R.drawable.demo)\n        .apply(bitmapTransform(CropSquareTransformation()))\n        .into(holder.image)\n\n      CropCircle -> Glide.with(context)\n        .load(R.drawable.demo)\n        .apply(bitmapTransform(CropCircleTransformation()))\n        .into(holder.image)\n\n      CropCircleWithBorder -> Glide.with(context)\n        .load(R.drawable.demo)\n        .apply(bitmapTransform(\n          CropCircleWithBorderTransformation(Utils.toDp(4), Color.rgb(0, 145, 86))))\n        .into(holder.image)\n\n      ColorFilter -> Glide.with(context)\n        .load(R.drawable.demo)\n        .apply(bitmapTransform(ColorFilterTransformation(Color.argb(80, 255, 0, 0))))\n        .into(holder.image)\n\n      Grayscale -> Glide.with(context)\n        .load(R.drawable.demo)\n        .apply(bitmapTransform(GrayscaleTransformation()))\n        .into(holder.image)\n\n      RoundedCorners -> Glide.with(context)\n        .load(R.drawable.demo)\n        .apply(bitmapTransform(RoundedCornersTransformation(120, 0,\n          RoundedCornersTransformation.CornerType.DIAGONAL_FROM_TOP_LEFT)))\n        .into(holder.image)\n\n      BlurLight -> Glide.with(context)\n        .load(R.drawable.check)\n        .apply(bitmapTransform(BlurTransformation(25)))\n        .into(holder.image)\n\n      BlurDeep -> Glide.with(context)\n        .load(R.drawable.check)\n        .apply(bitmapTransform(BlurTransformation(25, 8)))\n        .into(holder.image)\n\n      Toon -> Glide.with(context)\n        .load(R.drawable.demo)\n        .apply(bitmapTransform(ToonFilterTransformation()))\n        .into(holder.image)\n\n      Sepia -> Glide.with(context)\n        .load(R.drawable.check)\n        .apply(bitmapTransform(SepiaFilterTransformation()))\n        .into(holder.image)\n\n      Contrast -> Glide.with(context)\n        .load(R.drawable.check)\n        .apply(bitmapTransform(ContrastFilterTransformation(2.0f)))\n        .into(holder.image)\n\n      Invert -> Glide.with(context)\n        .load(R.drawable.check)\n        .apply(bitmapTransform(InvertFilterTransformation()))\n        .into(holder.image)\n\n      Pixel -> Glide.with(context)\n        .load(R.drawable.check)\n        .apply(bitmapTransform(PixelationFilterTransformation(20f)))\n        .into(holder.image)\n\n      Sketch -> Glide.with(context)\n        .load(R.drawable.check)\n        .apply(bitmapTransform(SketchFilterTransformation()))\n        .into(holder.image)\n\n      Swirl -> Glide.with(context)\n        .load(R.drawable.check)\n        .apply(bitmapTransform(\n          SwirlFilterTransformation(0.5f, 1.0f, PointF(0.5f, 0.5f))).dontAnimate())\n        .into(holder.image)\n\n      Brightness -> Glide.with(context)\n        .load(R.drawable.check)\n        .apply(bitmapTransform(BrightnessFilterTransformation(0.5f)).dontAnimate())\n        .into(holder.image)\n\n      Kuawahara -> Glide.with(context)\n        .load(R.drawable.check)\n        .apply(bitmapTransform(KuwaharaFilterTransformation(25)).dontAnimate())\n        .into(holder.image)\n\n      Vignette -> Glide.with(context)\n        .load(R.drawable.check)\n        .apply(bitmapTransform(VignetteFilterTransformation(PointF(0.5f, 0.5f),\n          floatArrayOf(0.0f, 0.0f, 0.0f), 0f, 0.75f)).dontAnimate())\n        .into(holder.image)\n    }\n    holder.title.text = dataSet[position].name\n  }\n\n  class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {\n    var image: ImageView = itemView.findViewById(R.id.image)\n    var title: TextView = itemView.findViewById(R.id.title)\n  }\n}\n"
  },
  {
    "path": "example/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.constraintlayout.widget.ConstraintLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n  android:layout_width=\"match_parent\"\n  android:layout_height=\"match_parent\">\n\n  <androidx.recyclerview.widget.RecyclerView\n    android:id=\"@+id/list\"\n    android:layout_width=\"0dp\"\n    android:layout_height=\"0dp\"\n    app:layout_constraintBottom_toBottomOf=\"parent\"\n    app:layout_constraintEnd_toEndOf=\"parent\"\n    app:layout_constraintStart_toStartOf=\"parent\"\n    app:layout_constraintTop_toTopOf=\"parent\" />\n</androidx.constraintlayout.widget.ConstraintLayout>\n"
  },
  {
    "path": "example/src/main/res/layout/layout_list_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.constraintlayout.widget.ConstraintLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n  android:layout_width=\"match_parent\"\n  android:layout_height=\"wrap_content\">\n\n  <ImageView\n    android:id=\"@+id/image\"\n    android:layout_width=\"250dp\"\n    android:layout_height=\"250dp\"\n    android:layout_marginBottom=\"8dp\"\n    android:layout_marginEnd=\"8dp\"\n    android:layout_marginStart=\"8dp\"\n    android:layout_marginTop=\"8dp\"\n    android:cropToPadding=\"false\"\n    android:scaleType=\"fitCenter\"\n    app:layout_constraintBottom_toTopOf=\"@+id/title\"\n    app:layout_constraintEnd_toEndOf=\"parent\"\n    app:layout_constraintStart_toStartOf=\"parent\"\n    app:layout_constraintTop_toTopOf=\"parent\" />\n\n  <TextView\n    android:id=\"@+id/title\"\n    android:layout_width=\"wrap_content\"\n    android:layout_height=\"wrap_content\"\n    android:layout_marginBottom=\"8dp\"\n    android:layout_marginEnd=\"8dp\"\n    android:layout_marginStart=\"8dp\"\n    app:layout_constraintBottom_toBottomOf=\"parent\"\n    app:layout_constraintEnd_toEndOf=\"parent\"\n    app:layout_constraintStart_toStartOf=\"parent\" />\n</androidx.constraintlayout.widget.ConstraintLayout>\n"
  },
  {
    "path": "example/src/main/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n  <color name=\"colorPrimary\">#3F51B5</color>\n  <color name=\"colorPrimaryDark\">#303F9F</color>\n  <color name=\"colorAccent\">#FF4081</color>\n</resources>\n"
  },
  {
    "path": "example/src/main/res/values/dimens.xml",
    "content": "<resources>\n  <!-- Default screen margins, per the Android Design guidelines. -->\n  <dimen name=\"activity_horizontal_margin\">16dp</dimen>\n  <dimen name=\"activity_vertical_margin\">16dp</dimen>\n</resources>\n"
  },
  {
    "path": "example/src/main/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n  <string name=\"app_name\">glide-transformations</string>\n  <string name=\"hello_world\">Hello world!</string>\n  <string name=\"action_settings\">Settings</string>\n\n</resources>\n"
  },
  {
    "path": "example/src/main/res/values/styles.xml",
    "content": "<resources>\n\n  <!-- Base application theme. -->\n  <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar\">\n    <!-- Customize your theme here. -->\n    <item name=\"colorPrimary\">@color/colorPrimary</item>\n    <item name=\"colorPrimaryDark\">@color/colorPrimaryDark</item>\n    <item name=\"colorAccent\">@color/colorAccent</item>\n  </style>\n\n</resources>"
  },
  {
    "path": "example/src/main/res/values-w820dp/dimens.xml",
    "content": "<resources>\n  <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n       (such as screen margins) for screens with more than 820dp of available width. This\n       would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively). -->\n  <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n</resources>\n"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "content": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https://services.gradle.org/distributions/gradle-6.7.1-bin.zip\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "gradle.properties",
    "content": "org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\norg.gradle.parallel=true\norg.gradle.daemon=true\norg.gradle.configureondemand=true\norg.gradle.caching=true\nandroid.enableBuildCache=true\nandroid.useAndroidX=true\n# Use R8 instead of ProGuard for code shrinking.\nandroid.enableR8.fullMode=true\n\nVERSION_NAME=4.3.0\nVERSION_CODE=421\nGROUP=jp.wasabeef\nCOMPILE_SDK_VERSION=30\nTARGET_SDK_VERSION=30\nMIN_SDK_VERSION=21\n"
  },
  {
    "path": "gradlew",
    "content": "#!/usr/bin/env sh\n\n#\n# Copyright 2015 the original author or authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n    ls=`ls -ld \"$PRG\"`\n    link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n    if expr \"$link\" : '/.*' > /dev/null; then\n        PRG=\"$link\"\n    else\n        PRG=`dirname \"$PRG\"`\"/$link\"\n    fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >/dev/null\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >/dev/null\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS='\"-Xmx64m\" \"-Xms64m\"'\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn () {\n    echo \"$*\"\n}\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\n  NONSTOP* )\n    nonstop=true\n    ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n    else\n        JAVACMD=\"$JAVA_HOME/bin/java\"\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=\"java\"\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" -a \"$nonstop\" = \"false\" ] ; then\n    MAX_FD_LIMIT=`ulimit -H -n`\n    if [ $? -eq 0 ] ; then\n        if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n            MAX_FD=\"$MAX_FD_LIMIT\"\n        fi\n        ulimit -n $MAX_FD\n        if [ $? -ne 0 ] ; then\n            warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n        fi\n    else\n        warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n    fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n    GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin or MSYS, switch paths to Windows format before running java\nif [ \"$cygwin\" = \"true\" -o \"$msys\" = \"true\" ] ; then\n    APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n    CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n\n    JAVACMD=`cygpath --unix \"$JAVACMD\"`\n\n    # We build the pattern for arguments to be converted via cygpath\n    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n    SEP=\"\"\n    for dir in $ROOTDIRSRAW ; do\n        ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n        SEP=\"|\"\n    done\n    OURCYGPATTERN=\"(^($ROOTDIRS))\"\n    # Add a user-defined pattern to the cygpath arguments\n    if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n        OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n    fi\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    i=0\n    for arg in \"$@\" ; do\n        CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n        CHECK2=`echo \"$arg\"|egrep -c \"^-\"`                                 ### Determine if an option\n\n        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition\n            eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n        else\n            eval `echo args$i`=\"\\\"$arg\\\"\"\n        fi\n        i=`expr $i + 1`\n    done\n    case $i in\n        0) set -- ;;\n        1) set -- \"$args0\" ;;\n        2) set -- \"$args0\" \"$args1\" ;;\n        3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n        4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n        5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n        6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n        7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n        8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n        9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n    esac\nfi\n\n# Escape application args\nsave () {\n    for i do printf %s\\\\n \"$i\" | sed \"s/'/'\\\\\\\\''/g;1s/^/'/;\\$s/\\$/' \\\\\\\\/\" ; done\n    echo \" \"\n}\nAPP_ARGS=`save \"$@\"`\n\n# Collect all arguments for the java command, following the shell quoting and substitution rules\neval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS \"\\\"-Dorg.gradle.appname=$APP_BASE_NAME\\\"\" -classpath \"\\\"$CLASSPATH\\\"\" org.gradle.wrapper.GradleWrapperMain \"$APP_ARGS\"\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "gradlew.bat",
    "content": "@rem\r\n@rem Copyright 2015 the original author or authors.\r\n@rem\r\n@rem Licensed under the Apache License, Version 2.0 (the \"License\");\r\n@rem you may not use this file except in compliance with the License.\r\n@rem You may obtain a copy of the License at\r\n@rem\r\n@rem      https://www.apache.org/licenses/LICENSE-2.0\r\n@rem\r\n@rem Unless required by applicable law or agreed to in writing, software\r\n@rem distributed under the License is distributed on an \"AS IS\" BASIS,\r\n@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n@rem See the License for the specific language governing permissions and\r\n@rem limitations under the License.\r\n@rem\r\n\r\n@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Resolve any \".\" and \"..\" in APP_HOME to make it shorter.\r\nfor %%i in (\"%APP_HOME%\") do set APP_HOME=%%~fi\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\"-Xmx64m\" \"-Xms64m\"\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %*\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "settings.gradle",
    "content": "include ':example', ':transformations'\n"
  },
  {
    "path": "signingConfigs/debug.gradle",
    "content": "signingConfigs {\n  debug {\n    storeFile file(\"debug.keystore\")\n    storePassword \"android\"\n    keyAlias \"androiddebugkey\"\n    keyPassword \"android\"\n  }\n}\n\n// $ keytool -v -list -keystore\n// Certificate fingerprints:\n// MD5:  28:22:7C:A4:B9:2F:6E:C7:D5:58:62:48:EB:7E:82:C3\n// SHA1: 94:25:A9:50:9C:0E:AE:AA:00:37:5E:D6:71:E3:BC:ED:17:E5:0C:A3\n// SHA256: 04:92:39:09:3D:1C:B6:16:BE:55:58:A3:5F:3B:BB:CB:0B:E7:F1:DA:AA:26:C5:2D:BD:2F:44:CF:AE:47:CF:87\n"
  },
  {
    "path": "transformations/build.gradle",
    "content": "apply plugin: 'com.android.library'\n\nandroid {\n  compileSdkVersion COMPILE_SDK_VERSION as int\n\n  defaultConfig {\n    minSdkVersion MIN_SDK_VERSION as int\n    targetSdkVersion TARGET_SDK_VERSION as int\n\n    consumerProguardFiles 'proguard-rules.txt'\n  }\n}\n\ndependencies {\n  implementation \"com.github.bumptech.glide:glide:$glide_version\"\n  annotationProcessor \"com.github.bumptech.glide:compiler:$glide_version\"\n  compileOnly \"jp.co.cyberagent.android:gpuimage:$gpuimage_version\"\n}\n\next {\n  bintrayRepo = 'maven'\n  bintrayName = 'glide-transformations'\n  bintrayUserOrg = 'wasabeef'\n  publishedGroupId = 'jp.wasabeef'\n  libraryName = 'glide-transformations'\n  artifact = 'glide-transformations'\n  libraryDescription = 'Which provides simple Transformations to Glide'\n  siteUrl = 'https://github.com/wasabeef/glide-transformations'\n  gitUrl = 'https://github.com/wasabeef/glide-transformations.git'\n  issueUrl = 'https://github.com/wasabeef/glide-transformations/issues'\n  libraryVersion = VERSION_NAME\n  developerId = 'wasabeef'\n  developerName = 'Wasabeef'\n  developerEmail = 'dadadada.chop@gmail.com'\n  licenseName = 'The Apache Software License, Version 2.0'\n  licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'\n  allLicenses = [\"Apache-2.0\"]\n}\n\n// TODO: Close JCenter on May 1st https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/\n// apply from: 'https://gist.githubusercontent.com/wasabeef/cf14805bee509baf7461974582f17d26/raw/bintray-v1.gradle'\n// apply from: 'https://gist.githubusercontent.com/wasabeef/cf14805bee509baf7461974582f17d26/raw/install-v1.gradle'\n\napply from: 'https://gist.githubusercontent.com/wasabeef/2f2ae8d97b429e7d967128125dc47854/raw/maven-central-v1.gradle'\n"
  },
  {
    "path": "transformations/proguard-rules.txt",
    "content": "-dontwarn jp.co.cyberagent.android.gpuimage.**\n\n-keep public class * implements com.bumptech.glide.module.GlideModule\n-keep public class * extends com.bumptech.glide.module.AppGlideModule\n-keep public enum com.bumptech.glide.load.ImageHeaderParser$** {\n  **[] $VALUES;\n  public *;\n}\n"
  },
  {
    "path": "transformations/src/androidTest/java/jp/wasabeef/glide/transformations/ApplicationTest.java",
    "content": "package jp.wasabeef.glide.transformations;\n\nimport android.app.Application;\nimport android.test.ApplicationTestCase;\n\n/**\n * <a href=\"http://d.android.com/tools/testing/testing_android.html\">Testing Fundamentals</a>\n */\npublic class ApplicationTest extends ApplicationTestCase<Application> {\n\n  public ApplicationTest() {\n    super(Application.class);\n  }\n}"
  },
  {
    "path": "transformations/src/main/AndroidManifest.xml",
    "content": "<manifest package=\"jp.wasabeef.glide.transformations\" />\n"
  },
  {
    "path": "transformations/src/main/java/jp/wasabeef/glide/transformations/BitmapTransformation.java",
    "content": "package jp.wasabeef.glide.transformations;\n\n/**\n * Copyright (C) 2020 Wasabeef\n * Copyright 2014 Google, Inc. All rights reserved.\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * http://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport android.content.Context;\nimport android.graphics.Bitmap;\n\nimport androidx.annotation.NonNull;\n\nimport com.bumptech.glide.Glide;\nimport com.bumptech.glide.load.Transformation;\nimport com.bumptech.glide.load.engine.Resource;\nimport com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;\nimport com.bumptech.glide.load.resource.bitmap.BitmapResource;\nimport com.bumptech.glide.request.target.Target;\nimport com.bumptech.glide.util.Util;\n\nimport java.security.MessageDigest;\n\npublic abstract class BitmapTransformation implements Transformation<Bitmap> {\n\n  @NonNull\n  @Override\n  public final Resource<Bitmap> transform(@NonNull Context context, @NonNull Resource<Bitmap> resource,\n                                          int outWidth, int outHeight) {\n    if (!Util.isValidDimensions(outWidth, outHeight)) {\n      throw new IllegalArgumentException(\n        \"Cannot apply transformation on width: \" + outWidth + \" or height: \" + outHeight\n          + \" less than or equal to zero and not Target.SIZE_ORIGINAL\");\n    }\n    BitmapPool bitmapPool = Glide.get(context).getBitmapPool();\n    Bitmap toTransform = resource.get();\n    int targetWidth = outWidth == Target.SIZE_ORIGINAL ? toTransform.getWidth() : outWidth;\n    int targetHeight = outHeight == Target.SIZE_ORIGINAL ? toTransform.getHeight() : outHeight;\n    Bitmap transformed = transform(context.getApplicationContext(), bitmapPool, toTransform, targetWidth, targetHeight);\n\n    final Resource<Bitmap> result;\n    if (toTransform.equals(transformed)) {\n      result = resource;\n    } else {\n      result = BitmapResource.obtain(transformed, bitmapPool);\n    }\n    return result;\n  }\n\n  void setCanvasBitmapDensity(@NonNull Bitmap toTransform, @NonNull Bitmap canvasBitmap) {\n    canvasBitmap.setDensity(toTransform.getDensity());\n  }\n\n  protected abstract Bitmap transform(@NonNull Context context, @NonNull BitmapPool pool,\n                                      @NonNull Bitmap toTransform, int outWidth, int outHeight);\n\n  @Override\n  public abstract void updateDiskCacheKey(@NonNull MessageDigest messageDigest);\n\n  @Override\n  public abstract boolean equals(Object o);\n\n  @Override\n  public abstract int hashCode();\n}\n"
  },
  {
    "path": "transformations/src/main/java/jp/wasabeef/glide/transformations/BlurTransformation.java",
    "content": "package jp.wasabeef.glide.transformations;\n\n/**\n * Copyright (C) 2020 Wasabeef\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * http://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport android.content.Context;\nimport android.graphics.Bitmap;\nimport android.graphics.Canvas;\nimport android.graphics.Paint;\nimport android.renderscript.RSRuntimeException;\n\nimport androidx.annotation.NonNull;\n\nimport com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;\n\nimport java.security.MessageDigest;\n\nimport jp.wasabeef.glide.transformations.internal.FastBlur;\nimport jp.wasabeef.glide.transformations.internal.RSBlur;\n\npublic class BlurTransformation extends BitmapTransformation {\n\n  private static final int VERSION = 1;\n  private static final String ID =\n    \"jp.wasabeef.glide.transformations.BlurTransformation.\" + VERSION;\n\n  private static final int MAX_RADIUS = 25;\n  private static final int DEFAULT_DOWN_SAMPLING = 1;\n\n  private final int radius;\n  private final int sampling;\n\n  public BlurTransformation() {\n    this(MAX_RADIUS, DEFAULT_DOWN_SAMPLING);\n  }\n\n  public BlurTransformation(int radius) {\n    this(radius, DEFAULT_DOWN_SAMPLING);\n  }\n\n  public BlurTransformation(int radius, int sampling) {\n    this.radius = radius;\n    this.sampling = sampling;\n  }\n\n  @Override\n  protected Bitmap transform(@NonNull Context context, @NonNull BitmapPool pool,\n                             @NonNull Bitmap toTransform, int outWidth, int outHeight) {\n\n    int width = toTransform.getWidth();\n    int height = toTransform.getHeight();\n    int scaledWidth = width / sampling;\n    int scaledHeight = height / sampling;\n\n    Bitmap bitmap = pool.get(scaledWidth, scaledHeight, Bitmap.Config.ARGB_8888);\n\n    setCanvasBitmapDensity(toTransform, bitmap);\n\n    Canvas canvas = new Canvas(bitmap);\n    canvas.scale(1 / (float) sampling, 1 / (float) sampling);\n    Paint paint = new Paint();\n    paint.setFlags(Paint.FILTER_BITMAP_FLAG);\n    canvas.drawBitmap(toTransform, 0, 0, paint);\n\n    try {\n      bitmap = RSBlur.blur(context, bitmap, radius);\n    } catch (RSRuntimeException e) {\n      bitmap = FastBlur.blur(bitmap, radius, true);\n    }\n\n    return bitmap;\n  }\n\n  @Override\n  public String toString() {\n    return \"BlurTransformation(radius=\" + radius + \", sampling=\" + sampling + \")\";\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    return o instanceof BlurTransformation &&\n      ((BlurTransformation) o).radius == radius &&\n      ((BlurTransformation) o).sampling == sampling;\n  }\n\n  @Override\n  public int hashCode() {\n    return ID.hashCode() + radius * 1000 + sampling * 10;\n  }\n\n  @Override\n  public void updateDiskCacheKey(@NonNull MessageDigest messageDigest) {\n    messageDigest.update((ID + radius + sampling).getBytes(CHARSET));\n  }\n}\n"
  },
  {
    "path": "transformations/src/main/java/jp/wasabeef/glide/transformations/ColorFilterTransformation.java",
    "content": "package jp.wasabeef.glide.transformations;\n\n/**\n * Copyright (C) 2020 Wasabeef\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * http://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport android.content.Context;\nimport android.graphics.Bitmap;\nimport android.graphics.Canvas;\nimport android.graphics.Paint;\nimport android.graphics.PorterDuff;\nimport android.graphics.PorterDuffColorFilter;\n\nimport androidx.annotation.NonNull;\n\nimport com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;\n\nimport java.security.MessageDigest;\n\npublic class ColorFilterTransformation extends BitmapTransformation {\n\n  private static final int VERSION = 1;\n  private static final String ID =\n    \"jp.wasabeef.glide.transformations.ColorFilterTransformation.\" + VERSION;\n\n  private final int color;\n\n  public ColorFilterTransformation(int color) {\n    this.color = color;\n  }\n\n  @Override\n  protected Bitmap transform(@NonNull Context context, @NonNull BitmapPool pool,\n                             @NonNull Bitmap toTransform, int outWidth, int outHeight) {\n    int width = toTransform.getWidth();\n    int height = toTransform.getHeight();\n\n    Bitmap.Config config =\n      toTransform.getConfig() != null ? toTransform.getConfig() : Bitmap.Config.ARGB_8888;\n    Bitmap bitmap = pool.get(width, height, config);\n\n    setCanvasBitmapDensity(toTransform, bitmap);\n\n    Canvas canvas = new Canvas(bitmap);\n    Paint paint = new Paint();\n    paint.setAntiAlias(true);\n    paint.setColorFilter(new PorterDuffColorFilter(color, PorterDuff.Mode.SRC_ATOP));\n    canvas.drawBitmap(toTransform, 0, 0, paint);\n\n    return bitmap;\n  }\n\n  @Override\n  public String toString() {\n    return \"ColorFilterTransformation(color=\" + color + \")\";\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    return o instanceof ColorFilterTransformation &&\n      ((ColorFilterTransformation) o).color == color;\n  }\n\n  @Override\n  public int hashCode() {\n    return ID.hashCode() + color * 10;\n  }\n\n  @Override\n  public void updateDiskCacheKey(@NonNull MessageDigest messageDigest) {\n    messageDigest.update((ID + color).getBytes(CHARSET));\n  }\n}\n"
  },
  {
    "path": "transformations/src/main/java/jp/wasabeef/glide/transformations/CropCircleTransformation.java",
    "content": "package jp.wasabeef.glide.transformations;\n\n/**\n * Copyright (C) 2020 Wasabeef\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * http://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport android.content.Context;\nimport android.graphics.Bitmap;\n\nimport androidx.annotation.NonNull;\n\nimport com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;\nimport com.bumptech.glide.load.resource.bitmap.TransformationUtils;\nimport com.bumptech.glide.request.RequestOptions;\n\nimport java.security.MessageDigest;\n\n/**\n * @deprecated Use {@link RequestOptions#circleCrop()}.\n */\n@Deprecated\npublic class CropCircleTransformation extends BitmapTransformation {\n\n  private static final int VERSION = 1;\n  private static final String ID =\n    \"jp.wasabeef.glide.transformations.CropCircleTransformation.\" + VERSION;\n\n  @Override\n  protected Bitmap transform(@NonNull Context context, @NonNull BitmapPool pool,\n                             @NonNull Bitmap toTransform, int outWidth, int outHeight) {\n    return TransformationUtils.circleCrop(pool, toTransform, outWidth, outHeight);\n  }\n\n  @Override\n  public String toString() {\n    return \"CropCircleTransformation()\";\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    return o instanceof CropCircleTransformation;\n  }\n\n  @Override\n  public int hashCode() {\n    return ID.hashCode();\n  }\n\n  @Override\n  public void updateDiskCacheKey(@NonNull MessageDigest messageDigest) {\n    messageDigest.update((ID).getBytes(CHARSET));\n  }\n}\n"
  },
  {
    "path": "transformations/src/main/java/jp/wasabeef/glide/transformations/CropCircleWithBorderTransformation.java",
    "content": "package jp.wasabeef.glide.transformations;\n\nimport android.content.Context;\nimport android.graphics.Bitmap;\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.graphics.Paint;\n\nimport androidx.annotation.ColorInt;\nimport androidx.annotation.NonNull;\n\nimport com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;\nimport com.bumptech.glide.load.resource.bitmap.TransformationUtils;\n\nimport java.security.MessageDigest;\n\nimport jp.wasabeef.glide.transformations.internal.Utils;\n\n/**\n * Copyright (C) 2020 Wasabeef\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * http://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npublic class CropCircleWithBorderTransformation extends BitmapTransformation {\n\n\n  private static final int VERSION = 1;\n  private static final String ID = \"jp.wasabeef.glide.transformations.CropCircleWithBorderTransformation.\" + VERSION;\n\n  private final int borderSize;\n  private final int borderColor;\n\n\n  public CropCircleWithBorderTransformation() {\n    this.borderSize = Utils.toDp(4);\n    this.borderColor = Color.BLACK;\n  }\n\n  public CropCircleWithBorderTransformation(int borderSize, @ColorInt int borderColor) {\n    this.borderSize = borderSize;\n    this.borderColor = borderColor;\n  }\n\n  @Override\n  protected Bitmap transform(@NonNull Context context, @NonNull BitmapPool pool,\n                             @NonNull Bitmap toTransform, int outWidth, int outHeight) {\n\n    Bitmap bitmap = TransformationUtils.circleCrop(pool, toTransform, outWidth, outHeight);\n\n    setCanvasBitmapDensity(toTransform, bitmap);\n\n    Paint paint = new Paint();\n    paint.setColor(borderColor);\n    paint.setStyle(Paint.Style.STROKE);\n    paint.setStrokeWidth(borderSize);\n    paint.setAntiAlias(true);\n\n    Canvas canvas = new Canvas(bitmap);\n    canvas.drawCircle(\n      outWidth / 2f,\n      outHeight / 2f,\n      Math.max(outWidth, outHeight) / 2f - borderSize / 2f,\n      paint\n    );\n\n    return bitmap;\n  }\n\n  @Override\n  public void updateDiskCacheKey(@NonNull MessageDigest messageDigest) {\n    messageDigest.update((ID + borderSize + borderColor).getBytes(CHARSET));\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    return o instanceof CropCircleWithBorderTransformation &&\n      ((CropCircleWithBorderTransformation) o).borderSize == borderSize &&\n      ((CropCircleWithBorderTransformation) o).borderColor == borderColor;\n  }\n\n  @Override\n  public int hashCode() {\n    return ID.hashCode() + borderSize * 100 + borderColor + 10;\n  }\n}\n"
  },
  {
    "path": "transformations/src/main/java/jp/wasabeef/glide/transformations/CropSquareTransformation.java",
    "content": "package jp.wasabeef.glide.transformations;\n\n/**\n * Copyright (C) 2020 Wasabeef\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * http://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport android.content.Context;\nimport android.graphics.Bitmap;\n\nimport androidx.annotation.NonNull;\n\nimport com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;\nimport com.bumptech.glide.load.resource.bitmap.TransformationUtils;\n\nimport java.security.MessageDigest;\n\npublic class CropSquareTransformation extends BitmapTransformation {\n\n  private static final int VERSION = 1;\n  private static final String ID =\n    \"jp.wasabeef.glide.transformations.CropSquareTransformation.\" + VERSION;\n\n  private int size;\n\n  @Override\n  protected Bitmap transform(@NonNull Context context, @NonNull BitmapPool pool,\n                             @NonNull Bitmap toTransform, int outWidth, int outHeight) {\n    this.size = Math.max(outWidth, outHeight);\n    return TransformationUtils.centerCrop(pool, toTransform, size, size);\n  }\n\n  @Override\n  public String toString() {\n    return \"CropSquareTransformation(size=\" + size + \")\";\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    return o instanceof CropSquareTransformation && ((CropSquareTransformation) o).size == size;\n  }\n\n  @Override\n  public int hashCode() {\n    return ID.hashCode() + size * 10;\n  }\n\n  @Override\n  public void updateDiskCacheKey(@NonNull MessageDigest messageDigest) {\n    messageDigest.update((ID + size).getBytes(CHARSET));\n  }\n}\n"
  },
  {
    "path": "transformations/src/main/java/jp/wasabeef/glide/transformations/CropTransformation.java",
    "content": "package jp.wasabeef.glide.transformations;\n\n/**\n * Copyright (C) 2020 Wasabeef\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * http://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport android.content.Context;\nimport android.graphics.Bitmap;\nimport android.graphics.Canvas;\nimport android.graphics.RectF;\n\nimport androidx.annotation.NonNull;\n\nimport com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;\n\nimport java.security.MessageDigest;\n\npublic class CropTransformation extends BitmapTransformation {\n\n  private static final int VERSION = 1;\n  private static final String ID = \"jp.wasabeef.glide.transformations.CropTransformation.\" + VERSION;\n\n  public enum CropType {\n    TOP,\n    CENTER,\n    BOTTOM\n  }\n\n  private int width;\n  private int height;\n\n  private CropType cropType = CropType.CENTER;\n\n  public CropTransformation(int width, int height) {\n    this(width, height, CropType.CENTER);\n  }\n\n  public CropTransformation(int width, int height, CropType cropType) {\n    this.width = width;\n    this.height = height;\n    this.cropType = cropType;\n  }\n\n  @Override\n  protected Bitmap transform(@NonNull Context context, @NonNull BitmapPool pool,\n                             @NonNull Bitmap toTransform, int outWidth, int outHeight) {\n\n    width = width == 0 ? toTransform.getWidth() : width;\n    height = height == 0 ? toTransform.getHeight() : height;\n\n    Bitmap.Config config =\n      toTransform.getConfig() != null ? toTransform.getConfig() : Bitmap.Config.ARGB_8888;\n    Bitmap bitmap = pool.get(width, height, config);\n\n    bitmap.setHasAlpha(true);\n\n    float scaleX = (float) width / toTransform.getWidth();\n    float scaleY = (float) height / toTransform.getHeight();\n    float scale = Math.max(scaleX, scaleY);\n\n    float scaledWidth = scale * toTransform.getWidth();\n    float scaledHeight = scale * toTransform.getHeight();\n    float left = (width - scaledWidth) / 2;\n    float top = getTop(scaledHeight);\n    RectF targetRect = new RectF(left, top, left + scaledWidth, top + scaledHeight);\n\n    setCanvasBitmapDensity(toTransform, bitmap);\n\n    Canvas canvas = new Canvas(bitmap);\n    canvas.drawBitmap(toTransform, null, targetRect, null);\n\n    return bitmap;\n  }\n\n  private float getTop(float scaledHeight) {\n    switch (cropType) {\n      case TOP:\n        return 0;\n      case CENTER:\n        return (height - scaledHeight) / 2;\n      case BOTTOM:\n        return height - scaledHeight;\n      default:\n        return 0;\n    }\n  }\n\n  @Override\n  public String toString() {\n    return \"CropTransformation(width=\" + width + \", height=\" + height + \", cropType=\" + cropType + \")\";\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    return o instanceof CropTransformation &&\n      ((CropTransformation) o).width == width &&\n      ((CropTransformation) o).height == height &&\n      ((CropTransformation) o).cropType == cropType;\n  }\n\n  @Override\n  public int hashCode() {\n    return ID.hashCode() + width * 100000 + height * 1000 + cropType.ordinal() * 10;\n  }\n\n  @Override\n  public void updateDiskCacheKey(@NonNull MessageDigest messageDigest) {\n    messageDigest.update((ID + width + height + cropType).getBytes(CHARSET));\n  }\n}\n"
  },
  {
    "path": "transformations/src/main/java/jp/wasabeef/glide/transformations/GrayscaleTransformation.java",
    "content": "package jp.wasabeef.glide.transformations;\n\n/**\n * Copyright (C) 2020 Wasabeef\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * http://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport android.content.Context;\nimport android.graphics.Bitmap;\nimport android.graphics.Canvas;\nimport android.graphics.ColorMatrix;\nimport android.graphics.ColorMatrixColorFilter;\nimport android.graphics.Paint;\n\nimport androidx.annotation.NonNull;\n\nimport com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;\n\nimport java.security.MessageDigest;\n\npublic class GrayscaleTransformation extends BitmapTransformation {\n\n  private static final int VERSION = 1;\n  private static final String ID =\n    \"jp.wasabeef.glide.transformations.GrayscaleTransformation.\" + VERSION;\n\n  @Override\n  protected Bitmap transform(@NonNull Context context, @NonNull BitmapPool pool,\n                             @NonNull Bitmap toTransform, int outWidth, int outHeight) {\n    int width = toTransform.getWidth();\n    int height = toTransform.getHeight();\n\n    Bitmap.Config config =\n      toTransform.getConfig() != null ? toTransform.getConfig() : Bitmap.Config.ARGB_8888;\n    Bitmap bitmap = pool.get(width, height, config);\n\n    setCanvasBitmapDensity(toTransform, bitmap);\n\n    Canvas canvas = new Canvas(bitmap);\n    ColorMatrix saturation = new ColorMatrix();\n    saturation.setSaturation(0f);\n    Paint paint = new Paint();\n    paint.setColorFilter(new ColorMatrixColorFilter(saturation));\n    canvas.drawBitmap(toTransform, 0, 0, paint);\n\n    return bitmap;\n  }\n\n  @Override\n  public String toString() {\n    return \"GrayscaleTransformation()\";\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    return o instanceof GrayscaleTransformation;\n  }\n\n  @Override\n  public int hashCode() {\n    return ID.hashCode();\n  }\n\n  @Override\n  public void updateDiskCacheKey(@NonNull MessageDigest messageDigest) {\n    messageDigest.update((ID).getBytes(CHARSET));\n  }\n}\n"
  },
  {
    "path": "transformations/src/main/java/jp/wasabeef/glide/transformations/MaskTransformation.java",
    "content": "package jp.wasabeef.glide.transformations;\n\n/**\n * Copyright (C) 2020 Wasabeef\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * http://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport android.content.Context;\nimport android.graphics.Bitmap;\nimport android.graphics.Canvas;\nimport android.graphics.Paint;\nimport android.graphics.PorterDuff;\nimport android.graphics.PorterDuffXfermode;\nimport android.graphics.drawable.Drawable;\n\nimport androidx.annotation.NonNull;\n\nimport com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;\n\nimport java.security.MessageDigest;\n\npublic class MaskTransformation extends BitmapTransformation {\n\n  private static final int VERSION = 1;\n  private static final String ID =\n    \"jp.wasabeef.glide.transformations.MaskTransformation.\" + VERSION;\n\n  private static final Paint paint = new Paint();\n  private final int maskId;\n\n  static {\n    paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));\n  }\n\n  /**\n   * @param maskId If you change the mask file, please also rename the mask file, or Glide will get\n   *               the cache with the old mask. Because key() return the same values if using the\n   *               same make file name. If you have a good idea please tell us, thanks.\n   */\n  public MaskTransformation(int maskId) {\n    this.maskId = maskId;\n  }\n\n  @Override\n  protected Bitmap transform(@NonNull Context context, @NonNull BitmapPool pool,\n                             @NonNull Bitmap toTransform, int outWidth, int outHeight) {\n    int width = toTransform.getWidth();\n    int height = toTransform.getHeight();\n\n    Bitmap bitmap = pool.get(width, height, Bitmap.Config.ARGB_8888);\n    bitmap.setHasAlpha(true);\n\n    Drawable mask = context.getDrawable(maskId);\n\n    setCanvasBitmapDensity(toTransform, bitmap);\n\n    Canvas canvas = new Canvas(bitmap);\n    mask.setBounds(0, 0, width, height);\n    mask.draw(canvas);\n    canvas.drawBitmap(toTransform, 0, 0, paint);\n\n    return bitmap;\n  }\n\n  @Override\n  public String toString() {\n    return \"MaskTransformation(maskId=\" + maskId + \")\";\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    return o instanceof MaskTransformation &&\n      ((MaskTransformation) o).maskId == maskId;\n  }\n\n  @Override\n  public int hashCode() {\n    return ID.hashCode() + maskId * 10;\n  }\n\n  @Override\n  public void updateDiskCacheKey(@NonNull MessageDigest messageDigest) {\n    messageDigest.update((ID + maskId).getBytes(CHARSET));\n  }\n}\n"
  },
  {
    "path": "transformations/src/main/java/jp/wasabeef/glide/transformations/RoundedCornersTransformation.java",
    "content": "package jp.wasabeef.glide.transformations;\n\n/**\n * Copyright (C) 2020 Wasabeef\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * http://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport android.content.Context;\nimport android.graphics.Bitmap;\nimport android.graphics.BitmapShader;\nimport android.graphics.Canvas;\nimport android.graphics.Paint;\nimport android.graphics.RectF;\nimport android.graphics.Shader;\n\nimport androidx.annotation.NonNull;\n\nimport com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;\n\nimport java.security.MessageDigest;\n\npublic class RoundedCornersTransformation extends BitmapTransformation {\n\n  private static final int VERSION = 1;\n  private static final String ID = \"jp.wasabeef.glide.transformations.RoundedCornersTransformation.\" + VERSION;\n\n  public enum CornerType {\n    ALL,\n    TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT,\n    TOP, BOTTOM, LEFT, RIGHT,\n    OTHER_TOP_LEFT, OTHER_TOP_RIGHT, OTHER_BOTTOM_LEFT, OTHER_BOTTOM_RIGHT,\n    DIAGONAL_FROM_TOP_LEFT, DIAGONAL_FROM_TOP_RIGHT\n  }\n\n  private final int radius;\n  private final int diameter;\n  private final int margin;\n  private final CornerType cornerType;\n\n  public RoundedCornersTransformation(int radius, int margin) {\n    this(radius, margin, CornerType.ALL);\n  }\n\n  public RoundedCornersTransformation(int radius, int margin, CornerType cornerType) {\n    this.radius = radius;\n    this.diameter = this.radius * 2;\n    this.margin = margin;\n    this.cornerType = cornerType;\n  }\n\n  @Override\n  protected Bitmap transform(@NonNull Context context, @NonNull BitmapPool pool,\n                             @NonNull Bitmap toTransform, int outWidth, int outHeight) {\n    int width = toTransform.getWidth();\n    int height = toTransform.getHeight();\n\n    Bitmap bitmap = pool.get(width, height, Bitmap.Config.ARGB_8888);\n    bitmap.setHasAlpha(true);\n\n    setCanvasBitmapDensity(toTransform, bitmap);\n\n    Canvas canvas = new Canvas(bitmap);\n    Paint paint = new Paint();\n    paint.setAntiAlias(true);\n    paint.setShader(new BitmapShader(toTransform, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP));\n    drawRoundRect(canvas, paint, width, height);\n    return bitmap;\n  }\n\n  private void drawRoundRect(Canvas canvas, Paint paint, float width, float height) {\n    float right = width - margin;\n    float bottom = height - margin;\n\n    switch (cornerType) {\n      case ALL:\n        canvas.drawRoundRect(new RectF(margin, margin, right, bottom), radius, radius, paint);\n        break;\n      case TOP_LEFT:\n        drawTopLeftRoundRect(canvas, paint, right, bottom);\n        break;\n      case TOP_RIGHT:\n        drawTopRightRoundRect(canvas, paint, right, bottom);\n        break;\n      case BOTTOM_LEFT:\n        drawBottomLeftRoundRect(canvas, paint, right, bottom);\n        break;\n      case BOTTOM_RIGHT:\n        drawBottomRightRoundRect(canvas, paint, right, bottom);\n        break;\n      case TOP:\n        drawTopRoundRect(canvas, paint, right, bottom);\n        break;\n      case BOTTOM:\n        drawBottomRoundRect(canvas, paint, right, bottom);\n        break;\n      case LEFT:\n        drawLeftRoundRect(canvas, paint, right, bottom);\n        break;\n      case RIGHT:\n        drawRightRoundRect(canvas, paint, right, bottom);\n        break;\n      case OTHER_TOP_LEFT:\n        drawOtherTopLeftRoundRect(canvas, paint, right, bottom);\n        break;\n      case OTHER_TOP_RIGHT:\n        drawOtherTopRightRoundRect(canvas, paint, right, bottom);\n        break;\n      case OTHER_BOTTOM_LEFT:\n        drawOtherBottomLeftRoundRect(canvas, paint, right, bottom);\n        break;\n      case OTHER_BOTTOM_RIGHT:\n        drawOtherBottomRightRoundRect(canvas, paint, right, bottom);\n        break;\n      case DIAGONAL_FROM_TOP_LEFT:\n        drawDiagonalFromTopLeftRoundRect(canvas, paint, right, bottom);\n        break;\n      case DIAGONAL_FROM_TOP_RIGHT:\n        drawDiagonalFromTopRightRoundRect(canvas, paint, right, bottom);\n        break;\n      default:\n        canvas.drawRoundRect(new RectF(margin, margin, right, bottom), radius, radius, paint);\n        break;\n    }\n  }\n\n  private void drawTopLeftRoundRect(Canvas canvas, Paint paint, float right, float bottom) {\n    canvas.drawRoundRect(new RectF(margin, margin, margin + diameter, margin + diameter), radius,\n      radius, paint);\n    canvas.drawRect(new RectF(margin, margin + radius, margin + radius, bottom), paint);\n    canvas.drawRect(new RectF(margin + radius, margin, right, bottom), paint);\n  }\n\n  private void drawTopRightRoundRect(Canvas canvas, Paint paint, float right, float bottom) {\n    canvas.drawRoundRect(new RectF(right - diameter, margin, right, margin + diameter), radius,\n      radius, paint);\n    canvas.drawRect(new RectF(margin, margin, right - radius, bottom), paint);\n    canvas.drawRect(new RectF(right - radius, margin + radius, right, bottom), paint);\n  }\n\n  private void drawBottomLeftRoundRect(Canvas canvas, Paint paint, float right, float bottom) {\n    canvas.drawRoundRect(new RectF(margin, bottom - diameter, margin + diameter, bottom), radius,\n      radius, paint);\n    canvas.drawRect(new RectF(margin, margin, margin + diameter, bottom - radius), paint);\n    canvas.drawRect(new RectF(margin + radius, margin, right, bottom), paint);\n  }\n\n  private void drawBottomRightRoundRect(Canvas canvas, Paint paint, float right, float bottom) {\n    canvas.drawRoundRect(new RectF(right - diameter, bottom - diameter, right, bottom), radius,\n      radius, paint);\n    canvas.drawRect(new RectF(margin, margin, right - radius, bottom), paint);\n    canvas.drawRect(new RectF(right - radius, margin, right, bottom - radius), paint);\n  }\n\n  private void drawTopRoundRect(Canvas canvas, Paint paint, float right, float bottom) {\n    canvas.drawRoundRect(new RectF(margin, margin, right, margin + diameter), radius, radius,\n      paint);\n    canvas.drawRect(new RectF(margin, margin + radius, right, bottom), paint);\n  }\n\n  private void drawBottomRoundRect(Canvas canvas, Paint paint, float right, float bottom) {\n    canvas.drawRoundRect(new RectF(margin, bottom - diameter, right, bottom), radius, radius,\n      paint);\n    canvas.drawRect(new RectF(margin, margin, right, bottom - radius), paint);\n  }\n\n  private void drawLeftRoundRect(Canvas canvas, Paint paint, float right, float bottom) {\n    canvas.drawRoundRect(new RectF(margin, margin, margin + diameter, bottom), radius, radius,\n      paint);\n    canvas.drawRect(new RectF(margin + radius, margin, right, bottom), paint);\n  }\n\n  private void drawRightRoundRect(Canvas canvas, Paint paint, float right, float bottom) {\n    canvas.drawRoundRect(new RectF(right - diameter, margin, right, bottom), radius, radius, paint);\n    canvas.drawRect(new RectF(margin, margin, right - radius, bottom), paint);\n  }\n\n  private void drawOtherTopLeftRoundRect(Canvas canvas, Paint paint, float right, float bottom) {\n    canvas.drawRoundRect(new RectF(margin, bottom - diameter, right, bottom), radius, radius,\n      paint);\n    canvas.drawRoundRect(new RectF(right - diameter, margin, right, bottom), radius, radius, paint);\n    canvas.drawRect(new RectF(margin, margin, right - radius, bottom - radius), paint);\n  }\n\n  private void drawOtherTopRightRoundRect(Canvas canvas, Paint paint, float right, float bottom) {\n    canvas.drawRoundRect(new RectF(margin, margin, margin + diameter, bottom), radius, radius,\n      paint);\n    canvas.drawRoundRect(new RectF(margin, bottom - diameter, right, bottom), radius, radius,\n      paint);\n    canvas.drawRect(new RectF(margin + radius, margin, right, bottom - radius), paint);\n  }\n\n  private void drawOtherBottomLeftRoundRect(Canvas canvas, Paint paint, float right, float bottom) {\n    canvas.drawRoundRect(new RectF(margin, margin, right, margin + diameter), radius, radius,\n      paint);\n    canvas.drawRoundRect(new RectF(right - diameter, margin, right, bottom), radius, radius, paint);\n    canvas.drawRect(new RectF(margin, margin + radius, right - radius, bottom), paint);\n  }\n\n  private void drawOtherBottomRightRoundRect(Canvas canvas, Paint paint, float right,\n                                             float bottom) {\n    canvas.drawRoundRect(new RectF(margin, margin, right, margin + diameter), radius, radius,\n      paint);\n    canvas.drawRoundRect(new RectF(margin, margin, margin + diameter, bottom), radius, radius,\n      paint);\n    canvas.drawRect(new RectF(margin + radius, margin + radius, right, bottom), paint);\n  }\n\n  private void drawDiagonalFromTopLeftRoundRect(Canvas canvas, Paint paint, float right,\n                                                float bottom) {\n    canvas.drawRoundRect(new RectF(margin, margin, margin + diameter, margin + diameter), radius,\n      radius, paint);\n    canvas.drawRoundRect(new RectF(right - diameter, bottom - diameter, right, bottom), radius,\n      radius, paint);\n    canvas.drawRect(new RectF(margin, margin + radius, right - radius, bottom), paint);\n    canvas.drawRect(new RectF(margin + radius, margin, right, bottom - radius), paint);\n  }\n\n  private void drawDiagonalFromTopRightRoundRect(Canvas canvas, Paint paint, float right,\n                                                 float bottom) {\n    canvas.drawRoundRect(new RectF(right - diameter, margin, right, margin + diameter), radius,\n      radius, paint);\n    canvas.drawRoundRect(new RectF(margin, bottom - diameter, margin + diameter, bottom), radius,\n      radius, paint);\n    canvas.drawRect(new RectF(margin, margin, right - radius, bottom - radius), paint);\n    canvas.drawRect(new RectF(margin + radius, margin + radius, right, bottom), paint);\n  }\n\n  @Override\n  public String toString() {\n    return \"RoundedTransformation(radius=\" + radius + \", margin=\" + margin + \", diameter=\"\n      + diameter + \", cornerType=\" + cornerType.name() + \")\";\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    return o instanceof RoundedCornersTransformation &&\n      ((RoundedCornersTransformation) o).radius == radius &&\n      ((RoundedCornersTransformation) o).diameter == diameter &&\n      ((RoundedCornersTransformation) o).margin == margin &&\n      ((RoundedCornersTransformation) o).cornerType == cornerType;\n  }\n\n  @Override\n  public int hashCode() {\n    return ID.hashCode() + radius * 10000 + diameter * 1000 + margin * 100 + cornerType.ordinal() * 10;\n  }\n\n  @Override\n  public void updateDiskCacheKey(@NonNull MessageDigest messageDigest) {\n    messageDigest.update((ID + radius + diameter + margin + cornerType).getBytes(CHARSET));\n  }\n}\n"
  },
  {
    "path": "transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/BrightnessFilterTransformation.java",
    "content": "package jp.wasabeef.glide.transformations.gpu;\n\n/**\n * Copyright (C) 2020 Wasabeef\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * http://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport androidx.annotation.NonNull;\n\nimport java.security.MessageDigest;\n\nimport jp.co.cyberagent.android.gpuimage.filter.GPUImageBrightnessFilter;\n\n/**\n * brightness value ranges from -1.0 to 1.0, with 0.0 as the normal level\n */\npublic class BrightnessFilterTransformation extends GPUFilterTransformation {\n\n  private static final int VERSION = 1;\n  private static final String ID =\n    \"jp.wasabeef.glide.transformations.gpu.BrightnessFilterTransformation.\" + VERSION;\n\n  private final float brightness;\n\n  public BrightnessFilterTransformation() {\n    this(0.0f);\n  }\n\n  public BrightnessFilterTransformation(float brightness) {\n    super(new GPUImageBrightnessFilter());\n    this.brightness = brightness;\n    GPUImageBrightnessFilter filter = getFilter();\n    filter.setBrightness(this.brightness);\n  }\n\n  @Override\n  public String toString() {\n    return \"BrightnessFilterTransformation(brightness=\" + brightness + \")\";\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    return o instanceof BrightnessFilterTransformation &&\n      ((BrightnessFilterTransformation) o).brightness == brightness;\n  }\n\n  @Override\n  public int hashCode() {\n    return ID.hashCode() + (int) ((brightness + 1.0f) * 10);\n  }\n\n  @Override\n  public void updateDiskCacheKey(@NonNull MessageDigest messageDigest) {\n    messageDigest.update((ID + brightness).getBytes(CHARSET));\n  }\n}\n"
  },
  {
    "path": "transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/ContrastFilterTransformation.java",
    "content": "package jp.wasabeef.glide.transformations.gpu;\n\n/**\n * Copyright (C) 2020 Wasabeef\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * http://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport androidx.annotation.NonNull;\n\nimport java.security.MessageDigest;\n\nimport jp.co.cyberagent.android.gpuimage.filter.GPUImageContrastFilter;\n\n/**\n * contrast value ranges from 0.0 to 4.0, with 1.0 as the normal level\n */\npublic class ContrastFilterTransformation extends GPUFilterTransformation {\n\n  private static final int VERSION = 1;\n  private static final String ID =\n    \"jp.wasabeef.glide.transformations.gpu.ContrastFilterTransformation.\" + VERSION;\n\n  private final float contrast;\n\n  public ContrastFilterTransformation() {\n    this(1.0f);\n  }\n\n  public ContrastFilterTransformation(float contrast) {\n    super(new GPUImageContrastFilter());\n    this.contrast = contrast;\n    GPUImageContrastFilter filter = getFilter();\n    filter.setContrast(this.contrast);\n  }\n\n  @Override\n  public String toString() {\n    return \"ContrastFilterTransformation(contrast=\" + contrast + \")\";\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    return o instanceof ContrastFilterTransformation;\n  }\n\n  @Override\n  public int hashCode() {\n    return ID.hashCode() + (int) (contrast * 10);\n  }\n\n  @Override\n  public void updateDiskCacheKey(@NonNull MessageDigest messageDigest) {\n    messageDigest.update((ID + contrast).getBytes(CHARSET));\n  }\n}\n"
  },
  {
    "path": "transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/GPUFilterTransformation.java",
    "content": "package jp.wasabeef.glide.transformations.gpu;\n\n/**\n * Copyright (C) 2020 Wasabeef\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * http://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport android.content.Context;\nimport android.graphics.Bitmap;\n\nimport androidx.annotation.NonNull;\n\nimport com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;\n\nimport java.security.MessageDigest;\n\nimport jp.co.cyberagent.android.gpuimage.GPUImage;\nimport jp.co.cyberagent.android.gpuimage.filter.GPUImageFilter;\nimport jp.wasabeef.glide.transformations.BitmapTransformation;\n\npublic class GPUFilterTransformation extends BitmapTransformation {\n\n  private static final int VERSION = 1;\n  private static final String ID =\n    \"jp.wasabeef.glide.transformations.gpu.GPUFilterTransformation.\" + VERSION;\n  private static final byte[] ID_BYTES = ID.getBytes(CHARSET);\n\n  private final GPUImageFilter gpuImageFilter;\n\n  public GPUFilterTransformation(GPUImageFilter filter) {\n    this.gpuImageFilter = filter;\n  }\n\n  @Override\n  protected Bitmap transform(@NonNull Context context, @NonNull BitmapPool pool,\n                             @NonNull Bitmap toTransform, int outWidth, int outHeight) {\n    GPUImage gpuImage = new GPUImage(context);\n    gpuImage.setImage(toTransform);\n    gpuImage.setFilter(gpuImageFilter);\n\n    return gpuImage.getBitmapWithFilterApplied();\n  }\n\n  @Override\n  public String toString() {\n    return getClass().getSimpleName();\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  public <T> T getFilter() {\n    return (T) gpuImageFilter;\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    return o instanceof GPUFilterTransformation;\n  }\n\n  @Override\n  public int hashCode() {\n    return ID.hashCode();\n  }\n\n  @Override\n  public void updateDiskCacheKey(@NonNull MessageDigest messageDigest) {\n    messageDigest.update(ID_BYTES);\n  }\n}\n"
  },
  {
    "path": "transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/InvertFilterTransformation.java",
    "content": "package jp.wasabeef.glide.transformations.gpu;\n\n/**\n * Copyright (C) 2020 Wasabeef\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * http://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport androidx.annotation.NonNull;\n\nimport java.security.MessageDigest;\n\nimport jp.co.cyberagent.android.gpuimage.filter.GPUImageColorInvertFilter;\n\n/**\n * Invert all the colors in the image.\n */\npublic class InvertFilterTransformation extends GPUFilterTransformation {\n\n  private static final int VERSION = 1;\n  private static final String ID =\n    \"jp.wasabeef.glide.transformations.gpu.InvertFilterTransformation.\" + VERSION;\n\n  public InvertFilterTransformation() {\n    super(new GPUImageColorInvertFilter());\n  }\n\n  @Override\n  public String toString() {\n    return \"InvertFilterTransformation()\";\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    return o instanceof InvertFilterTransformation;\n  }\n\n  @Override\n  public int hashCode() {\n    return ID.hashCode();\n  }\n\n  @Override\n  public void updateDiskCacheKey(@NonNull MessageDigest messageDigest) {\n    messageDigest.update((ID).getBytes(CHARSET));\n  }\n}\n"
  },
  {
    "path": "transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/KuwaharaFilterTransformation.java",
    "content": "package jp.wasabeef.glide.transformations.gpu;\n\n/**\n * Copyright (C) 2020 Wasabeef\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * http://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport androidx.annotation.NonNull;\n\nimport java.security.MessageDigest;\n\nimport jp.co.cyberagent.android.gpuimage.filter.GPUImageKuwaharaFilter;\n\n/**\n * Kuwahara all the colors in the image.\n * <p>\n * The radius to sample from when creating the brush-stroke effect, with a default of 25.\n * The larger the radius, the slower the filter.\n */\npublic class KuwaharaFilterTransformation extends GPUFilterTransformation {\n\n  private static final int VERSION = 1;\n  private static final String ID =\n    \"jp.wasabeef.glide.transformations.gpu.KuwaharaFilterTransformation.\" + VERSION;\n\n  private final int radius;\n\n  public KuwaharaFilterTransformation() {\n    this(25);\n  }\n\n  public KuwaharaFilterTransformation(int radius) {\n    super(new GPUImageKuwaharaFilter());\n    this.radius = radius;\n    GPUImageKuwaharaFilter filter = getFilter();\n    filter.setRadius(this.radius);\n  }\n\n  @Override\n  public String toString() {\n    return \"KuwaharaFilterTransformation(radius=\" + radius + \")\";\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    return o instanceof KuwaharaFilterTransformation;\n  }\n\n  @Override\n  public int hashCode() {\n    return ID.hashCode() + radius * 10;\n  }\n\n  @Override\n  public void updateDiskCacheKey(@NonNull MessageDigest messageDigest) {\n    messageDigest.update((ID + radius).getBytes(CHARSET));\n  }\n}\n"
  },
  {
    "path": "transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/PixelationFilterTransformation.java",
    "content": "package jp.wasabeef.glide.transformations.gpu;\n\n/**\n * Copyright (C) 2020 Wasabeef\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * http://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport androidx.annotation.NonNull;\n\nimport java.security.MessageDigest;\n\nimport jp.co.cyberagent.android.gpuimage.filter.GPUImagePixelationFilter;\n\n/**\n * Applies a Pixelation effect to the image.\n * <p>\n * The pixel with a default of 10.0.\n */\npublic class PixelationFilterTransformation extends GPUFilterTransformation {\n\n  private static final int VERSION = 1;\n  private static final String ID =\n    \"jp.wasabeef.glide.transformations.gpu.PixelationFilterTransformation.\" + VERSION;\n\n  private final float pixel;\n\n  public PixelationFilterTransformation() {\n    this(10f);\n  }\n\n  public PixelationFilterTransformation(float pixel) {\n    super(new GPUImagePixelationFilter());\n    this.pixel = pixel;\n    GPUImagePixelationFilter filter = getFilter();\n    filter.setPixel(this.pixel);\n  }\n\n  @Override\n  public String toString() {\n    return \"PixelationFilterTransformation(pixel=\" + pixel + \")\";\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    return o instanceof PixelationFilterTransformation;\n  }\n\n  @Override\n  public int hashCode() {\n    return ID.hashCode() + (int) (pixel * 10);\n  }\n\n  @Override\n  public void updateDiskCacheKey(@NonNull MessageDigest messageDigest) {\n    messageDigest.update((ID + pixel).getBytes(CHARSET));\n  }\n}\n"
  },
  {
    "path": "transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/SepiaFilterTransformation.java",
    "content": "package jp.wasabeef.glide.transformations.gpu;\n\n/**\n * Copyright (C) 2020 Wasabeef\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * http://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport androidx.annotation.NonNull;\n\nimport java.security.MessageDigest;\n\nimport jp.co.cyberagent.android.gpuimage.filter.GPUImageSepiaToneFilter;\n\n/**\n * Applies a simple sepia effect.\n * <p>\n * The intensity with a default of 1.0.\n */\npublic class SepiaFilterTransformation extends GPUFilterTransformation {\n\n  private static final int VERSION = 1;\n  private static final String ID =\n    \"jp.wasabeef.glide.transformations.gpu.SepiaFilterTransformation.\" + VERSION;\n\n  private final float intensity;\n\n  public SepiaFilterTransformation() {\n    this(1.0f);\n  }\n\n  public SepiaFilterTransformation(float intensity) {\n    super(new GPUImageSepiaToneFilter());\n    this.intensity = intensity;\n    GPUImageSepiaToneFilter filter = getFilter();\n    filter.setIntensity(this.intensity);\n  }\n\n  @Override\n  public String toString() {\n    return \"SepiaFilterTransformation(intensity=\" + intensity + \")\";\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    return o instanceof SepiaFilterTransformation;\n  }\n\n  @Override\n  public int hashCode() {\n    return ID.hashCode() + (int) (intensity * 10);\n  }\n\n  @Override\n  public void updateDiskCacheKey(@NonNull MessageDigest messageDigest) {\n    messageDigest.update((ID + intensity).getBytes(CHARSET));\n  }\n}\n"
  },
  {
    "path": "transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/SketchFilterTransformation.java",
    "content": "package jp.wasabeef.glide.transformations.gpu;\n\n/**\n * Copyright (C) 2020 Wasabeef\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * http://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport androidx.annotation.NonNull;\n\nimport java.security.MessageDigest;\n\nimport jp.co.cyberagent.android.gpuimage.filter.GPUImageSketchFilter;\n\npublic class SketchFilterTransformation extends GPUFilterTransformation {\n\n  private static final int VERSION = 1;\n  private static final String ID =\n    \"jp.wasabeef.glide.transformations.gpu.SketchFilterTransformation.\" + VERSION;\n\n  public SketchFilterTransformation() {\n    super(new GPUImageSketchFilter());\n  }\n\n  @Override\n  public String toString() {\n    return \"SketchFilterTransformation()\";\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    return o instanceof SketchFilterTransformation;\n  }\n\n  @Override\n  public int hashCode() {\n    return ID.hashCode();\n  }\n\n  @Override\n  public void updateDiskCacheKey(@NonNull MessageDigest messageDigest) {\n    messageDigest.update((ID).getBytes(CHARSET));\n  }\n}\n"
  },
  {
    "path": "transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/SwirlFilterTransformation.java",
    "content": "package jp.wasabeef.glide.transformations.gpu;\n\n/**\n * Copyright (C) 2020 Wasabeef\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * http://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport android.graphics.PointF;\n\nimport androidx.annotation.NonNull;\n\nimport java.security.MessageDigest;\n\nimport jp.co.cyberagent.android.gpuimage.filter.GPUImageSwirlFilter;\n\n/**\n * Creates a swirl distortion on the image.\n */\npublic class SwirlFilterTransformation extends GPUFilterTransformation {\n\n  private static final int VERSION = 1;\n  private static final String ID =\n    \"jp.wasabeef.glide.transformations.gpu.SwirlFilterTransformation.\" + VERSION;\n\n  private final float radius;\n  private final float angle;\n  private final PointF center;\n\n  public SwirlFilterTransformation() {\n    this(.5f, 1.0f, new PointF(0.5f, 0.5f));\n  }\n\n  /**\n   * @param radius from 0.0 to 1.0, default 0.5\n   * @param angle  minimum 0.0, default 1.0\n   * @param center default (0.5, 0.5)\n   */\n  public SwirlFilterTransformation(float radius, float angle, PointF center) {\n    super(new GPUImageSwirlFilter());\n    this.radius = radius;\n    this.angle = angle;\n    this.center = center;\n    GPUImageSwirlFilter filter = getFilter();\n    filter.setRadius(this.radius);\n    filter.setAngle(this.angle);\n    filter.setCenter(this.center);\n  }\n\n  @Override\n  public String toString() {\n    return \"SwirlFilterTransformation(radius=\" + radius + \",angle=\" + angle + \",center=\"\n      + center.toString() + \")\";\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    return o instanceof SwirlFilterTransformation &&\n      ((SwirlFilterTransformation) o).radius == radius &&\n      ((SwirlFilterTransformation) o).angle == radius &&\n      ((SwirlFilterTransformation) o).center.equals(center.x, center.y);\n  }\n\n  @Override\n  public int hashCode() {\n    return ID.hashCode() + (int) (radius * 1000) + (int) (angle * 10) + center.hashCode();\n  }\n\n  @Override\n  public void updateDiskCacheKey(@NonNull MessageDigest messageDigest) {\n    messageDigest.update((ID + radius + angle + center.hashCode()).getBytes(CHARSET));\n  }\n}\n"
  },
  {
    "path": "transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/ToonFilterTransformation.java",
    "content": "package jp.wasabeef.glide.transformations.gpu;\n\n/**\n * Copyright (C) 2020 Wasabeef\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * http://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport androidx.annotation.NonNull;\n\nimport java.security.MessageDigest;\n\nimport jp.co.cyberagent.android.gpuimage.filter.GPUImageToonFilter;\n\n/**\n * The threshold at which to apply the edges, default of 0.2.\n * The levels of quantization for the posterization of colors within the scene,\n * with a default of 10.0.\n */\npublic class ToonFilterTransformation extends GPUFilterTransformation {\n\n  private static final int VERSION = 1;\n  private static final String ID =\n    \"jp.wasabeef.glide.transformations.gpu.ToonFilterTransformation.\" + VERSION;\n\n  private final float threshold;\n  private final float quantizationLevels;\n\n  public ToonFilterTransformation() {\n    this(.2f, 10.0f);\n  }\n\n  public ToonFilterTransformation(float threshold, float quantizationLevels) {\n    super(new GPUImageToonFilter());\n    this.threshold = threshold;\n    this.quantizationLevels = quantizationLevels;\n    GPUImageToonFilter filter = getFilter();\n    filter.setThreshold(this.threshold);\n    filter.setQuantizationLevels(this.quantizationLevels);\n  }\n\n  @Override\n  public String toString() {\n    return \"ToonFilterTransformation(threshold=\" + threshold + \",quantizationLevels=\"\n      + quantizationLevels + \")\";\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    return o instanceof ToonFilterTransformation &&\n      ((ToonFilterTransformation) o).threshold == threshold &&\n      ((ToonFilterTransformation) o).quantizationLevels == quantizationLevels;\n  }\n\n  @Override\n  public int hashCode() {\n    return ID.hashCode() + (int) (threshold * 1000) + (int) (quantizationLevels * 10);\n  }\n\n  @Override\n  public void updateDiskCacheKey(@NonNull MessageDigest messageDigest) {\n    messageDigest.update((ID + threshold + quantizationLevels).getBytes(CHARSET));\n  }\n}\n"
  },
  {
    "path": "transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/VignetteFilterTransformation.java",
    "content": "package jp.wasabeef.glide.transformations.gpu;\n\n/**\n * Copyright (C) 2020 Wasabeef\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * http://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport android.graphics.PointF;\n\nimport androidx.annotation.NonNull;\n\nimport java.security.MessageDigest;\nimport java.util.Arrays;\n\nimport jp.co.cyberagent.android.gpuimage.filter.GPUImageVignetteFilter;\n\n/**\n * Performs a vignetting effect, fading out the image at the edges\n * The directional intensity of the vignetting,\n * with a default of x = 0.5, y = 0.5, start = 0, end = 0.75\n */\npublic class VignetteFilterTransformation extends GPUFilterTransformation {\n\n  private static final int VERSION = 1;\n  private static final String ID =\n    \"jp.wasabeef.glide.transformations.gpu.VignetteFilterTransformation.\" + VERSION;\n\n  private final PointF center;\n  private final float[] vignetteColor;\n  private final float vignetteStart;\n  private final float vignetteEnd;\n\n  public VignetteFilterTransformation() {\n    this(new PointF(0.5f, 0.5f), new float[]{0.0f, 0.0f, 0.0f}, 0.0f, 0.75f);\n  }\n\n  public VignetteFilterTransformation(PointF center, float[] color, float start, float end) {\n    super(new GPUImageVignetteFilter());\n    this.center = center;\n    vignetteColor = color;\n    vignetteStart = start;\n    vignetteEnd = end;\n    GPUImageVignetteFilter filter = getFilter();\n    filter.setVignetteCenter(this.center);\n    filter.setVignetteColor(vignetteColor);\n    filter.setVignetteStart(vignetteStart);\n    filter.setVignetteEnd(vignetteEnd);\n  }\n\n  @Override\n  public String toString() {\n    return \"VignetteFilterTransformation(center=\" + center.toString() + \",color=\" + Arrays.toString(\n      vignetteColor) + \",start=\" + vignetteStart + \",end=\" + vignetteEnd + \")\";\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    return o instanceof VignetteFilterTransformation &&\n      ((VignetteFilterTransformation) o).center.equals(center.x, center.y) &&\n      Arrays.equals(((VignetteFilterTransformation) o).vignetteColor, vignetteColor) &&\n      ((VignetteFilterTransformation) o).vignetteStart == vignetteStart &&\n      ((VignetteFilterTransformation) o).vignetteEnd == vignetteEnd;\n  }\n\n  @Override\n  public int hashCode() {\n    return ID.hashCode() + center.hashCode() + Arrays.hashCode(vignetteColor) +\n      (int) (vignetteStart * 100) + (int) (vignetteEnd * 10);\n  }\n\n  @Override\n  public void updateDiskCacheKey(@NonNull MessageDigest messageDigest) {\n    messageDigest.update((ID + center + Arrays.hashCode(vignetteColor) + vignetteStart + vignetteEnd).getBytes(CHARSET));\n  }\n}\n"
  },
  {
    "path": "transformations/src/main/java/jp/wasabeef/glide/transformations/internal/FastBlur.java",
    "content": "package jp.wasabeef.glide.transformations.internal;\n\nimport android.graphics.Bitmap;\n\n/**\n * Copyright (C) 2020 Wasabeef\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * http://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npublic class FastBlur {\n\n  public static Bitmap blur(Bitmap sentBitmap, int radius, boolean canReuseInBitmap) {\n\n    // Stack Blur v1.0 from\n    // http://www.quasimondo.com/StackBlurForCanvas/StackBlurDemo.html\n    //\n    // Java Author: Mario Klingemann <mario at quasimondo.com>\n    // http://incubator.quasimondo.com\n    // created Feburary 29, 2004\n    // Android port : Yahel Bouaziz <yahel at kayenko.com>\n    // http://www.kayenko.com\n    // ported april 5th, 2012\n\n    // This is a compromise between Gaussian Blur and Box blur\n    // It creates much better looking blurs than Box Blur, but is\n    // 7x faster than my Gaussian Blur implementation.\n    //\n    // I called it Stack Blur because this describes best how this\n    // filter works internally: it creates a kind of moving stack\n    // of colors whilst scanning through the image. Thereby it\n    // just has to add one new block of color to the right side\n    // of the stack and remove the leftmost color. The remaining\n    // colors on the topmost layer of the stack are either added on\n    // or reduced by one, depending on if they are on the right or\n    // on the left side of the stack.\n    //\n    // If you are using this algorithm in your code please add\n    // the following line:\n    //\n    // Stack Blur Algorithm by Mario Klingemann <mario@quasimondo.com>\n\n    Bitmap bitmap;\n    if (canReuseInBitmap) {\n      bitmap = sentBitmap;\n    } else {\n      bitmap = sentBitmap.copy(sentBitmap.getConfig(), true);\n    }\n\n    if (radius < 1) {\n      return (null);\n    }\n\n    int w = bitmap.getWidth();\n    int h = bitmap.getHeight();\n\n    int[] pix = new int[w * h];\n    bitmap.getPixels(pix, 0, w, 0, 0, w, h);\n\n    int wm = w - 1;\n    int hm = h - 1;\n    int wh = w * h;\n    int div = radius + radius + 1;\n\n    int[] r = new int[wh];\n    int[] g = new int[wh];\n    int[] b = new int[wh];\n    int rsum, gsum, bsum, x, y, i, p, yp, yi, yw;\n    int[] vmin = new int[Math.max(w, h)];\n\n    int divsum = (div + 1) >> 1;\n    divsum *= divsum;\n    int[] dv = new int[256 * divsum];\n    for (i = 0; i < 256 * divsum; i++) {\n      dv[i] = (i / divsum);\n    }\n\n    yw = yi = 0;\n\n    int[][] stack = new int[div][3];\n    int stackpointer;\n    int stackstart;\n    int[] sir;\n    int rbs;\n    int r1 = radius + 1;\n    int routsum, goutsum, boutsum;\n    int rinsum, ginsum, binsum;\n\n    for (y = 0; y < h; y++) {\n      rinsum = ginsum = binsum = routsum = goutsum = boutsum = rsum = gsum = bsum = 0;\n      for (i = -radius; i <= radius; i++) {\n        p = pix[yi + Math.min(wm, Math.max(i, 0))];\n        sir = stack[i + radius];\n        sir[0] = (p & 0xff0000) >> 16;\n        sir[1] = (p & 0x00ff00) >> 8;\n        sir[2] = (p & 0x0000ff);\n        rbs = r1 - Math.abs(i);\n        rsum += sir[0] * rbs;\n        gsum += sir[1] * rbs;\n        bsum += sir[2] * rbs;\n        if (i > 0) {\n          rinsum += sir[0];\n          ginsum += sir[1];\n          binsum += sir[2];\n        } else {\n          routsum += sir[0];\n          goutsum += sir[1];\n          boutsum += sir[2];\n        }\n      }\n      stackpointer = radius;\n\n      for (x = 0; x < w; x++) {\n\n        r[yi] = dv[rsum];\n        g[yi] = dv[gsum];\n        b[yi] = dv[bsum];\n\n        rsum -= routsum;\n        gsum -= goutsum;\n        bsum -= boutsum;\n\n        stackstart = stackpointer - radius + div;\n        sir = stack[stackstart % div];\n\n        routsum -= sir[0];\n        goutsum -= sir[1];\n        boutsum -= sir[2];\n\n        if (y == 0) {\n          vmin[x] = Math.min(x + radius + 1, wm);\n        }\n        p = pix[yw + vmin[x]];\n\n        sir[0] = (p & 0xff0000) >> 16;\n        sir[1] = (p & 0x00ff00) >> 8;\n        sir[2] = (p & 0x0000ff);\n\n        rinsum += sir[0];\n        ginsum += sir[1];\n        binsum += sir[2];\n\n        rsum += rinsum;\n        gsum += ginsum;\n        bsum += binsum;\n\n        stackpointer = (stackpointer + 1) % div;\n        sir = stack[(stackpointer) % div];\n\n        routsum += sir[0];\n        goutsum += sir[1];\n        boutsum += sir[2];\n\n        rinsum -= sir[0];\n        ginsum -= sir[1];\n        binsum -= sir[2];\n\n        yi++;\n      }\n      yw += w;\n    }\n    for (x = 0; x < w; x++) {\n      rinsum = ginsum = binsum = routsum = goutsum = boutsum = rsum = gsum = bsum = 0;\n      yp = -radius * w;\n      for (i = -radius; i <= radius; i++) {\n        yi = Math.max(0, yp) + x;\n\n        sir = stack[i + radius];\n\n        sir[0] = r[yi];\n        sir[1] = g[yi];\n        sir[2] = b[yi];\n\n        rbs = r1 - Math.abs(i);\n\n        rsum += r[yi] * rbs;\n        gsum += g[yi] * rbs;\n        bsum += b[yi] * rbs;\n\n        if (i > 0) {\n          rinsum += sir[0];\n          ginsum += sir[1];\n          binsum += sir[2];\n        } else {\n          routsum += sir[0];\n          goutsum += sir[1];\n          boutsum += sir[2];\n        }\n\n        if (i < hm) {\n          yp += w;\n        }\n      }\n      yi = x;\n      stackpointer = radius;\n      for (y = 0; y < h; y++) {\n        // Preserve alpha channel: ( 0xff000000 & pix[yi] )\n        pix[yi] = (0xff000000 & pix[yi]) | (dv[rsum] << 16) | (dv[gsum] << 8) | dv[bsum];\n\n        rsum -= routsum;\n        gsum -= goutsum;\n        bsum -= boutsum;\n\n        stackstart = stackpointer - radius + div;\n        sir = stack[stackstart % div];\n\n        routsum -= sir[0];\n        goutsum -= sir[1];\n        boutsum -= sir[2];\n\n        if (x == 0) {\n          vmin[y] = Math.min(y + r1, hm) * w;\n        }\n        p = x + vmin[y];\n\n        sir[0] = r[p];\n        sir[1] = g[p];\n        sir[2] = b[p];\n\n        rinsum += sir[0];\n        ginsum += sir[1];\n        binsum += sir[2];\n\n        rsum += rinsum;\n        gsum += ginsum;\n        bsum += binsum;\n\n        stackpointer = (stackpointer + 1) % div;\n        sir = stack[stackpointer];\n\n        routsum += sir[0];\n        goutsum += sir[1];\n        boutsum += sir[2];\n\n        rinsum -= sir[0];\n        ginsum -= sir[1];\n        binsum -= sir[2];\n\n        yi += w;\n      }\n    }\n\n    bitmap.setPixels(pix, 0, w, 0, 0, w, h);\n\n    return (bitmap);\n  }\n}\n"
  },
  {
    "path": "transformations/src/main/java/jp/wasabeef/glide/transformations/internal/RSBlur.java",
    "content": "package jp.wasabeef.glide.transformations.internal;\n\nimport android.annotation.TargetApi;\nimport android.content.Context;\nimport android.graphics.Bitmap;\nimport android.os.Build;\nimport android.renderscript.Allocation;\nimport android.renderscript.Element;\nimport android.renderscript.RSRuntimeException;\nimport android.renderscript.RenderScript;\nimport android.renderscript.ScriptIntrinsicBlur;\n\n/**\n * Copyright (C) 2020 Wasabeef\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * http://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npublic class RSBlur {\n\n  public static Bitmap blur(Context context, Bitmap bitmap, int radius) throws RSRuntimeException {\n    RenderScript rs = null;\n    Allocation input = null;\n    Allocation output = null;\n    ScriptIntrinsicBlur blur = null;\n    try {\n      rs = RenderScript.create(context);\n      rs.setMessageHandler(new RenderScript.RSMessageHandler());\n      input = Allocation.createFromBitmap(rs, bitmap, Allocation.MipmapControl.MIPMAP_NONE,\n        Allocation.USAGE_SCRIPT);\n      output = Allocation.createTyped(rs, input.getType());\n      blur = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs));\n\n      blur.setInput(input);\n      blur.setRadius(radius);\n      blur.forEach(output);\n      output.copyTo(bitmap);\n    } finally {\n      if (rs != null) {\n        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n          RenderScript.releaseAllContexts();\n        } else {\n          rs.destroy();\n        }\n      }\n      if (input != null) {\n        input.destroy();\n      }\n      if (output != null) {\n        output.destroy();\n      }\n      if (blur != null) {\n        blur.destroy();\n      }\n    }\n\n    return bitmap;\n  }\n}\n"
  },
  {
    "path": "transformations/src/main/java/jp/wasabeef/glide/transformations/internal/Utils.java",
    "content": "package jp.wasabeef.glide.transformations.internal;\n\nimport android.content.Context;\nimport android.content.res.Resources;\nimport android.graphics.drawable.Drawable;\nimport android.os.Build;\n\n/**\n * Copyright (C) 2020 Wasabeef\n * <p>\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * <p>\n * http://www.apache.org/licenses/LICENSE-2.0\n * <p>\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npublic final class Utils {\n\n  private Utils() {\n    // Utility class.\n  }\n\n  public static int toDp(int px) {\n    return px * (int) Resources.getSystem().getDisplayMetrics().density;\n  }\n}\n"
  }
]