Version 3.0

How to Use

Chromatic Glass helps people with color vision deficiency (protan, deutan, and tritan types) tell colors apart more easily.
It changes colors of the device camera image or of an image file from Photos in real time. It changes only the necessary parts, keeping the original colors as much as possible, so that colors that are hard to tell apart look clearly different.
The app has a Settings screen, restores the last state, supports text size settings, and supports VoiceOver and TalkBack.

Three Modes

Switch the three modes with the Mode Tab at the very bottom of the screen (at launch, the app opens in the mode you used last).
  • Distinguish Color For telling apart colors that are hard to distinguish. This is the mode at the first launch.
  • Find Color For finding colors similar to the cursor color, or to one of the basic 11 colors, in the image.
  • Simulation Calculates how people of the P, D, and T color vision types may see colors, and shows it to people with common color vision (type C). It helps to understand which colors are hard to distinguish.

The Main Screen

All fundamental operations are performed on the main screen. It has status texts at the top, buttons on the left and right of the upper half, and the parts for each mode at the bottom. When you do not touch the screen for 10 seconds, all texts and buttons disappear except the cursor, the color name pop-up, the chromaticity diagram, and the basic 11 colors ribbon. Tap the screen once to show them again.

Status texts at the top

  • Upper left: the color zone (the range of colors that are changed) as "Start~End". In Distinguish Color, an R at the end means the zone is reversed. In Find Color, it shows the searching radius. In Simulation, it shows the simulation color vision type.
  • Upper center: the color vision type. The second line shows the zoom ratio.
  • Upper right: the color change as "Variation/Direction". A B after the variation means Boost Mode. In Simulation, it shows the simulation strength.

Buttons at the top (left column and right column)

  • Settings buttonSettings Opens the Settings screen.
  • Color name buttonColor Name Shows the name of the color under the cursor (the color name pop-up).
  • Chromaticity diagram buttonChromaticity Diagram Shows an xy or u'v' chromaticity diagram at the lower left. Choose which in Settings (the button's picture also changes to the shape of the chosen diagram). The small ring on the diagram is the position of the color under the cursor.
  • Simulation buttonSimulation Shows the image changed in Distinguish Color or Find Color as it may appear for the simulation color vision type and strength. (When the screen is not tall enough, this button is hidden.)
  • Save buttonSave Saves the currently displayed image, after the color change, to Photos.
  • Switch input buttonSwitch Input Chooses the rear camera, the front camera (if available), or an image file from Photos.
  • Light buttonLight Turns the camera light on. Press again to turn it off. Unavailable on devices without a light, while frozen, or for image files (hidden when the screen is not tall enough).
  • Freeze buttonFreeze Stops the video. Press again to resume. Unavailable for image files.

"Distinguish Color" Mode

This mode makes colors that people of the P, D, and T types tend to confuse easier to tell apart. The app builds "color zones" along the confusion lines (lines connecting confused colors), and changes the colors in the zone into the most distinguishable ones, keeping the original colors as much as possible. Zones and changes are calculated in a perceptually uniform color space (CIELUV).
The changed image is shown alternately with the original image, so the changed parts look as if they blink (0.33 seconds changed, 0.5 seconds original).

The toolbar

  • Left "↑" Opens the preset menu. After you choose one and confirm, its parameters are loaded. Long-press an item to save the current parameters to that preset.
  • Zone Range Slider Sets the range of colors to change. It has two thumbs, left and right; hold the part between them (blue) to move the whole range. The far left (0.0) is the side containing green, and the far right (1.0) is the side containing red (for type T, blue on the left and green on the right). Double-tap to turn the range on and off (width 0 and the former width).
  • Right "↑" Opens or closes the color change slider and the color vision type selector.

Color Change Slider (opened with the right "↑")

  • Move the thumb inside the circle. The distance from the center is the variation (0.0 to 0.5), and the clockwise angle from the top is the direction (0.0 to 1.0). The color of the disc shows how a middle gray changes when you put the thumb there.
  • Double-tap the thumb to turn Boost Mode on and off. When on, the disc becomes darker and the thumb becomes gold.

Color Vision Type Selector

Chooses the color vision type that is hard to distinguish (P, D, or T). It is linked with "Color Vision Type" in Settings.

"Find Color" Mode

Changes only the colors close to the cursor color, so you can find similar colors in the image. "Close" here ignores the difference in brightness and uses closeness of hue (a bright yellow and a dark yellow are close). The distance is measured in u'v' chromaticity.
  • Cursor Tap the screen to move the cursor. The color under it becomes the color to search for.
  • Munsell Ribbon (Basic 11 Colors) A ribbon of 11 colors: achromatic (N), red (R), yellow-red (YR), yellow (Y), yellow-green (GY), green (G), blue-green (BG), blue (B), purple-blue (PB), purple (P), and red-purple (RP). Tap a color to search for it. The colors are calculated at run time from Munsell notation (they are not images), and are shown in the display color space (sRGB or Display P3).
  • Left "↑" Opens the menu of the same 11 colors as the Munsell ribbon. The color you choose becomes the color to search for.
  • Searching Radius Slider Sets how far from the color to search. A small value finds only close colors, and a large one also finds different colors. The value 1.0 corresponds to 0.1 in u'v'. Double-tap to turn it on and off.
  • Right "↑" Opens or closes the color change slider and the color vision type selector. Their values are independent of Distinguish Color. This mode has no Boost Mode.

"Simulation" Mode

Makes an image showing how people of the selected color vision type may see the input image.
  • Color Vision Type (C, P, D, T) The type to simulate. C shows the original image.
  • Strength Slider 0.0 means no simulation and 1.0 means full simulation. In between, the original and the simulated image are blended. The simulation strength is a value for showing the intermediate image between the color appearance of the most severe form of dichromacy of each type (100%) and the original image (0%). It does not simulate the color appearance of anomalous trichromacy (mild color vision deficiency).
  • When you turn on the Simulation button (eye) at the top, the results of Distinguish Color and Find Color are also simulated with the settings of this mode.

Color Names (Color Cursor)

Turn on "Color Name" at the top (or "Show Color Name" in Settings) to show the cursor and the name of the color under it. Choose the content of the four lines in Settings (CIELAB, Oklab, CIELUV, RGB, XYZ, xyY, Munsell, JIS systematic and traditional color names, ISCC-NBS systematic names, TCCA traditional names, or none).
The color under the cursor is a weighted average over about 5 by 5 pixels (Gaussian filter). Values and names assume the image is in sRGB under a D65 light source, and follow the standards, but they are not necessarily accurate.

Chromaticity Diagram

When the "Chromaticity Diagram" button at the top is on, a chromaticity diagram (a triangle) is shown at the lower left. In Settings, "Chromaticity Diagram" chooses between the xy diagram and the u'v' diagram.
  • The triangle is the range of colors the screen can show (the gamut). The colors inside the diagram are the colors of those chromaticities.
  • The small ring on the diagram is the position of the color under the cursor. It moves when you move the cursor.
  • The diagram is only drawn on top of the screen. It is not affected by color changes, and is not included in saved images.

Presets

A preset stores the parameters of "Distinguish Color" (the zone start and end, the strength and direction of the color change, and the five switches) as one set. You can keep up to eight sets. If you make a set for each color or situation you want to tell apart (for example, looking for a red object, or looking at an outdoor scene), you can switch between them at once without setting everything up again.

How to use a preset

  1. 1. In "Distinguish Color", tap the "↑" button on the left of the bottom bar. The preset menu opens (from "1: name" to "8: name").
  2. 2. Tap the preset you want. There is no confirmation: the parameters of the preset are loaded at once and replace the current ones (the color vision type does not change).

Saving the current parameters

Press and hold an item in the menu for about two seconds. A confirmation appears; tap OK and the current parameters are saved to that preset (the old values are lost).

Initial values (eight sets) The names, and part of the zone positions, differ between types P and D and type T.

  • 1 Brighten Red (type T: "Brighten Green") Zone 0.80 to 1.00, strength 0.20.
  • 2 Darken Green (type T: "Darken Blue") Zone 0.00 to 0.25, strength 0.20.
  • 3 Brighten Red / Darken Green (type T: "Brighten Green / Darken Blue") The zone is reversed, so the outside of 0.25 to 0.80 (both ends) is changed. Strength 0.20.
  • 4 Dist. Orange and YellowGreen (type T: "Dist. Green and PurpleGreen") The zone is placed near the achromatic colors (white and gray) and reversed. Strength 0.45, direction 0.20, and the achromatic zone is not kept.
  • 5 Auto Color Zone / 0.2 / Bright Auto Color Zone is on. A zone of width 0.2 follows the color under the cursor. Strength 0.20.
  • 6 Yellow WarmCol. / Blue ColdCol. (type T: "Redden Green / BlueGreen Blue") The whole zone (0.00 to 1.00), strength 0.40, direction 0.25, Boost Mode on.
  • 7 Blue Cold Colors (type T: "Redden B, BP, P, RP") Zone from 0.00 to the achromatic position, strength 0.25, direction 0.75, Boost Mode on.
  • 8 No Change Strength 0. The colors are not changed.

The "Preset Parameters" screen Open "Preset Parameters" in Settings to see the list of the eight sets. Choose one to edit the following items.

  • Preset Name The name shown in the menu. If you leave it empty or make it the same as the initial name, it returns to the initial name. A short, clear name makes it easy to find in the menu. Spaces at the start and end are removed when the name is saved.
  • Color Zone Start / End (0.00 to 1.00) The range of colors to change. They correspond to the two handles of the zone range slider.
  • Variation (distance) (0.00 to 0.50) and Direction (angle) (0.00 to 1.00) They correspond to the distance from the center and the angle of the circular slider for the color change.
  • The five switches Auto Color Zone, Reverse Color Zone, Inversion on Both Sides, Keep Achromatic Zone, and Boost Mode. Their meanings are the same as in "Color change options" in Settings above.

The three buttons (each one shows a confirmation when you tap it)

  • Use This Preset Immediately Loads the parameters of this preset and switches to "Distinguish Color". The current parameters are replaced.
  • Save Current Parameters Here Saves the parameters currently used in "Distinguish Color" to this preset (the old values are lost; the name does not change).
  • Reset Parameters to Default Returns the name and the values of this preset to the initial ones.
The presets are kept even after you quit the app. The app does not overwrite the switches with Preset 1 at every launch. It restores the state at the last exit (mode, color vision type, and all parameters) as it was.

Gestures

  • Tap Moves the cursor. When the controls are hidden, shows them.
  • Double-tap Resets zoom, pan, and the cursor. On the zone range slider or the searching radius slider, turns the range on and off. On the thumb of the color change slider, switches Boost Mode.
  • Pinch Zooms in and out (up to 500%).
  • Pan Moves the image while frozen or when the image is from a file.
  • Long press Freezes after 1 second (can be turned off in Settings).
  • Volume buttons When turned on in Settings, the device volume buttons also save the image.

Saving Images

The Save button saves the currently displayed image, after the color change, to Photos. Whatever the blinking phase is, the saved image is always the one after the color change. When "Embed Text in Saved Images" in Settings is on, the mode and the parameters (mode name, color vision type, zoom, zone, color change, and so on) are written at the top of the image. Location is not saved. The color space follows "Color Space" in Settings (with Automatic, images are saved in Display P3 on screens that support it).

Settings

  • Embed Text in Saved Images See "Saving Images" above.
  • Color Changing Options Color Vision Type (P, D, or T); Auto Color Zone (centers the zone on the cursor color; the zone range slider turns yellow); Reverse Color Zone (changes the outside of the chosen range; for example, with 0.3 to 0.5, it changes 0.0 to 0.3 and 0.5 to 1.0); Inversion on Both Sides (turns the color change direction by 0.5 for colors on the green side of achromatic); Keep Achromatic Zone (does not change colors near white and gray); Boost Mode (a strong change that moves colors close to spectral lights: 575 nm and 475 nm for types P and D, 660 nm and 485 nm for type T).
  • Controls Freeze on Long Press, Save on Volume (iOS 17.2 or later), Cont. Auto Focus OFF, the Chromaticity Diagram (xy or u'v'), and Zone Allocation (see the next item).
  • Zone Allocation Chooses how the value of the zone range slider decides which colors are changed in "Distinguish Color". Chart Angle Method (the default, the same as 2.21) uses the angle on the chromaticity diagram. Color Appearance Gap Method uses the distance between the original color and the color moved along the confusion line (including the difference in lightness). Chroma Gap Method uses the same kind of distance by hue and saturation only, regardless of lightness. With a different method, the same slider value changes different colors. The formulas and figures are on the "Theory" page of the website (the theory of Chromatic Glass 3.0, section 6).
  • Color Name Display Turns color names on and off, and sets the four lines of the pop-up.
  • Sound The save sound on and off and its volume, and vibration.
  • Color Space Automatic (Display P3 on screens that support a wide gamut) or sRGB.
  • Preset Parameters See "Presets" above.
  • Others Reset (resets all settings, the state, and the presets to the initial values), How to Use (shows this manual), and Privacy Policy.
  • Application Info. Shows the version and the copyright.

VoiceOver and TalkBack

The app supports screen readers. It gives names and states to the buttons, sliders, the Mode Tab, the color vision type selector, and the pop-up menus. Sliders can be increased and decreased with the screen reader actions. When the controls are hidden, the app tells you to tap the screen to show them. Text follows the text size setting of the device (texts and buttons over the video have an upper limit so that they do not become too large).

Troubleshooting

  • No image is displayed. If camera access is not allowed, allow it in Settings > Privacy on the device (App permissions on Android).
  • Cannot save. If adding photos is not allowed, allow Photos on the same screen.
  • The colors do not change as expected. Check the color vision type (P, D, T), the zone range, and the variation and the direction. Also check that "Reverse Color Zone" and "Auto Color Zone" in Settings are not on by mistake.

Others

  • This application software was developed by Kazunori Asada (MD, PhD in Media Design) and is released free of charge.
  • Color changes are made on color zones based on confusion lines, in a perceptually uniform color space (CIELUV). Simulation images are based on the method proposed in the following paper.
    H. Brettel, F. Viénot, and J. D. Mollon: Computerized simulation of color appearance for dichromats, Journal of the Optical Society of America A, vol.14, no.10, pp.2647-2655 (Oct. 1997).
  • Changed images and simulation images are calculated under specific methods and conditions, and do not necessarily show how colors look exactly. Please use them as a rough guide.
  • Color names shown are calculated under specific assumptions according to the standards, and are not necessarily accurate. How they look also depends on the color of the device screen.
  • Terms such as "P type", "D type", and "T type" used in this manual are academic terms.
  • Details of the theory are on the "Theory" page of the website.
  • The Android version and the iPhone/iPad version behave the same (the differences are only where "iOS 17.2 or later" and the like are written above).

Licenses

Chromatic Glass uses the open-source software and font listed below. The full license texts are in the second half of this section.

Components and copyright notices

  • Android Jetpack (AndroidX, Compose, CameraX): Copyright The Android Open Source Project (Apache-2.0)
  • Kotlin standard library, kotlinx (coroutines, serialization, atomicfu): Copyright JetBrains s.r.o. and Kotlin Programming Language contributors (Apache-2.0)
  • JetBrains annotations: Copyright JetBrains s.r.o. (Apache-2.0)
  • Dagger: Copyright Google, Inc. (Apache-2.0)
  • AutoValue annotations: Copyright (C) 2012 Google, Inc. (Apache-2.0)
  • JSpecify: Copyright The JSpecify Authors (Apache-2.0)
  • Jakarta Inject: Copyright Eclipse Foundation and the respective authors (Apache-2.0)
  • javax.inject (JSR-330), Guava ListenableFuture: Apache-2.0
  • libyuv (included in CameraX): Copyright 2011 The LibYuv Project Authors. All rights reserved. Licensed under BSD-3-Clause.
  • Roboto Bold font (a subset of Latin characters): Copyright 2011 Google Inc. All Rights Reserved. (Apache-2.0)

Sources of the color name data: NBS Circular 553 (ISCC-NBS); NBS Special Publication 440 (the figures of the ISCC-NBS regions); Kelly, J. Res. NBS 61(5), 1958 (the central notations of the ISCC-NBS color-name blocks); NBS Research Paper RP1700 (Reimann, Judd and Keegan, 1946; the TCCA standard color cards). All are publications of the U.S. National Bureau of Standards (NBS).

The full texts of the Apache-2.0 and BSD-3-Clause licenses follow.

Apache License, Version 2.0

                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Copyright [yyyy] [name of copyright owner]

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

libyuv (BSD-3-Clause)

Copyright 2011 The LibYuv Project Authors. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

  * Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.

  * Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in
    the documentation and/or other materials provided with the
    distribution.

  * Neither the name of Google nor the names of its contributors may
    be used to endorse or promote products derived from this software
    without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.