Subversion Repositories filter_foundry

Rev

Rev 194 | Rev 206 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 194 Rev 201
Line 260... Line 260...
260
   from an arbitrary center */
260
   from an arbitrary center */
261
value_type ff_r2y(value_type d,value_type m){
261
value_type ff_r2y(value_type d,value_type m){
262
        return (value_type)RINT(m*costab[abs(d-256) % COSTABSIZE]);
262
        return (value_type)RINT(m*costab[abs(d-256) % COSTABSIZE]);
263
}
263
}
264
 
264
 
-
 
265
/* Attention! This is NOT a function. It is internally used to calculate the variable "d". */
-
 
266
value_type ff_c2d_negated(value_type x, value_type y) {
-
 
267
        // NOTE: FilterFactory uses c2d(x,y):=atan2(y,x), but d:=atan2(-y,-x)
-
 
268
        // Due to compatibility reasons, we implement it the same way!
-
 
269
        // Sign of y difference is negated, as we are dealing with top-down coordinates angle is "observed"
-
 
270
        return (value_type)RINT(TO_FFANGLE(atan2(-y,-x)));
-
 
271
}
-
 
272
 
265
/* c2d(x,y) Angle displacement of the pixel at coordinates x,y */
273
/* c2d(x,y) Angle displacement of the pixel at coordinates x,y */
266
/* note, sign of y difference is negated, as we are dealing with top-down coordinates
-
 
267
   angle is "observed" */
-
 
268
value_type ff_c2d(value_type x,value_type y){
274
value_type ff_c2d(value_type x,value_type y){
269
        // Behavior of FilterFoundry <1.7:
275
        // Behavior of FilterFoundry <1.7:
270
        //return RINT(TO_FFANGLE(atan2(-y,-x)));
276
        //return ff_c2d_negated(x,y);
271
 
277
 
272
        // Behavior in FilterFoundry 1.7+: Matches FilterFactory
278
        // Behavior in FilterFoundry 1.7+: Matches FilterFactory
273
        return (value_type)RINT(TO_FFANGLE(atan2(y,x)));
279
        return (value_type)RINT(TO_FFANGLE(atan2(y,x)));
274
}
280
}
275
 
281