34 void BLI_jitterate1(
float (*jit1)[2],
float (*jit2)[2],
int num,
float radius1)
37 float vecx, vecy, dvecx, dvecy,
x,
y,
len;
39 for (i = num - 1; i >= 0; i--) {
43 for (j = num - 1; j >= 0; j--) {
45 vecx = jit1[j][0] -
x - 1.0f;
46 vecy = jit1[j][1] -
y - 1.0f;
47 for (k = 3; k > 0; k--) {
48 if (
fabsf(vecx) < radius1 &&
fabsf(vecy) < radius1) {
49 len =
sqrtf(vecx * vecx + vecy * vecy);
50 if (
len > 0 &&
len < radius1) {
58 if (
fabsf(vecx) < radius1 &&
fabsf(vecy) < radius1) {
59 len =
sqrtf(vecx * vecx + vecy * vecy);
60 if (
len > 0 &&
len < radius1) {
68 if (
fabsf(vecx) < radius1 &&
fabsf(vecy) < radius1) {
69 len =
sqrtf(vecx * vecx + vecy * vecy);
70 if (
len > 0 &&
len < radius1) {
89 memcpy(jit1, jit2, 2 * (
unsigned int)num *
sizeof(
float));
92 void BLI_jitterate2(
float (*jit1)[2],
float (*jit2)[2],
int num,
float radius2)
95 float vecx, vecy, dvecx, dvecy,
x,
y;
97 for (i = num - 1; i >= 0; i--) {
101 for (j = num - 1; j >= 0; j--) {
103 vecx = jit1[j][0] -
x - 1.0f;
104 vecy = jit1[j][1] -
y - 1.0f;
106 if (
fabsf(vecx) < radius2) {
107 dvecx += vecx * radius2;
110 if (
fabsf(vecx) < radius2) {
111 dvecx += vecx * radius2;
114 if (
fabsf(vecx) < radius2) {
115 dvecx += vecx * radius2;
118 if (
fabsf(vecy) < radius2) {
119 dvecy += vecy * radius2;
122 if (
fabsf(vecy) < radius2) {
123 dvecy += vecy * radius2;
126 if (
fabsf(vecy) < radius2) {
127 dvecy += vecy * radius2;
139 memcpy(jit1, jit2, (
unsigned int)num *
sizeof(
float[2]));
145 float num_fl, num_fl_sqrt;
146 float x, rad1, rad2, rad3;
155 num_fl_sqrt =
sqrtf(num_fl);
157 jit2 =
MEM_mallocN(12 + (
unsigned int)num *
sizeof(
float[2]),
"initjit");
158 rad1 = 1.0f / num_fl_sqrt;
159 rad2 = 1.0f / num_fl;
160 rad3 = num_fl_sqrt / num_fl;
165 for (i = 0; i < num; i++) {
174 for (i = 0; i < 24; i++) {
183 for (i = 0; i < num; i++) {
184 jitarr[i][0] -= 0.5f;
185 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)