18 void BLI_jitterate1(
float (*jit1)[2],
float (*jit2)[2],
int num,
float radius1)
21 float vecx, vecy, dvecx, dvecy,
x,
y,
len;
23 for (i = num - 1; i >= 0; i--) {
27 for (j = num - 1; j >= 0; j--) {
29 vecx = jit1[j][0] -
x - 1.0f;
30 vecy = jit1[j][1] -
y - 1.0f;
31 for (k = 3; k > 0; k--) {
32 if (
fabsf(vecx) < radius1 &&
fabsf(vecy) < radius1) {
33 len =
sqrtf(vecx * vecx + vecy * vecy);
34 if (
len > 0 &&
len < radius1) {
42 if (
fabsf(vecx) < radius1 &&
fabsf(vecy) < radius1) {
43 len =
sqrtf(vecx * vecx + vecy * vecy);
44 if (
len > 0 &&
len < radius1) {
52 if (
fabsf(vecx) < radius1 &&
fabsf(vecy) < radius1) {
53 len =
sqrtf(vecx * vecx + vecy * vecy);
54 if (
len > 0 &&
len < radius1) {
73 memcpy(jit1, jit2, 2 * (
unsigned int)num *
sizeof(
float));
76 void BLI_jitterate2(
float (*jit1)[2],
float (*jit2)[2],
int num,
float radius2)
79 float vecx, vecy, dvecx, dvecy,
x,
y;
81 for (i = num - 1; i >= 0; i--) {
85 for (j = num - 1; j >= 0; j--) {
87 vecx = jit1[j][0] -
x - 1.0f;
88 vecy = jit1[j][1] -
y - 1.0f;
90 if (
fabsf(vecx) < radius2) {
91 dvecx += vecx * radius2;
94 if (
fabsf(vecx) < radius2) {
95 dvecx += vecx * radius2;
98 if (
fabsf(vecx) < radius2) {
99 dvecx += vecx * radius2;
102 if (
fabsf(vecy) < radius2) {
103 dvecy += vecy * radius2;
106 if (
fabsf(vecy) < radius2) {
107 dvecy += vecy * radius2;
110 if (
fabsf(vecy) < radius2) {
111 dvecy += vecy * radius2;
123 memcpy(jit1, jit2, (
unsigned int)num *
sizeof(
float[2]));
129 float number_fl, number_fl_sqrt;
130 float x, rad1, rad2, rad3;
138 number_fl = (
float)num;
139 number_fl_sqrt =
sqrtf(number_fl);
141 jit2 =
MEM_mallocN(12 + (
unsigned int)num *
sizeof(
float[2]),
"initjit");
142 rad1 = 1.0f / number_fl_sqrt;
143 rad2 = 1.0f / number_fl;
144 rad3 = number_fl_sqrt / number_fl;
149 for (i = 0; i < num; i++) {
158 for (i = 0; i < 24; i++) {
167 for (i = 0; i < num; i++) {
168 jitarr[i][0] -= 0.5f;
169 jitarr[i][1] -= 0.5f;
typedef float(TangentPoint)[2]
void BLI_rng_free(struct RNG *rng) ATTR_NONNULL(1)
struct RNG * BLI_rng_new(unsigned int seed)
double BLI_rng_get_double(struct RNG *rng) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Strict compiler flags for areas of code we want to ensure don't do conversions without us knowing abo...
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
Read Guarded memory(de)allocation.
void BLI_jitterate1(float(*jit1)[2], float(*jit2)[2], int num, float radius1)
void BLI_jitter_init(float(*jitarr)[2], int num)
void BLI_jitterate2(float(*jit1)[2], float(*jit2)[2], int num, float radius2)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_mallocN)(size_t len, const char *str)