w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

pixman-filter.c File Reference
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <assert.h>
#include "pixman-private.h"
Include dependency graph for pixman-filter.c:

Go to the source code of this file.

Classes

struct  filter_info_t
 

Macros

#define SQRT2   (1.4142135623730950488016887242096980785696718753769480)
 
#define SIGMA   (SQRT2 / 2.0)
 
#define N_SEGMENTS   12
 
#define SAMPLE(a1, a2)    (filters[kernel1].func ((a1)) * filters[kernel2].func ((a2) * scale))
 

Typedefs

typedef double(* kernel_func_t) (double x)
 

Functions

static double impulse_kernel (double x)
 
static double box_kernel (double x)
 
static double linear_kernel (double x)
 
static double gaussian_kernel (double x)
 
static double sinc (double x)
 
static double lanczos (double x, int n)
 
static double lanczos2_kernel (double x)
 
static double lanczos3_kernel (double x)
 
static double nice_kernel (double x)
 
static double general_cubic (double x, double B, double C)
 
static double cubic_kernel (double x)
 
static double integral (pixman_kernel_t kernel1, double x1, pixman_kernel_t kernel2, double scale, double x2, double width)
 
static void create_1d_filter (int width, pixman_kernel_t reconstruct, pixman_kernel_t sample, double scale, int n_phases, pixman_fixed_t *p)
 
static int filter_width (pixman_kernel_t reconstruct, pixman_kernel_t sample, double size)
 
pixman_fixed_tpixman_filter_create_separable_convolution (int *n_values, pixman_fixed_t scale_x, pixman_fixed_t scale_y, pixman_kernel_t reconstruct_x, pixman_kernel_t reconstruct_y, pixman_kernel_t sample_x, pixman_kernel_t sample_y, int subsample_bits_x, int subsample_bits_y)
 

Variables

static const filter_info_t filters []
 

Macro Definition Documentation

◆ N_SEGMENTS

#define N_SEGMENTS   12

◆ SAMPLE

#define SAMPLE (   a1,
  a2 
)     (filters[kernel1].func ((a1)) * filters[kernel2].func ((a2) * scale))

◆ SIGMA

#define SIGMA   (SQRT2 / 2.0)

◆ SQRT2

#define SQRT2   (1.4142135623730950488016887242096980785696718753769480)

Typedef Documentation

◆ kernel_func_t

typedef double(* kernel_func_t) (double x)

Definition at line 36 of file pixman-filter.c.

Function Documentation

◆ box_kernel()

static double box_kernel ( double  x)
static

Definition at line 52 of file pixman-filter.c.

◆ create_1d_filter()

static void create_1d_filter ( int  width,
pixman_kernel_t  reconstruct,
pixman_kernel_t  sample,
double  scale,
int  n_phases,
pixman_fixed_t p 
)
static

◆ cubic_kernel()

static double cubic_kernel ( double  x)
static

Definition at line 130 of file pixman-filter.c.

References general_cubic(), and cordic::x.

◆ filter_width()

static int filter_width ( pixman_kernel_t  reconstruct,
pixman_kernel_t  sample,
double  size 
)
static

Definition at line 313 of file pixman-filter.c.

References ceil(), filters, size, and width.

Referenced by pixman_filter_create_separable_convolution().

◆ gaussian_kernel()

static double gaussian_kernel ( double  x)
static

Definition at line 64 of file pixman-filter.c.

References exp(), M_PI, SIGMA, sqrt(), and cordic::x.

◆ general_cubic()

static double general_cubic ( double  x,
double  B,
double  C 
)
static

Definition at line 106 of file pixman-filter.c.

References B, C, fabs, and cordic::x.

Referenced by cubic_kernel().

◆ impulse_kernel()

static double impulse_kernel ( double  x)
static

Definition at line 46 of file pixman-filter.c.

References cordic::x.

◆ integral()

static double integral ( pixman_kernel_t  kernel1,
double  x1,
pixman_kernel_t  kernel2,
double  scale,
double  x2,
double  width 
)
static

◆ lanczos()

static double lanczos ( double  x,
int  n 
)
static

Definition at line 82 of file pixman-filter.c.

References n, sinc(), and cordic::x.

Referenced by lanczos2_kernel(), and lanczos3_kernel().

◆ lanczos2_kernel()

static double lanczos2_kernel ( double  x)
static

Definition at line 88 of file pixman-filter.c.

References lanczos(), and cordic::x.

◆ lanczos3_kernel()

static double lanczos3_kernel ( double  x)
static

Definition at line 94 of file pixman-filter.c.

References lanczos(), and cordic::x.

Referenced by nice_kernel().

◆ linear_kernel()

static double linear_kernel ( double  x)
static

Definition at line 58 of file pixman-filter.c.

References fabs, and cordic::x.

◆ nice_kernel()

static double nice_kernel ( double  x)
static

Definition at line 100 of file pixman-filter.c.

References lanczos3_kernel(), and cordic::x.

◆ pixman_filter_create_separable_convolution()

pixman_fixed_t* pixman_filter_create_separable_convolution ( int n_values,
pixman_fixed_t  scale_x,
pixman_fixed_t  scale_y,
pixman_kernel_t  reconstruct_x,
pixman_kernel_t  reconstruct_y,
pixman_kernel_t  sample_x,
pixman_kernel_t  sample_y,
int  subsample_bits_x,
int  subsample_bits_y 
)

◆ sinc()

static double sinc ( double  x)
static

Definition at line 73 of file pixman-filter.c.

References M_PI, sin(), and cordic::x.

Referenced by lanczos().

Variable Documentation

◆ filters

const filter_info_t filters[]
static
Initial value:
=
{
}
static double cubic_kernel(double x)
static double gaussian_kernel(double x)
Definition: pixman-filter.c:64
static double linear_kernel(double x)
Definition: pixman-filter.c:58
static double nice_kernel(double x)
static double lanczos2_kernel(double x)
Definition: pixman-filter.c:88
static double impulse_kernel(double x)
Definition: pixman-filter.c:46
static double lanczos3_kernel(double x)
Definition: pixman-filter.c:94
static double box_kernel(double x)
Definition: pixman-filter.c:52
@ PIXMAN_KERNEL_GAUSSIAN
Definition: pixman.h:1094
@ PIXMAN_KERNEL_BOX
Definition: pixman.h:1091
@ PIXMAN_KERNEL_LANCZOS3
Definition: pixman.h:1096
@ PIXMAN_KERNEL_LINEAR
Definition: pixman.h:1092
@ PIXMAN_KERNEL_IMPULSE
Definition: pixman.h:1090
@ PIXMAN_KERNEL_LANCZOS2
Definition: pixman.h:1095
@ PIXMAN_KERNEL_LANCZOS3_STRETCHED
Definition: pixman.h:1097
@ PIXMAN_KERNEL_CUBIC
Definition: pixman.h:1093

Definition at line 140 of file pixman-filter.c.

Referenced by create_1d_filter(), filter_width(), and integral().