World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
mathematics.h
См. документацию.
1 /*
2  * copyright (c) 2005-2012 Michael Niedermayer <michaelni@gmx.at>
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
27 #ifndef AVUTIL_MATHEMATICS_H
28 #define AVUTIL_MATHEMATICS_H
29 
30 #include <stdint.h>
31 #include <math.h>
32 #include "attributes.h"
33 #include "rational.h"
34 #include "intfloat.h"
35 
36 #ifndef M_E
37 #define M_E 2.7182818284590452354 /* e */
38 #endif
39 #ifndef M_LN2
40 #define M_LN2 0.69314718055994530942 /* log_e 2 */
41 #endif
42 #ifndef M_LN10
43 #define M_LN10 2.30258509299404568402 /* log_e 10 */
44 #endif
45 #ifndef M_LOG2_10
46 #define M_LOG2_10 3.32192809488736234787 /* log_2 10 */
47 #endif
48 #ifndef M_PHI
49 #define M_PHI 1.61803398874989484820 /* phi / golden ratio */
50 #endif
51 #ifndef M_PI
52 #define M_PI 3.14159265358979323846 /* pi */
53 #endif
54 #ifndef M_PI_2
55 #define M_PI_2 1.57079632679489661923 /* pi/2 */
56 #endif
57 #ifndef M_SQRT1_2
58 #define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
59 #endif
60 #ifndef M_SQRT2
61 #define M_SQRT2 1.41421356237309504880 /* sqrt(2) */
62 #endif
63 #ifndef NAN
64 #define NAN av_int2float(0x7fc00000)
65 #endif
66 #ifndef INFINITY
67 #define INFINITY av_int2float(0x7f800000)
68 #endif
69 
79 enum AVRounding {
85 
109 };
110 
118 int64_t av_const av_gcd(int64_t a, int64_t b);
119 
131 
140 int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding rnd) av_const;
141 
152 
161  enum AVRounding rnd) av_const;
162 
175 int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b);
176 
196 
222 int64_t av_rescale_delta(AVRational in_tb, int64_t in_ts, AVRational fs_tb, int duration, int64_t *last, AVRational out_tb);
223 
235 int64_t av_add_stable(AVRational ts_tb, int64_t ts, AVRational inc_tb, int64_t inc);
236 
237 
242 #endif /* AVUTIL_MATHEMATICS_H */
av_compare_ts
int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b)
av_add_stable
int64_t av_add_stable(AVRational ts_tb, int64_t ts, AVRational inc_tb, int64_t inc)
rational.h
AVRounding
AVRounding
Definition: mathematics.h:79
intfloat.h
av_gcd
int64_t av_const av_gcd(int64_t a, int64_t b)
int64_t
__int64 int64_t
Definition: alext.h:31
AV_ROUND_UP
@ AV_ROUND_UP
Round toward +infinity.
Definition: mathematics.h:83
uint64_t
unsigned __int64 uint64_t
Definition: alext.h:32
av_rescale_q
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) av_const
av_rescale_delta
int64_t av_rescale_delta(AVRational in_tb, int64_t in_ts, AVRational fs_tb, int duration, int64_t *last, AVRational out_tb)
AV_ROUND_INF
@ AV_ROUND_INF
Round away from zero.
Definition: mathematics.h:81
AV_ROUND_NEAR_INF
@ AV_ROUND_NEAR_INF
Round to nearest and halfway cases away from zero.
Definition: mathematics.h:84
av_rescale_rnd
int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding rnd) av_const
AV_ROUND_ZERO
@ AV_ROUND_ZERO
Round toward zero.
Definition: mathematics.h:80
attributes.h
AV_ROUND_DOWN
@ AV_ROUND_DOWN
Round toward -infinity.
Definition: mathematics.h:82
b
GLboolean GLboolean GLboolean b
Definition: SDL_opengl_glext.h:1112
av_rescale
int64_t av_rescale(int64_t a, int64_t b, int64_t c) av_const
av_compare_mod
int64_t av_compare_mod(uint64_t a, uint64_t b, uint64_t mod)
c
const GLubyte * c
Definition: SDL_opengl_glext.h:11096
a
GLboolean GLboolean GLboolean GLboolean a
Definition: SDL_opengl_glext.h:1112
AVRational
Definition: rational.h:58
AV_ROUND_PASS_MINMAX
@ AV_ROUND_PASS_MINMAX
Definition: mathematics.h:108
av_rescale_q_rnd
int64_t av_rescale_q_rnd(int64_t a, AVRational bq, AVRational cq, enum AVRounding rnd) av_const