Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(699)

Side by Side Diff: include/core/SkColor.h

Issue 1666343002: add kRGBA_F16_SkColorType (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add unittest Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | include/core/SkImageInfo.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkColor_DEFINED 8 #ifndef SkColor_DEFINED
9 #define SkColor_DEFINED 9 #define SkColor_DEFINED
10 10
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 B = SK_B32_SHIFT/8, 173 B = SK_B32_SHIFT/8,
174 }; 174 };
175 float fVec[4]; 175 float fVec[4];
176 176
177 float a() const { return fVec[A]; } 177 float a() const { return fVec[A]; }
178 178
179 SkColor4f unpremul() const; 179 SkColor4f unpremul() const;
180 180
181 static SkPM4f FromPMColor(SkPMColor); 181 static SkPM4f FromPMColor(SkPMColor);
182 182
183 // half-float routines
184 void toF16(uint16_t[4]) const;
185 uint64_t toF16() const; // 4 float16 values packed into uint64_t
186 static SkPM4f FromF16(const uint16_t[4]);
187
183 #ifdef SK_DEBUG 188 #ifdef SK_DEBUG
184 void assertIsUnit() const; 189 void assertIsUnit() const;
185 #else 190 #else
186 void assertIsUnit() const {} 191 void assertIsUnit() const {}
187 #endif 192 #endif
188 }; 193 };
189 194
190 /* 195 /*
191 * The float values are 0...1 unpremultiplied 196 * The float values are 0...1 unpremultiplied
192 */ 197 */
(...skipping 17 matching lines...) Expand all
210 static SkColor4f FromColor(SkColor); 215 static SkColor4f FromColor(SkColor);
211 216
212 SkColor4f pin() const { 217 SkColor4f pin() const {
213 return Pin(fA, fR, fG, fB); 218 return Pin(fA, fR, fG, fB);
214 } 219 }
215 220
216 SkPM4f premul() const; 221 SkPM4f premul() const;
217 }; 222 };
218 223
219 #endif 224 #endif
OLDNEW
« no previous file with comments | « no previous file | include/core/SkImageInfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698