view src/dmperlin.h @ 2576:812b16ee49db

I had been living under apparent false impression that "realfft.c" on which the FFT implementation in DMLIB was basically copied from was released in public domain at some point, but it could very well be that it never was. Correct license is (or seems to be) GNU GPL. Thus I removing the code from DMLIB, and profusely apologize to the author, Philip Van Baren. It was never my intention to distribute code based on his original work under a more liberal license than originally intended.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 11 Mar 2022 16:32:50 +0200
parents 85fab9d640ec
children 04c035342960
line wrap: on
line source

/*
 * DMLib
 * -- Perlin noise functionality
 * Programmed and designed by Matti 'ccr' Hamalainen
 * (C) Copyright 2012 Tecnic Software productions (TNSP)
 */
#ifndef DMPERLIN_H
#define DMPERLIN_H

#include "dmlib.h"

#ifdef __cplusplus
extern "C" {
#endif


#define DM_PLNS_B       (0x100)
#define DM_PLNS_BM      (0x0ff)
#define DM_PLNS_N       (0x1000)

typedef struct
{
    int p[DM_PLNS_B + DM_PLNS_B + 2];
    DMFloat g2[DM_PLNS_B + DM_PLNS_B + 2][2];
    DMFloat g1[DM_PLNS_B + DM_PLNS_B + 2];
} DMPerlinContext;


int      dmPerlinInit(DMPerlinContext *ctx, const int seed);
DMFloat  dmPerlinNoise2D(const DMPerlinContext *ctx, DMFloat x, DMFloat y, DMFloat alpha, DMFloat beta, int n);


#ifdef __cplusplus
}
#endif

#endif // DMPERLIN_H