Back to index

kdeartwork  4.3.2
Classes | Defines | Functions | Variables
Euphoria.cpp File Reference
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <qtimer.h>
#include "Euphoria.h"
#include "Euphoria.moc"
#include "EuphoriaTexture.h"
#include <GL/glu.h>
#include <sys/time.h>
#include <unistd.h>
#include <klocale.h>
#include <kglobal.h>
#include <kconfig.h>
#include <qlayout.h>
#include <qlabel.h>
#include <qcombobox.h>
#include <kmessagebox.h>

Go to the source code of this file.

Classes

class  rsVec
class  wisp
class  KEuphoriaSaverInterface

Defines

#define NUMCONSTS   9
#define PIx2   6.28318530718f

Functions

double timeGetTime ()
void hsl2rgb (float h, float s, float l, float &r, float &g, float &b)
int myRandi (int x)
float myRandf (float x)
int main (int argc, char *argv[])
static int filterRandom (int n)

Variables

static EuphoriaWidget_ec = 0
static const char * defaultText []

Define Documentation

#define NUMCONSTS   9

Definition at line 34 of file Euphoria.cpp.

#define PIx2   6.28318530718f

Definition at line 35 of file Euphoria.cpp.


Function Documentation

static int filterRandom ( int  n) [static]

Definition at line 942 of file Euphoria.cpp.

{
    if( (n < 0) || (n >= EuphoriaWidget::DefaultModes) )
    {
        srand((unsigned)time(NULL));
        n = rand() % EuphoriaWidget::DefaultModes;
    }
    return n;
}

Here is the caller graph for this function:

void hsl2rgb ( float  h,
float  s,
float  l,
float &  r,
float &  g,
float &  b 
)

Definition at line 141 of file Euphoria.cpp.

{
    // hue influence
    if(h < 0.166667){  // full red, some green
        r = 1.0;
        g = h * 6.0f;
        b = 0.0;
    }
    else {
        if(h < 0.5){  // full green
            g = 1.0;
            if(h < 0.333333){  // some red
                r = 1.0f - ((h - 0.166667f) * 6.0f);
                b = 0.0;
            }
            else{  // some blue
                b = (h - 0.333333f) * 6.0f;
                r = 0.0;
            }
        }
        else{
            if(h < 0.833333){  // full blue
                b = 1.0;
                if(h < 0.666667){  // some green
                    g = 1.0f - ((h - 0.5f) * 6.0f);
                    r = 0.0;
                }
                else{  // some red
                    r = (h - 0.666667f) * 6.0f;
                    g = 0.0;
                }
            }
            else{  // full red, some blue
                r = 1.0;
                b = 1.0f - ((h - 0.833333f) * 6.0f);
                g = 0.0;
            }
        }
    }

    // saturation influence
    r = 1.0f - (s * (1.0f - r));
    g = 1.0f - (s * (1.0f - g));
    b = 1.0f - (s * (1.0f - b));

    // luminosity influence
    r *= l;
    g *= l;
    b *= l;
}

Here is the caller graph for this function:

int main ( int  argc,
char *  argv[] 
)

Definition at line 916 of file Euphoria.cpp.

{
    KEuphoriaSaverInterface kss;
    return kScreenSaverMain( argc, argv, kss );
}
float myRandf ( float  x) [inline]

Definition at line 198 of file Euphoria.cpp.

                             {
    return(float(rand() * x) / float(RAND_MAX));
}

Here is the caller graph for this function:

int myRandi ( int  x) [inline]

Definition at line 195 of file Euphoria.cpp.

                         {
    return((rand() * x) / RAND_MAX);
}

Here is the caller graph for this function:

double timeGetTime ( )

Definition at line 46 of file Euphoria.cpp.

{
    struct timeval tp;
    gettimeofday( &tp, 0 );
    return (double)tp.tv_sec + (double)tp.tv_usec / 1000000;
}

Here is the caller graph for this function:


Variable Documentation

EuphoriaWidget* _ec = 0 [static]

Definition at line 207 of file Euphoria.cpp.

const char* defaultText[] [static]
Initial value:
{
    I18N_NOOP( "Regular" ),
    I18N_NOOP( "Grid" ),
    I18N_NOOP( "Cubism" ),
    I18N_NOOP( "Bad Math" ),
    I18N_NOOP( "M-Theory" ),
    I18N_NOOP( "UHFTEM" ), 
    I18N_NOOP( "Nowhere" ),
    I18N_NOOP( "Echo" ),
    I18N_NOOP( "Kaleidoscope" ),
    I18N_NOOP( "(Random)" ),
    0
}

Definition at line 982 of file Euphoria.cpp.