chromium/third_party/material_color_utilities/src/cpp/utils/utils.cc

/*
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "cpp/utils/utils.h"

#include <math.h>

#include <algorithm>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <string>

#include "absl/strings/str_cat.h"

namespace material_color_utilities {

int RedFromInt(const Argb argb) {}

int GreenFromInt(const Argb argb) {}

int BlueFromInt(const Argb argb) {}

Argb ArgbFromRgb(const int red, const int green, const int blue) {}

// Converts a color from linear RGB components to ARGB format.
Argb ArgbFromLinrgb(Vec3 linrgb) {}

int Delinearized(const double rgb_component) {}

double Linearized(const int rgb_component) {}

int AlphaFromInt(Argb argb) {}

bool IsOpaque(Argb argb) {}

double LstarFromArgb(Argb argb) {}

double YFromLstar(double lstar) {}

double LstarFromY(double y) {}

int SanitizeDegreesInt(const int degrees) {}

// Sanitizes a degree measure as a floating-point number.
//
// Returns a degree measure between 0.0 (inclusive) and 360.0 (exclusive).
double SanitizeDegreesDouble(const double degrees) {}

double DiffDegrees(const double a, const double b) {}

double RotationDirection(const double from, const double to) {}

// Converts a color in ARGB format to a hexadecimal string in lowercase.
//
// For instance: hex_from_argb(0xff012345) == "ff012345"
std::string HexFromArgb(Argb argb) {}

Argb IntFromLstar(const double lstar) {}

// The signum function.
//
// Returns 1 if num > 0, -1 if num < 0, and 0 if num = 0
int Signum(double num) {}

double Lerp(double start, double stop, double amount) {}

Vec3 MatrixMultiply(Vec3 input, const double matrix[3][3]) {}
}  // namespace material_color_utilities