Classes | Defines | Typedefs | Functions

qxtflowview_p.h File Reference

#include "qxtflowview.h"
#include <QApplication>
#include <QCache>
#include <QHash>
#include <QImage>
#include <QKeyEvent>
#include <QPainter>
#include <QPixmap>
#include <QTimer>
#include <QVector>
#include <QWidget>
#include <QAbstractItemModel>
#include <QPersistentModelIndex>
#include <QList>

Go to the source code of this file.

Classes

struct  SlideInfo
class  QxtFlowViewState
class  QxtFlowViewAnimator
class  QxtFlowViewAbstractRenderer
class  QxtFlowViewSoftwareRenderer
class  QxtFlowViewPrivate

Defines

#define PICTUREFLOW_QT4
#define PFREAL_SHIFT   10
#define PFREAL_ONE   (1 << PFREAL_SHIFT)
#define IANGLE_MAX   1024
#define IANGLE_MASK   1023

Typedefs

typedef long PFreal

Functions

PFreal fmul (PFreal a, PFreal b)
PFreal fdiv (PFreal num, PFreal den)
PFreal fsin (int iangle)
PFreal fcos (int iangle)

Define Documentation

#define IANGLE_MASK   1023

Definition at line 79 of file qxtflowview_p.h.

Referenced by fsin().

#define IANGLE_MAX   1024
#define PFREAL_ONE   (1 << PFREAL_SHIFT)
#define PFREAL_SHIFT   10

Definition at line 75 of file qxtflowview_p.h.

Referenced by fdiv(), and fmul().

#define PICTUREFLOW_QT4

Definition at line 56 of file qxtflowview_p.h.


Typedef Documentation

typedef long PFreal

Definition at line 74 of file qxtflowview_p.h.


Function Documentation

PFreal fcos ( int  iangle ) [inline]

Definition at line 122 of file qxtflowview_p.h.

References fsin(), and IANGLE_MAX.

Referenced by QxtFlowViewState::reposition().

{
    return fsin(iangle + (IANGLE_MAX >> 2));
}
PFreal fdiv ( PFreal  num,
PFreal  den 
) [inline]

Definition at line 86 of file qxtflowview_p.h.

References PFREAL_SHIFT.

{
    long long p = (long long)(num) << (PFREAL_SHIFT * 2);
    long long q = p / (long long)den;
    long long r = q >> PFREAL_SHIFT;

    return r;
}
PFreal fmul ( PFreal  a,
PFreal  b 
) [inline]

Definition at line 81 of file qxtflowview_p.h.

References PFREAL_SHIFT.

Referenced by QxtFlowViewAnimator::update().

{
    return ((long long)(a))*((long long)(b)) >> PFREAL_SHIFT;
}
PFreal fsin ( int  iangle ) [inline]

Definition at line 95 of file qxtflowview_p.h.

References IANGLE_MASK, and IANGLE_MAX.

Referenced by fcos(), QxtFlowViewState::reposition(), and QxtFlowViewAnimator::update().

{
    // warning: regenerate the table if IANGLE_MAX and PFREAL_SHIFT are changed!
    static const PFreal tab[] =
    {
        3,    103,    202,    300,    394,    485,    571,    652,
        726,    793,    853,    904,    947,    980,   1004,   1019,
        1023,   1018,   1003,    978,    944,    901,    849,    789,
        721,    647,    566,    479,    388,    294,    196,     97,
        -4,   -104,   -203,   -301,   -395,   -486,   -572,   -653,
        -727,   -794,   -854,   -905,   -948,   -981,  -1005,  -1020,
        -1024,  -1019,  -1004,   -979,   -945,   -902,   -850,   -790,
        -722,   -648,   -567,   -480,   -389,   -295,   -197,    -98,
        3
    };

    while (iangle < 0)
        iangle += IANGLE_MAX;
    iangle &= IANGLE_MASK;

    int i = (iangle >> 4);
    PFreal p = tab[i];
    PFreal q = tab[(i+1)];
    PFreal g = (q - p);
    return p + g * (iangle - i*16) / 16;
}
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines