aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu/GrColorSpaceXform.h
blob: 177230c87c8df72656a38df7f2727980f7dffc27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
 * Copyright 2016 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef GrColorSpaceXform_DEFINED
#define GrColorSpaceXform_DEFINED

#include "SkRefCnt.h"

class SkColorSpace;
class SkMatrix44;

 /**
  * Represents a color gamut transformation (as a 4x4 color matrix)
  */
class GrColorSpaceXform : public SkRefCnt {
public:
    GrColorSpaceXform(const SkMatrix44& srcToDst);

    static sk_sp<GrColorSpaceXform> Make(SkColorSpace* src, SkColorSpace* dst);

    const float* srcToDst() { return fSrcToDst; }

private:
    // We store the column-major form of the srcToDst matrix, for easy uploading to uniforms
    float fSrcToDst[16];
};

#endif