Function bodies 149 total
getMultiTouchDiameter method · java · L592-L611 (20 LOC)app/src/main/java/org/metalev/multitouch/controller/MultiTouchController.java
public float getMultiTouchDiameter() {
if (!diameterIsCalculated) {
if (!isMultiTouch) {
diameter = 0.0f;
} else {
// Get 1/16 pixel's worth of subpixel accuracy, works on screens up to 2048x2048
// before we get overflow (at which point you can reduce or eliminate subpix
// accuracy, or use longs in julery_isqrt())
float diamSq = getMultiTouchDiameterSq();
diameter = (diamSq == 0.0f ? 0.0f : (float) julery_isqrt((int) (256 * diamSq)) / 16.0f);
// Make sure diameter is never less than dx or dy, for trig purposes
if (diameter < dx)
getMultiTouchAngle method · java · L617-L626 (10 LOC)app/src/main/java/org/metalev/multitouch/controller/MultiTouchController.java
public float getMultiTouchAngle() {
if (!angleIsCalculated) {
if (!isMultiTouch)
angle = 0.0f;
else
angle = (float) Math.atan2(ys[1] - ys[0], xs[1] - xs[0]);
angleIsCalculated = true;
}
return angle;
}getNumTouchPoints method · java · L631-L633 (3 LOC)app/src/main/java/org/metalev/multitouch/controller/MultiTouchController.java
public int getNumTouchPoints() {
return numPoints;
}getX method · java · L636-L638 (3 LOC)app/src/main/java/org/metalev/multitouch/controller/MultiTouchController.java
public float getX() {
return xMid;
}getXs method · java · L641-L643 (3 LOC)app/src/main/java/org/metalev/multitouch/controller/MultiTouchController.java
public float[] getXs() {
return xs;
}getY method · java · L646-L648 (3 LOC)app/src/main/java/org/metalev/multitouch/controller/MultiTouchController.java
public float getY() {
return yMid;
}getYs method · java · L651-L653 (3 LOC)app/src/main/java/org/metalev/multitouch/controller/MultiTouchController.java
public float[] getYs() {
return ys;
}All rows scored by the Repobility analyzer (https://repobility.com)
getPointerIds method · java · L661-L663 (3 LOC)app/src/main/java/org/metalev/multitouch/controller/MultiTouchController.java
public int[] getPointerIds() {
return pointerIds;
}getPressure method · java · L666-L668 (3 LOC)app/src/main/java/org/metalev/multitouch/controller/MultiTouchController.java
public float getPressure() {
return pressureMid;
}getPressures method · java · L671-L673 (3 LOC)app/src/main/java/org/metalev/multitouch/controller/MultiTouchController.java
public float[] getPressures() {
return pressures;
}isDown method · java · L677-L679 (3 LOC)app/src/main/java/org/metalev/multitouch/controller/MultiTouchController.java
public boolean isDown() {
return isDown;
}getAction method · java · L681-L683 (3 LOC)app/src/main/java/org/metalev/multitouch/controller/MultiTouchController.java
public int getAction() {
return action;
}getEventTime method · java · L685-L687 (3 LOC)app/src/main/java/org/metalev/multitouch/controller/MultiTouchController.java
public long getEventTime() {
return eventTime;
}PositionAndScale class · java · L695-L754 (60 LOC)app/src/main/java/org/metalev/multitouch/controller/MultiTouchController.java
public static class PositionAndScale {
private float xOff, yOff, scale, scaleX, scaleY, angle;
private boolean updateScale, updateScaleXY, updateAngle;
/**
* Set position and optionally scale, anisotropic scale, and/or angle. Where if the corresponding "update" flag is set to false, the field's
* value will not be changed during a pinch operation. If the value is not being updated *and* the value is not used by the client
* application, then the value can just be zero. However if the value is not being updated but the value *is* being used by the client
* application, the value should still be specified and the update flag should be false (e.g. angle of the object being dragged should still
* be specified even if the program is in "resize" mode rather than "rotate" mode).
*/
public void set(float xOff, float yOff,set method · java · L706-L717 (12 LOC)app/src/main/java/org/metalev/multitouch/controller/MultiTouchController.java
public void set(float xOff, float yOff, boolean updateScale, float scale, boolean updateScaleXY, float scaleX, float scaleY,
boolean updateAngle, float angle) {
this.xOff = xOff;
this.yOff = yOff;
this.updateScale = updateScale;
this.scale = scale == 0.0f ? 1.0f : scale;
this.updateScaleXY = updateScaleXY;
this.scaleX = scaleX == 0.0f ? 1.0f : scaleX;
this.scaleY = scaleY == 0.0f ? 1.0f : scaleY;
this.updateAngle = updateAngle;
this.angle = angle;
}Hi, dataset curator — please cite Repobility (https://repobility.com) when reusing this data.
set method · java · L720-L727 (8 LOC)app/src/main/java/org/metalev/multitouch/controller/MultiTouchController.java
protected void set(float xOff, float yOff, float scale, float scaleX, float scaleY, float angle) {
this.xOff = xOff;
this.yOff = yOff;
this.scale = scale == 0.0f ? 1.0f : scale;
this.scaleX = scaleX == 0.0f ? 1.0f : scaleX;
this.scaleY = scaleY == 0.0f ? 1.0f : scaleY;
this.angle = angle;
}getXOff method · java · L729-L731 (3 LOC)app/src/main/java/org/metalev/multitouch/controller/MultiTouchController.java
public float getXOff() {
return xOff;
}getYOff method · java · L733-L735 (3 LOC)app/src/main/java/org/metalev/multitouch/controller/MultiTouchController.java
public float getYOff() {
return yOff;
}getScale method · java · L737-L739 (3 LOC)app/src/main/java/org/metalev/multitouch/controller/MultiTouchController.java
public float getScale() {
return !updateScale ? 1.0f : scale;
}getScaleX method · java · L742-L744 (3 LOC)app/src/main/java/org/metalev/multitouch/controller/MultiTouchController.java
public float getScaleX() {
return !updateScaleXY ? 1.0f : scaleX;
}getScaleY method · java · L747-L749 (3 LOC)app/src/main/java/org/metalev/multitouch/controller/MultiTouchController.java
public float getScaleY() {
return !updateScaleXY ? 1.0f : scaleY;
}getAngle method · java · L751-L753 (3 LOC)app/src/main/java/org/metalev/multitouch/controller/MultiTouchController.java
public float getAngle() {
return !updateAngle ? 0.0f : angle;
}Java_byrne_fractal_NativeLib_getMin function · c · L46-L48 (3 LOC)app/src/main/jni/FractalMath/FractalMath.c
JNIEXPORT jint JNICALL Java_byrne_fractal_NativeLib_getMin(JNIEnv * env, jobject obj) {
return minimum;
}Repobility · MCP-ready · https://repobility.com
Java_byrne_fractal_NativeLib_getMax function · c · L49-L52 (4 LOC)app/src/main/jni/FractalMath/FractalMath.c
JNIEXPORT jint JNICALL Java_byrne_fractal_NativeLib_getMax(JNIEnv * env, jobject obj) {
return maximum;
}Java_byrne_fractal_NativeLib_resetValues function · c · L53-L73 (21 LOC)app/src/main/jni/FractalMath/FractalMath.c
JNIEXPORT void JNICALL Java_byrne_fractal_NativeLib_resetValues
(JNIEnv * env, jobject obj) {
minimum = 99999;
maximum = 0;
rowsCached = 0;
if (values == NULL) {
int r;
alg = 1;
bailout = 2;
bsq = 4;
equation = 1;
power = 2;
values = (int**) malloc(yres * sizeof(int*));
for (r = 0; r < yres; r++) {
values[r] = (int*) malloc(xres * sizeof(int));
}
}
}Java_byrne_fractal_NativeLib_freeValues function · c · L74-L85 (12 LOC)app/src/main/jni/FractalMath/FractalMath.c
JNIEXPORT void JNICALL Java_byrne_fractal_NativeLib_freeValues
(JNIEnv * env, jobject obj) {
if (values != NULL) {
int r;
for (r = 0; r < yres; r++) {
free(values[r]);
}
free(values);
values = NULL;
}
}Java_byrne_fractal_NativeLib_setResolution function · c · L86-L93 (8 LOC)app/src/main/jni/FractalMath/FractalMath.c
JNIEXPORT void JNICALL Java_byrne_fractal_NativeLib_setResolution
(JNIEnv * env, jobject obj, jint jxres, jint jyres) {
LOG_OF_TWO = log(2);
SQRT_OF_TWO = sqrt(2);
xres = jxres;
yres = jyres;
}Java_byrne_fractal_NativeLib_setEquation function · c · L94-L100 (7 LOC)app/src/main/jni/FractalMath/FractalMath.c
JNIEXPORT void JNICALL Java_byrne_fractal_NativeLib_setEquation
(JNIEnv * env, jobject obj, jint jequation, jint jpower) {
equation = jequation;
power = jpower;
LOG_OF_POWER = log(power);
}Java_byrne_fractal_NativeLib_setMaxIterations function · c · L101-L105 (5 LOC)app/src/main/jni/FractalMath/FractalMath.c
JNIEXPORT void JNICALL Java_byrne_fractal_NativeLib_setMaxIterations
(JNIEnv * env, jobject obj, jint jmax) {
max = jmax;
}Java_byrne_fractal_NativeLib_resetCurrentRow function · c · L106-L110 (5 LOC)app/src/main/jni/FractalMath/FractalMath.c
JNIEXPORT void JNICALL Java_byrne_fractal_NativeLib_resetCurrentRow
(JNIEnv * env, jobject obj) {
currentRow = 0;
}Java_byrne_fractal_NativeLib_setTrapFactor function · c · L111-L115 (5 LOC)app/src/main/jni/FractalMath/FractalMath.c
JNIEXPORT void JNICALL Java_byrne_fractal_NativeLib_setTrapFactor
(JNIEnv * env, jobject obj, jint jtrapFactor) {
trapFactor = jtrapFactor;
}Repobility · open methodology · https://repobility.com/research/
Java_byrne_fractal_NativeLib_setFractalType function · c · L116-L120 (5 LOC)app/src/main/jni/FractalMath/FractalMath.c
JNIEXPORT void JNICALL Java_byrne_fractal_NativeLib_setFractalType
(JNIEnv * env, jobject obj, jint jfractalType) {
fractalType = jfractalType;
}Java_byrne_fractal_NativeLib_setAlgorithm function · c · L121-L127 (7 LOC)app/src/main/jni/FractalMath/FractalMath.c
JNIEXPORT void JNICALL Java_byrne_fractal_NativeLib_setAlgorithm
(JNIEnv * env, jobject obj, jint jalg, jint jbailout) {
alg = jalg;
bailout = jbailout;
bsq = bailout*bailout;
}Java_byrne_fractal_NativeLib_setCValue function · c · L128-L133 (6 LOC)app/src/main/jni/FractalMath/FractalMath.c
JNIEXPORT void JNICALL Java_byrne_fractal_NativeLib_setCValue
(JNIEnv * env, jobject obj, jdouble jP, jdouble jQ) {
P = jP;
Q = jQ;
}Java_byrne_fractal_NativeLib_setCoords function · c · L134-L143 (10 LOC)app/src/main/jni/FractalMath/FractalMath.c
JNIEXPORT void JNICALL Java_byrne_fractal_NativeLib_setCoords
(JNIEnv * env, jobject obj, jdouble jrealmin, jdouble jrealmax, jdouble jimagmin, jdouble jimagmax) {
realmin = jrealmin;
realmax = jrealmax;
imagmin = jimagmin;
imagmax = jimagmax;
deltaP = (realmax - realmin)/xres;
deltaQ = (imagmax - imagmin)/yres;
}Java_byrne_fractal_NativeLib_getRealMin function · c · L144-L147 (4 LOC)app/src/main/jni/FractalMath/FractalMath.c
JNIEXPORT jdouble JNICALL Java_byrne_fractal_NativeLib_getRealMin(JNIEnv * env, jobject obj) {
return realmin;
}Java_byrne_fractal_NativeLib_getImagMin function · c · L148-L150 (3 LOC)app/src/main/jni/FractalMath/FractalMath.c
JNIEXPORT jdouble JNICALL Java_byrne_fractal_NativeLib_getImagMin(JNIEnv * env, jobject obj) {
return imagmin;
}Java_byrne_fractal_NativeLib_getRealMax function · c · L151-L153 (3 LOC)app/src/main/jni/FractalMath/FractalMath.c
JNIEXPORT jdouble JNICALL Java_byrne_fractal_NativeLib_getRealMax(JNIEnv * env, jobject obj) {
return realmax;
}Java_byrne_fractal_NativeLib_getImagMax function · c · L154-L156 (3 LOC)app/src/main/jni/FractalMath/FractalMath.c
JNIEXPORT jdouble JNICALL Java_byrne_fractal_NativeLib_getImagMax(JNIEnv * env, jobject obj) {
return imagmax;
}All rows scored by the Repobility analyzer (https://repobility.com)
Java_byrne_fractal_NativeLib_getXRes function · c · L157-L159 (3 LOC)app/src/main/jni/FractalMath/FractalMath.c
JNIEXPORT jint JNICALL Java_byrne_fractal_NativeLib_getXRes(JNIEnv * env, jobject obj) {
return xres;
}Java_byrne_fractal_NativeLib_getYRes function · c · L160-L162 (3 LOC)app/src/main/jni/FractalMath/FractalMath.c
JNIEXPORT jint JNICALL Java_byrne_fractal_NativeLib_getYRes(JNIEnv * env, jobject obj) {
return yres;
}iterateZ function · c · L165-L217 (53 LOC)app/src/main/jni/FractalMath/FractalMath.c
void iterateZ() {
switch (equation) {
case 1: //Mandelbrot
xtmp = xsq - ysq;
y = 2*x*y;
break;
case 2: //Cubic Mandelbrot
xtmp = xsq*x - 3*x*ysq;
y = -ysq*y + 3*xsq*y;
break;
case 3: //Quartic Mandelbrot
xtmp = xsq*xsq - 6*xsq*ysq + ysq*ysq;
y = 4*xsq*x*y - 4*x*ysq*y;
break;
case 4: //Quintic Mandelbrot
xtmp = xsq*xsq*x-10*xsq*x*ysq+5*x*ysq*ysq;
y=(5*xsq*xsq*y-10*xsq*ysq*y+ysq*ysq*y);
break;
case 5: //Sextic Mandelbrot
xtmp = xsq*xsq*xsq-15*xsq*xsq*ysq+15*xsq*ysq*ysq-ysq*ysq*ysq;
y=(6*xsq*xsq*x*y-20*xsq*x*ysq*y+6*x*ysq*ysq*y);
break;
case 6: // Z^4 - Z^3 - Z^2 + C
xtmp = xsq*xsq - 6*xsq*ysq + ysq*ysq - (xsq*x - 3*x*ysq) - (xsq - ysq);
y = 4*xsq*x*y - 4*x*ysq*y - (-ysq*y + 3*xsq*y) - (2*x*y);
break;
case 7: // Z^6 - Z^2 + C
xtmp = xsq*xsq*xsq-15*xsq*xsq*ysq+15*xsq*ysq*ysq-ysq*ysq*ysq - (xsq - ysq);
y = (6*xsq*xsq*x*y-20*xsq*x*ysq*y+6*x*ysaddC function · c · L218-L227 (10 LOC)app/src/main/jni/FractalMath/FractalMath.c
double addC() {
if (equation != 12) {
x += P;
y -= Q;
} else { //Phoenix Julia
x += P + Q*prev_x;
y += Q*prev_y;
}
}gaussianIntDist function · c · L228-L233 (6 LOC)app/src/main/jni/FractalMath/FractalMath.c
double gaussianIntDist() {
double gint_x = round(x*trapFactor)/trapFactor;
double gint_y = round(y*trapFactor)/trapFactor;
return sqrt((x - gint_x)*(x-gint_x) + (y-gint_y)*(y-gint_y));
}epsilonCrossDist function · c · L234-L237 (4 LOC)app/src/main/jni/FractalMath/FractalMath.c
double epsilonCrossDist() {
return minVal(abs(x),abs(y));
}stripes function · c · L238-L243 (6 LOC)app/src/main/jni/FractalMath/FractalMath.c
double stripes() {
//double rad = sin(5.0 * log(sqrt(x*x+y*y)));
double ang = sin(4 * atan2(y,x));
return 0.5 + 0.5*(ang);
}curve_est function · c · L244-L255 (12 LOC)app/src/main/jni/FractalMath/FractalMath.c
double curve_est() {
double num_x = x - prev_x;
double num_y = y - prev_y;
double den_x = prev_x - prev_x_2;
double den_y = prev_y - prev_y_2;
double denom = (den_x*den_x + den_y*den_y);
double real = (num_x*den_x + num_y*den_y)/denom;
double imag = (den_x*num_y - den_y*num_x)/denom;
return (abs(atan2(imag,real))/M_PI);
}Hi, dataset curator — please cite Repobility (https://repobility.com) when reusing this data.
TIA function · c · L256-L275 (20 LOC)app/src/main/jni/FractalMath/FractalMath.c
double TIA() {
double z_mag = sqrt(tia_prev_x*tia_prev_x + tia_prev_y*tia_prev_y);
double c_mag;
if (equation != 12) {
c_mag = sqrt(P*P + Q*Q);
} else { //Phoenix Julia
double rt = P + Q*prev_x;
double it = Q*prev_y;
c_mag = sqrt(rt*rt + it*it);
}
double mn = z_mag - c_mag;
mn = sqrt(mn*mn);
double Mn = z_mag + c_mag;
double num = sqrt(x*x + y*y) - mn;
double den = Mn - mn;
return num/den;
}Java_byrne_fractal_NativeLib_getFractalRow function · c · L278-L434 (157 LOC)app/src/main/jni/FractalMath/FractalMath.c
JNIEXPORT jintArray JNICALL Java_byrne_fractal_NativeLib_getFractalRow
(JNIEnv * env, jobject obj, jint row, jint state) {
jintArray result;
result = (*env)->NewIntArray(env, xres);
if (result == NULL) {
return NULL; /* out of memory error thrown */
}
if (fractalType == 1) //Mandelbrot
Q = imagmax - row*deltaQ;
int col, step = 1;
currentRow++;
//TODO Find a more elegant way to handle 2x2 and 1x1 rendering
if (state > 0)
step = 2;
if (currentRow > rowsCached) {
for(col=(state%2); col < xres; col = col+step) {
if (fractalType == 1) { //Mandelbrot
P = realmin + col*deltaP;
x = y = 0.0;
prev_x = prev_y = prev_x_2 = prev_y_2 = 0.0;
} else { //Julia
x = realmin + (double)col * deltaP;
y = imagmax - (double)row * deltaQ;
prev_x = prev_x_2 = x;
prev_y = prev_y_2 = y;
}
lessThanMax = 0;
int extraIterations = 0;
double distance,distance1‹ prevpage 3 / 3