00001
00022
00023
00024
00025
00026 #ifndef __SYNFIG_RANDOM_H
00027 #define __SYNFIG_RANDOM_H
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #define POOL_SIZE (256)
00039 class Random
00040 {
00041 int pool_[POOL_SIZE];
00042 int seed_;
00043
00044 int x_mask, y_mask, t_mask;
00045
00046 public:
00047
00048 void set_seed(int x);
00049 int get_seed()const { return seed_; }
00050
00051 enum SmoothType
00052 {
00053 SMOOTH_DEFAULT = 0,
00054 SMOOTH_LINEAR = 1,
00055 SMOOTH_COSINE = 2,
00056 SMOOTH_SPLINE = 3,
00057 SMOOTH_CUBIC = 4,
00058 SMOOTH_FAST_SPLINE = 5,
00059 };
00060
00061 float operator()(int salt,int x,int y=0, int t=0)const;
00062 float operator()(SmoothType smooth,int subseed,float x,float y=0, float t=0)const;
00063 };
00064
00065
00066
00067 #endif