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

Side by Side Diff: src/core/SkColorLookUpTable.h

Issue 2449243003: Initial implementation of a SkColorSpace_A2B xform (Closed)
Patch Set: fixed compile error on certain trybots related to RVO move-elision Created 4 years, 1 month 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 | « gn/core.gni ('k') | src/core/SkColorLookUpTable.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2016 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #ifndef SkColorLookUpTable_DEFINED
9 #define SkColorLookUpTable_DEFINED
10
11 #include "SkRefCnt.h"
12 #include "SkTemplates.h"
13
14 class SkColorLookUpTable : public SkRefCnt {
15 public:
16 static constexpr uint8_t kOutputChannels = 3;
17
18 SkColorLookUpTable(uint8_t inputChannels, const uint8_t gridPoints[3]) {
19 SkASSERT(3 == inputChannels);
20 memcpy(fGridPoints, gridPoints, 3 * sizeof(uint8_t));
21 }
22
23 void interp3D(float dst[3], float src[3]) const;
24
25 private:
26 const float* table() const {
27 return SkTAddOffset<const float>(this, sizeof(SkColorLookUpTable));
28 }
29
30 uint8_t fGridPoints[3];
31
32 public:
33 // Objects of this type are created in a custom fashion using sk_malloc_thro w
34 // and therefore must be sk_freed.
35 void* operator new(size_t size) = delete;
36 void* operator new(size_t, void* p) { return p; }
37 void operator delete(void* p) { sk_free(p); }
38 };
39
40 #endif
OLDNEW
« no previous file with comments | « gn/core.gni ('k') | src/core/SkColorLookUpTable.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698