allgames/engine/src/graph/noise.h
2026-02-22 22:15:45 -03:00

40 lines
No EOL
770 B
C++

#pragma once
struct buffer {
char**pixel;//rgba format
};
enum NOISETYPE {
CLOUD,
RANDOM,
};
enum DIMENSION {
ONE,TWO,THREE,FOUR
};
class noise {
public:
int freq;
int octave;
int amp;
NOISETYPE type;
DIMENSION dims;
noise(int freq,int octave, int amp, NOISETYPE type, DIMENSION dims):
freq(freq), octave(octave), amp(amp), type(type),dims(dims) {
}
/// to explain the image generator
/// \param x int
/// \param y int
/// ^ these here is the position the noise will start rendering
/// \param w
/// \param h
/// these are the image width and height. PLEASE DO NOT GET CONFUSED
buffer* gen(short w, short h,int x, int y);
};
buffer* cloud(noise* noise,short w, short h,int x, int y);
buffer* random(noise* noise, short w, short h,int x, int y);