chromium/skia/ext/recursive_gaussian_convolution.cc

// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include <algorithm>
#include <cmath>
#include <vector>

#include "base/check_op.h"
#include "base/notreached.h"
#include "skia/ext/recursive_gaussian_convolution.h"

namespace skia {

namespace {

// Takes the value produced by accumulating element-wise product of image with
// a kernel and brings it back into range.
// All of the filter scaling factors are in fixed point with kShiftBits bits of
// fractional part.
template<bool take_absolute>
inline unsigned char FloatTo8(float f) {}

template<RecursiveFilter::Order order>
inline float ForwardFilter(float in_n_1,
                           float in_n,
                           float in_n1,
                           const std::vector<float>& w,
                           int n,
                           const float* b) {}

template<RecursiveFilter::Order order>
inline float BackwardFilter(const std::vector<float>& out,
                            int n,
                            float w_n,
                            float w_n1,
                            const float* b) {}

template<RecursiveFilter::Order order, bool absolute_values>
unsigned char SingleChannelRecursiveFilter(
    const unsigned char* const source_data,
    int source_pixel_stride,
    int source_row_stride,
    int row_width,
    int row_count,
    unsigned char* const output,
    int output_pixel_stride,
    int output_row_stride,
    const float* b) {}

unsigned char SingleChannelRecursiveFilter(
    const unsigned char* const source_data,
    int source_pixel_stride,
    int source_row_stride,
    int row_width,
    int row_count,
    unsigned char* const output,
    int output_pixel_stride,
    int output_row_stride,
    const float* b,
    RecursiveFilter::Order order,
    bool absolute_values) {}

}

float RecursiveFilter::qFromSigma(float sigma) {}

void RecursiveFilter::computeCoefficients(float q, float b[4]) {}

RecursiveFilter::RecursiveFilter(float sigma, Order order)
    :{}

unsigned char SingleChannelRecursiveGaussianX(const unsigned char* source_data,
                                              int source_byte_row_stride,
                                              int input_channel_index,
                                              int input_channel_count,
                                              const RecursiveFilter& filter,
                                              const SkISize& image_size,
                                              unsigned char* output,
                                              int output_byte_row_stride,
                                              int output_channel_index,
                                              int output_channel_count,
                                              bool absolute_values) {}

unsigned char  SingleChannelRecursiveGaussianY(const unsigned char* source_data,
                                               int source_byte_row_stride,
                                               int input_channel_index,
                                               int input_channel_count,
                                               const RecursiveFilter& filter,
                                               const SkISize& image_size,
                                               unsigned char* output,
                                               int output_byte_row_stride,
                                               int output_channel_index,
                                               int output_channel_count,
                                               bool absolute_values) {}

}  // namespace skia