R/RcppExports.R

# This file was generated by Rcpp::compileAttributes
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' Squishes the contrast in an input luminance matrix. 
#' A great deal of tweaking of the
#' "alpha", "beta", "delta" and "theta" arguments is usually required before one
#' gets pleasing results.
#'
#' The HDR contrast processing is performed using Andrew Cotter's implementation of:
#' Raanan Fattal, Dani Lischinski and Michael Werman. "Gradient Domain 
#' High Dynamic Range Compression\". Proceedings of the 29th annual
#' conference on computer graphics and interactive techniques. Pages 249-256. 2002.
#' The alpha, beta and saturation parameters are analagous to those described in
#' the paper, except that in this implementation, alpha is a proportion of the
#' average gradient magnitude, and beta is what would be 1-beta in the paper.
#' Gamma is the maximum gradient attenuation factor at a given level, which is
#' needed in order to cope with small gradients. The paper isn't clear on whether
#' the average gradient magnitudes used for the alpha scaling should be the
#' overall averages, or the average only over the current level in the pyramid. The author 
#' uses a convex combination of these two averages, mediated by the theta
#' parameter, where 0 chooses the overall average, and 1 the average on the current pyramid level.
#' 
#'
#' @param alpha controls the point at which contrast-magnification gives way
#'        to contrast-attenuation (0,1)
#' @param beta controls the overall extent to which
#'        contrast-squishing is performed (0,1)
#' @param theta Increasing theta causes large-scale
#'        (spatially) contrast differences to be given greater importance, relative to
#'        small-scale differences. [0,1]
#' @param delta Changing delta seldom has any great effect. [1,Inf) 
#' @param Epsilon is
#'        the termination threshold--increasing it will reduce the quality of the
#'        solution, but improve runtime, while decreasing it will have the opposite
#'        effect. One warning: if epsilon is too small, then the solution may never
#'        converge, and you'll need to abort this program. (0,Inf)
#' @export
gradientDomainHDRCompression <- function(extractedLuminance, alpha = 0.1, beta = 0.1, delta = 1.1, theta = 0, epsilon = 0.0001) {
    .Call('astror_gradientDomainHDRCompression', PACKAGE = 'astror', extractedLuminance, alpha, beta, delta, theta, epsilon)
}
klapaukh/astror documentation built on May 20, 2019, 11:03 a.m.