aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkColorLookUpTable.cpp
blob: f376621e7f210b78a2ec07a80d212903aa4a5a80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
 * Copyright 2016 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include "SkColorLookUpTable.h"
#include "SkColorSpaceXformPriv.h"
#include "SkFloatingPoint.h"

SkColorLookUpTable::SkColorLookUpTable(uint8_t inputChannels, const uint8_t limits[]) {
    fInputChannels = inputChannels;
    SkASSERT(inputChannels >= 1 && inputChannels <= kMaxColorChannels);
    memcpy(fLimits, limits, fInputChannels * sizeof(uint8_t));

    for (int i = 0; i < inputChannels; i++) {
        SkASSERT(fLimits[i] > 1);
    }
}