chromium/third_party/skia/modules/skcms/src/skcms_Transform.h

/*
 * Copyright 2018 Google LLC
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#pragma once

#include <stddef.h>
#include <stdint.h>

// skcms_Transform.h contains skcms implementation details.
// Please don't use this header from outside the skcms repo.

namespace skcms_private {

/** All transform ops */

#define SKCMS_WORK_OPS(M)

#define SKCMS_STORE_OPS(M)

enum class Op : int {};

/** Constants */

#if defined(__clang__) || defined(__GNUC__)
    static constexpr float INFINITY_ =;
#else
    static const union {
        uint32_t bits;
        float    f;
    } inf_ = { 0x7f800000 };
    #define INFINITY_
#endif

/** Vector type */

#if defined(__clang__)
    Vec __attribute__((ext_vector_type(N)));
#elif defined(__GNUC__)
    // Unfortunately, GCC does not allow us to omit the struct. This will not compile:
    //   template <int N, typename T> using Vec = T __attribute__((vector_size(N*sizeof(T))));
    template <int N, typename T> struct VecHelper {
        typedef T __attribute__((vector_size(N * sizeof(T)))) V;
    };
    template <int N, typename T> using Vec = typename VecHelper<N, T>::V;
#endif

/** Interface */

namespace baseline {

void run_program(const Op* program, const void** contexts, ptrdiff_t programSize,
                 const char* src, char* dst, int n,
                 const size_t src_bpp, const size_t dst_bpp);

}
namespace hsw {

void run_program(const Op* program, const void** contexts, ptrdiff_t programSize,
                 const char* src, char* dst, int n,
                 const size_t src_bpp, const size_t dst_bpp);

}
namespace skx {

void run_program(const Op* program, const void** contexts, ptrdiff_t programSize,
                 const char* src, char* dst, int n,
                 const size_t src_bpp, const size_t dst_bpp);

}
}  // namespace skcms_private