OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 28 matching lines...) Expand all Loading... |
39 namespace ColorSpaceUtilities { | 39 namespace ColorSpaceUtilities { |
40 | 40 |
41 // Get a pointer to a 8-bit lookup table that will convert color components | 41 // Get a pointer to a 8-bit lookup table that will convert color components |
42 // in the |srcColorSpace| to the |dstColorSpace|. | 42 // in the |srcColorSpace| to the |dstColorSpace|. |
43 // If the conversion cannot be performed, or is a no-op (identity transform), | 43 // If the conversion cannot be performed, or is a no-op (identity transform), |
44 // then 0 is returned. | 44 // then 0 is returned. |
45 // (Note that a round-trip - f(B,A)[f(A,B)[x]] - is not lossless in general.) | 45 // (Note that a round-trip - f(B,A)[f(A,B)[x]] - is not lossless in general.) |
46 const uint8_t* getConversionLUT(ColorSpace dstColorSpace, | 46 const uint8_t* getConversionLUT(ColorSpace dstColorSpace, |
47 ColorSpace srcColorSpace = ColorSpaceDeviceRGB); | 47 ColorSpace srcColorSpace = ColorSpaceDeviceRGB); |
48 | 48 |
49 // Convert a Color assumed to be in the |srcColorSpace| into the |dstColorSpace|
. | 49 // Convert a Color assumed to be in the |srcColorSpace| into the |
| 50 // |dstColorSpace|. |
50 Color convertColor(const Color& srcColor, | 51 Color convertColor(const Color& srcColor, |
51 ColorSpace dstColorSpace, | 52 ColorSpace dstColorSpace, |
52 ColorSpace srcColorSpace = ColorSpaceDeviceRGB); | 53 ColorSpace srcColorSpace = ColorSpaceDeviceRGB); |
53 | 54 |
54 // Create a color filter that will convert from |srcColorSpace| into |dstColorSp
ace|. | 55 // Create a color filter that will convert from |srcColorSpace| into |
| 56 // |dstColorSpace|. |
55 sk_sp<SkColorFilter> createColorSpaceFilter(ColorSpace srcColorSpace, | 57 sk_sp<SkColorFilter> createColorSpaceFilter(ColorSpace srcColorSpace, |
56 ColorSpace dstColorSpace); | 58 ColorSpace dstColorSpace); |
57 | 59 |
58 } // namespace ColorSpaceUtilities | 60 } // namespace ColorSpaceUtilities |
59 | 61 |
60 } // namespace blink | 62 } // namespace blink |
61 | 63 |
62 #endif // ColorSpace_h | 64 #endif // ColorSpace_h |
OLD | NEW |