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-matrix.c File Reference
#include <math.h>
#include <string.h>
#include "pixman-private.h"
Include dependency graph for pixman-matrix.c:

Go to the source code of this file.

Macros

#define F(x)   pixman_int_to_fixed (x)
 
#define EPSILON   (pixman_fixed_t) (2)
 
#define IS_SAME(a, b)   (within_epsilon (a, b, EPSILON))
 
#define IS_ZERO(a)   (within_epsilon (a, 0, EPSILON))
 
#define IS_ONE(a)   (within_epsilon (a, F (1), EPSILON))
 
#define IS_UNIT(a)
 
#define IS_INT(a)   (IS_ZERO (pixman_fixed_frac (a)))
 

Typedefs

typedef pixman_fixed_32_32_t pixman_fixed_34_30_t
 

Functions

static int count_leading_zeros (uint32_t x)
 
static uint64_t rounded_udiv_128_by_48 (uint64_t hi, uint64_t lo, uint64_t div, uint64_t *result_hi)
 
static int64_t rounded_sdiv_128_by_49 (int64_t hi, uint64_t lo, int64_t div, int64_t *signed_result_hi)
 
static void fixed_64_16_to_int128 (int64_t hi, int64_t lo, int64_t *rhi, int64_t *rlo, int scalebits)
 
static pixman_fixed_48_16_t fixed_112_16_to_fixed_48_16 (int64_t hi, int64_t lo, pixman_bool_t *clampflag)
 
pixman_bool_t pixman_transform_point_31_16 (const pixman_transform_t *t, const pixman_vector_48_16_t *v, pixman_vector_48_16_t *result)
 
void pixman_transform_point_31_16_affine (const pixman_transform_t *t, const pixman_vector_48_16_t *v, pixman_vector_48_16_t *result)
 
void pixman_transform_point_31_16_3d (const pixman_transform_t *t, const pixman_vector_48_16_t *v, pixman_vector_48_16_t *result)
 
void pixman_transform_init_identity (struct pixman_transform *matrix)
 
pixman_bool_t pixman_transform_point_3d (const struct pixman_transform *transform, struct pixman_vector *vector)
 
pixman_bool_t pixman_transform_point (const struct pixman_transform *transform, struct pixman_vector *vector)
 
pixman_bool_t pixman_transform_multiply (struct pixman_transform *dst, const struct pixman_transform *l, const struct pixman_transform *r)
 
void pixman_transform_init_scale (struct pixman_transform *t, pixman_fixed_t sx, pixman_fixed_t sy)
 
static pixman_fixed_t fixed_inverse (pixman_fixed_t x)
 
pixman_bool_t pixman_transform_scale (struct pixman_transform *forward, struct pixman_transform *reverse, pixman_fixed_t sx, pixman_fixed_t sy)
 
void pixman_transform_init_rotate (struct pixman_transform *t, pixman_fixed_t c, pixman_fixed_t s)
 
pixman_bool_t pixman_transform_rotate (struct pixman_transform *forward, struct pixman_transform *reverse, pixman_fixed_t c, pixman_fixed_t s)
 
void pixman_transform_init_translate (struct pixman_transform *t, pixman_fixed_t tx, pixman_fixed_t ty)
 
pixman_bool_t pixman_transform_translate (struct pixman_transform *forward, struct pixman_transform *reverse, pixman_fixed_t tx, pixman_fixed_t ty)
 
pixman_bool_t pixman_transform_bounds (const struct pixman_transform *matrix, struct pixman_box16 *b)
 
pixman_bool_t pixman_transform_invert (struct pixman_transform *dst, const struct pixman_transform *src)
 
static pixman_bool_t within_epsilon (pixman_fixed_t a, pixman_fixed_t b, pixman_fixed_t epsilon)
 
pixman_bool_t pixman_transform_is_identity (const struct pixman_transform *t)
 
pixman_bool_t pixman_transform_is_scale (const struct pixman_transform *t)
 
pixman_bool_t pixman_transform_is_int_translate (const struct pixman_transform *t)
 
pixman_bool_t pixman_transform_is_inverse (const struct pixman_transform *a, const struct pixman_transform *b)
 
void pixman_f_transform_from_pixman_transform (struct pixman_f_transform *ft, const struct pixman_transform *t)
 
pixman_bool_t pixman_transform_from_pixman_f_transform (struct pixman_transform *t, const struct pixman_f_transform *ft)
 
pixman_bool_t pixman_f_transform_invert (struct pixman_f_transform *dst, const struct pixman_f_transform *src)
 
pixman_bool_t pixman_f_transform_point (const struct pixman_f_transform *t, struct pixman_f_vector *v)
 
void pixman_f_transform_point_3d (const struct pixman_f_transform *t, struct pixman_f_vector *v)
 
void pixman_f_transform_multiply (struct pixman_f_transform *dst, const struct pixman_f_transform *l, const struct pixman_f_transform *r)
 
void pixman_f_transform_init_scale (struct pixman_f_transform *t, double sx, double sy)
 
pixman_bool_t pixman_f_transform_scale (struct pixman_f_transform *forward, struct pixman_f_transform *reverse, double sx, double sy)
 
void pixman_f_transform_init_rotate (struct pixman_f_transform *t, double c, double s)
 
pixman_bool_t pixman_f_transform_rotate (struct pixman_f_transform *forward, struct pixman_f_transform *reverse, double c, double s)
 
void pixman_f_transform_init_translate (struct pixman_f_transform *t, double tx, double ty)
 
pixman_bool_t pixman_f_transform_translate (struct pixman_f_transform *forward, struct pixman_f_transform *reverse, double tx, double ty)
 
pixman_bool_t pixman_f_transform_bounds (const struct pixman_f_transform *t, struct pixman_box16 *b)
 
void pixman_f_transform_init_identity (struct pixman_f_transform *t)
 

Macro Definition Documentation

◆ EPSILON

#define EPSILON   (pixman_fixed_t) (2)

Definition at line 669 of file pixman-matrix.c.

◆ F

#define F (   x)    pixman_int_to_fixed (x)

Definition at line 35 of file pixman-matrix.c.

◆ IS_INT

#define IS_INT (   a)    (IS_ZERO (pixman_fixed_frac (a)))

Definition at line 678 of file pixman-matrix.c.

◆ IS_ONE

#define IS_ONE (   a)    (within_epsilon (a, F (1), EPSILON))

Definition at line 673 of file pixman-matrix.c.

◆ IS_SAME

#define IS_SAME (   a,
  b 
)    (within_epsilon (a, b, EPSILON))

Definition at line 671 of file pixman-matrix.c.

◆ IS_UNIT

#define IS_UNIT (   a)
Value:
(within_epsilon (a, F (1), EPSILON) || \
within_epsilon (a, F (-1), EPSILON) || \
IS_ZERO (a))
#define a(n)
Definition: gpos-common.c:148
#define EPSILON
#define F(x)
Definition: pixman-matrix.c:35
static pixman_bool_t within_epsilon(pixman_fixed_t a, pixman_fixed_t b, pixman_fixed_t epsilon)

Definition at line 674 of file pixman-matrix.c.

◆ IS_ZERO

#define IS_ZERO (   a)    (within_epsilon (a, 0, EPSILON))

Definition at line 672 of file pixman-matrix.c.

Typedef Documentation

◆ pixman_fixed_34_30_t

Definition at line 379 of file pixman-matrix.c.

Function Documentation

◆ count_leading_zeros()

static int count_leading_zeros ( uint32_t  x)
inlinestatic

Definition at line 38 of file pixman-matrix.c.

References n, and cordic::x.

Referenced by pixman_transform_point_31_16().

◆ fixed_112_16_to_fixed_48_16()

static pixman_fixed_48_16_t fixed_112_16_to_fixed_48_16 ( int64_t  hi,
int64_t  lo,
pixman_bool_t clampflag 
)
inlinestatic

Definition at line 174 of file pixman-matrix.c.

References INT64_MAX, INT64_MIN, and TRUE.

Referenced by pixman_transform_point_31_16().

◆ fixed_64_16_to_int128()

static void fixed_64_16_to_int128 ( int64_t  hi,
int64_t  lo,
int64_t rhi,
int64_t rlo,
int  scalebits 
)
inlinestatic

Definition at line 143 of file pixman-matrix.c.

References uint64_t.

Referenced by pixman_transform_point_31_16().

◆ fixed_inverse()

static pixman_fixed_t fixed_inverse ( pixman_fixed_t  x)
static

Definition at line 472 of file pixman-matrix.c.

References F, and cordic::x.

Referenced by pixman_transform_scale().

◆ pixman_f_transform_bounds()

pixman_bool_t pixman_f_transform_bounds ( const struct pixman_f_transform t,
struct pixman_box16 b 
)

Definition at line 1014 of file pixman-matrix.c.

References b, ceil(), FALSE, floor, i, pixman_f_transform_point(), TRUE, v, x1, x2, y1, and y2.

◆ pixman_f_transform_from_pixman_transform()

void pixman_f_transform_from_pixman_transform ( struct pixman_f_transform ft,
const struct pixman_transform t 
)

Definition at line 739 of file pixman-matrix.c.

References i, j, pixman_f_transform::m, and pixman_fixed_to_double.

Referenced by pixman_transform_invert().

◆ pixman_f_transform_init_identity()

void pixman_f_transform_init_identity ( struct pixman_f_transform t)

Definition at line 1064 of file pixman-matrix.c.

References i, and j.

◆ pixman_f_transform_init_rotate()

void pixman_f_transform_init_rotate ( struct pixman_f_transform t,
double  c,
double  s 
)

Definition at line 936 of file pixman-matrix.c.

References c, and s.

Referenced by pixman_f_transform_rotate().

◆ pixman_f_transform_init_scale()

void pixman_f_transform_init_scale ( struct pixman_f_transform t,
double  sx,
double  sy 
)

Definition at line 894 of file pixman-matrix.c.

Referenced by pixman_f_transform_scale().

◆ pixman_f_transform_init_translate()

void pixman_f_transform_init_translate ( struct pixman_f_transform t,
double  tx,
double  ty 
)

Definition at line 975 of file pixman-matrix.c.

Referenced by pixman_f_transform_translate().

◆ pixman_f_transform_invert()

pixman_bool_t pixman_f_transform_invert ( struct pixman_f_transform dst,
const struct pixman_f_transform src 
)

Definition at line 773 of file pixman-matrix.c.

References a, b, d, det(), link_confs::dst, FALSE, i, j, p, link_confs::src, and TRUE.

Referenced by pixman_transform_invert().

◆ pixman_f_transform_multiply()

void pixman_f_transform_multiply ( struct pixman_f_transform dst,
const struct pixman_f_transform l,
const struct pixman_f_transform r 
)

◆ pixman_f_transform_point()

pixman_bool_t pixman_f_transform_point ( const struct pixman_f_transform t,
struct pixman_f_vector v 
)

Definition at line 825 of file pixman-matrix.c.

References a, FALSE, i, j, check-static-inits::result, TRUE, and v.

Referenced by pixman_f_transform_bounds().

◆ pixman_f_transform_point_3d()

void pixman_f_transform_point_3d ( const struct pixman_f_transform t,
struct pixman_f_vector v 
)

Definition at line 852 of file pixman-matrix.c.

References a, i, j, check-static-inits::result, and v.

◆ pixman_f_transform_rotate()

pixman_bool_t pixman_f_transform_rotate ( struct pixman_f_transform forward,
struct pixman_f_transform reverse,
double  c,
double  s 
)

◆ pixman_f_transform_scale()

pixman_bool_t pixman_f_transform_scale ( struct pixman_f_transform forward,
struct pixman_f_transform reverse,
double  sx,
double  sy 
)

◆ pixman_f_transform_translate()

pixman_bool_t pixman_f_transform_translate ( struct pixman_f_transform forward,
struct pixman_f_transform reverse,
double  tx,
double  ty 
)

◆ pixman_transform_bounds()

pixman_bool_t pixman_transform_bounds ( const struct pixman_transform matrix,
struct pixman_box16 b 
)

Definition at line 586 of file pixman-matrix.c.

References b, F, FALSE, i, matrix(), pixman_fixed_ceil, pixman_fixed_to_int, pixman_transform_point(), TRUE, v, x1, x2, y1, and y2.

◆ pixman_transform_from_pixman_f_transform()

pixman_bool_t pixman_transform_from_pixman_f_transform ( struct pixman_transform t,
const struct pixman_f_transform ft 
)

Definition at line 752 of file pixman-matrix.c.

References d, FALSE, floor, i, j, pixman_f_transform::m, and TRUE.

Referenced by pixman_transform_invert().

◆ pixman_transform_init_identity()

void pixman_transform_init_identity ( struct pixman_transform matrix)

Definition at line 370 of file pixman-matrix.c.

References F, i, matrix(), and memset().

◆ pixman_transform_init_rotate()

void pixman_transform_init_rotate ( struct pixman_transform t,
pixman_fixed_t  c,
pixman_fixed_t  s 
)

Definition at line 507 of file pixman-matrix.c.

References c, F, memset(), and s.

Referenced by pixman_transform_rotate().

◆ pixman_transform_init_scale()

void pixman_transform_init_scale ( struct pixman_transform t,
pixman_fixed_t  sx,
pixman_fixed_t  sy 
)

Definition at line 460 of file pixman-matrix.c.

References F, and memset().

Referenced by pixman_transform_scale().

◆ pixman_transform_init_translate()

void pixman_transform_init_translate ( struct pixman_transform t,
pixman_fixed_t  tx,
pixman_fixed_t  ty 
)

Definition at line 546 of file pixman-matrix.c.

References F, and memset().

Referenced by pixman_transform_translate().

◆ pixman_transform_invert()

◆ pixman_transform_is_identity()

pixman_bool_t pixman_transform_is_identity ( const struct pixman_transform t)

Definition at line 681 of file pixman-matrix.c.

References IS_SAME, and IS_ZERO.

Referenced by pixman_transform_is_inverse().

◆ pixman_transform_is_int_translate()

pixman_bool_t pixman_transform_is_int_translate ( const struct pixman_transform t)

Definition at line 711 of file pixman-matrix.c.

References IS_INT, IS_ONE, and IS_ZERO.

◆ pixman_transform_is_inverse()

pixman_bool_t pixman_transform_is_inverse ( const struct pixman_transform a,
const struct pixman_transform b 
)

Definition at line 727 of file pixman-matrix.c.

References a, b, FALSE, pixman_transform_is_identity(), and pixman_transform_multiply().

◆ pixman_transform_is_scale()

pixman_bool_t pixman_transform_is_scale ( const struct pixman_transform t)

Definition at line 695 of file pixman-matrix.c.

References IS_ZERO.

◆ pixman_transform_multiply()

◆ pixman_transform_point()

pixman_bool_t pixman_transform_point ( const struct pixman_transform transform,
struct pixman_vector vector 
)

◆ pixman_transform_point_31_16()

◆ pixman_transform_point_31_16_3d()

void pixman_transform_point_31_16_3d ( const pixman_transform_t t,
const pixman_vector_48_16_t v,
pixman_vector_48_16_t result 
)

Definition at line 338 of file pixman-matrix.c.

References assert(), i, int64_t, check-static-inits::result, and v.

Referenced by pixman_transform_point_3d().

◆ pixman_transform_point_31_16_affine()

void pixman_transform_point_31_16_affine ( const pixman_transform_t t,
const pixman_vector_48_16_t v,
pixman_vector_48_16_t result 
)

Definition at line 307 of file pixman-matrix.c.

References assert(), int64_t, pixman_fixed_1, check-static-inits::result, and v.

◆ pixman_transform_point_3d()

◆ pixman_transform_rotate()

pixman_bool_t pixman_transform_rotate ( struct pixman_transform forward,
struct pixman_transform reverse,
pixman_fixed_t  c,
pixman_fixed_t  s 
)

◆ pixman_transform_scale()

pixman_bool_t pixman_transform_scale ( struct pixman_transform forward,
struct pixman_transform reverse,
pixman_fixed_t  sx,
pixman_fixed_t  sy 
)

◆ pixman_transform_translate()

pixman_bool_t pixman_transform_translate ( struct pixman_transform forward,
struct pixman_transform reverse,
pixman_fixed_t  tx,
pixman_fixed_t  ty 
)

◆ rounded_sdiv_128_by_49()

static int64_t rounded_sdiv_128_by_49 ( int64_t  hi,
uint64_t  lo,
int64_t  div,
int64_t signed_result_hi 
)
inlinestatic

Definition at line 103 of file pixman-matrix.c.

References div(), rounded_udiv_128_by_48(), and sign.

Referenced by pixman_transform_point_31_16().

◆ rounded_udiv_128_by_48()

static uint64_t rounded_udiv_128_by_48 ( uint64_t  hi,
uint64_t  lo,
uint64_t  div,
uint64_t result_hi 
)
inlinestatic

Definition at line 67 of file pixman-matrix.c.

References assert(), div(), and remainder().

Referenced by rounded_sdiv_128_by_49().

◆ within_epsilon()

static pixman_bool_t within_epsilon ( pixman_fixed_t  a,
pixman_fixed_t  b,
pixman_fixed_t  epsilon 
)
static

Definition at line 657 of file pixman-matrix.c.

References a, b, and t.