Lines Matching refs:kernel

119 static inline KernelInfo *LastKernelInfo(KernelInfo *kernel)  in LastKernelInfo()  argument
121 while (kernel->next != (KernelInfo *) NULL) in LastKernelInfo()
122 kernel=kernel->next; in LastKernelInfo()
123 return(kernel); in LastKernelInfo()
217 *kernel; in ParseKernelArray() local
238 kernel=(KernelInfo *) AcquireQuantumMemory(1,sizeof(*kernel)); in ParseKernelArray()
239 if (kernel == (KernelInfo *) NULL) in ParseKernelArray()
240 return(kernel); in ParseKernelArray()
241 (void) ResetMagickMemory(kernel,0,sizeof(*kernel)); in ParseKernelArray()
242 kernel->minimum = kernel->maximum = kernel->angle = 0.0; in ParseKernelArray()
243 kernel->negative_range = kernel->positive_range = 0.0; in ParseKernelArray()
244 kernel->type = UserDefinedKernel; in ParseKernelArray()
245 kernel->next = (KernelInfo *) NULL; in ParseKernelArray()
246 kernel->signature=MagickCoreSignature; in ParseKernelArray()
248 return(kernel); in ParseKernelArray()
277 kernel->width = (size_t)args.rho; in ParseKernelArray()
278 kernel->height = (size_t)args.sigma; in ParseKernelArray()
282 return(DestroyKernelInfo(kernel)); in ParseKernelArray()
283 kernel->x = ((flags & XValue)!=0) ? (ssize_t)args.xi in ParseKernelArray()
284 : (ssize_t) (kernel->width-1)/2; in ParseKernelArray()
285 kernel->y = ((flags & YValue)!=0) ? (ssize_t)args.psi in ParseKernelArray()
286 : (ssize_t) (kernel->height-1)/2; in ParseKernelArray()
287 if ( kernel->x >= (ssize_t) kernel->width || in ParseKernelArray()
288 kernel->y >= (ssize_t) kernel->height ) in ParseKernelArray()
289 return(DestroyKernelInfo(kernel)); in ParseKernelArray()
306 kernel->width = kernel->height= (size_t) sqrt((double) i+1.0); in ParseKernelArray()
307 kernel->x = kernel->y = (ssize_t) (kernel->width-1)/2; in ParseKernelArray()
314 kernel->values=(MagickRealType *) MagickAssumeAligned(AcquireAlignedMemory( in ParseKernelArray()
315 kernel->width,kernel->height*sizeof(*kernel->values))); in ParseKernelArray()
316 if (kernel->values == (MagickRealType *) NULL) in ParseKernelArray()
317 return(DestroyKernelInfo(kernel)); in ParseKernelArray()
318 kernel->minimum=MagickMaximumValue; in ParseKernelArray()
319 kernel->maximum=(-MagickMaximumValue); in ParseKernelArray()
320 kernel->negative_range = kernel->positive_range = 0.0; in ParseKernelArray()
321 for (i=0; (i < (ssize_t) (kernel->width*kernel->height)) && (p < end); i++) in ParseKernelArray()
328 kernel->values[i] = nan; /* this value is not part of neighbourhood */ in ParseKernelArray()
331 kernel->values[i] = StringToDouble(token,(char **) NULL); in ParseKernelArray()
332 ( kernel->values[i] < 0) in ParseKernelArray()
333 ? ( kernel->negative_range += kernel->values[i] ) in ParseKernelArray()
334 : ( kernel->positive_range += kernel->values[i] ); in ParseKernelArray()
335 Minimize(kernel->minimum, kernel->values[i]); in ParseKernelArray()
336 Maximize(kernel->maximum, kernel->values[i]); in ParseKernelArray()
343 return(DestroyKernelInfo(kernel)); in ParseKernelArray()
347 if ( i < (ssize_t) (kernel->width*kernel->height) ) { in ParseKernelArray()
348 Minimize(kernel->minimum, kernel->values[i]); in ParseKernelArray()
349 Maximize(kernel->maximum, kernel->values[i]); in ParseKernelArray()
350 for ( ; i < (ssize_t) (kernel->width*kernel->height); i++) in ParseKernelArray()
351 kernel->values[i]=0.0; in ParseKernelArray()
355 if ( i < (ssize_t) (kernel->width*kernel->height) ) in ParseKernelArray()
356 return(DestroyKernelInfo(kernel)); in ParseKernelArray()
360 if (kernel->minimum == MagickMaximumValue) in ParseKernelArray()
361 return(DestroyKernelInfo(kernel)); in ParseKernelArray()
364 ExpandRotateKernelInfo(kernel, 45.0); /* cyclic rotate 3x3 kernels */ in ParseKernelArray()
366 ExpandRotateKernelInfo(kernel, 90.0); /* 90 degree rotate of kernel */ in ParseKernelArray()
368 ExpandMirrorKernelInfo(kernel); /* 90 degree mirror rotate */ in ParseKernelArray()
370 return(kernel); in ParseKernelArray()
387 *kernel; in ParseKernelName() local
469 kernel = AcquireKernelBuiltIn((KernelInfoType)type, &args, exception); in ParseKernelName()
470 if ( kernel == (KernelInfo *) NULL ) in ParseKernelName()
471 return(kernel); in ParseKernelName()
474 if ( kernel->next == (KernelInfo *) NULL ) { in ParseKernelName()
476 ExpandRotateKernelInfo(kernel, 45.0); in ParseKernelName()
478 ExpandRotateKernelInfo(kernel, 90.0); in ParseKernelName()
480 ExpandMirrorKernelInfo(kernel); in ParseKernelName()
483 return(kernel); in ParseKernelName()
490 *kernel, in AcquireKernelInfo() local
511 kernel=NULL; in AcquireKernelInfo()
526 if (kernel != (KernelInfo *) NULL) in AcquireKernelInfo()
527 kernel=DestroyKernelInfo(kernel); in AcquireKernelInfo()
532 if (kernel == (KernelInfo *) NULL) in AcquireKernelInfo()
533 kernel=new_kernel; in AcquireKernelInfo()
535 LastKernelInfo(kernel)->next=new_kernel; in AcquireKernelInfo()
546 return(kernel); in AcquireKernelInfo()
955 *kernel; in AcquireKernelBuiltIn() local
968 kernel=(KernelInfo *) NULL; in AcquireKernelBuiltIn()
1017 kernel=(KernelInfo *) AcquireMagickMemory(sizeof(*kernel)); in AcquireKernelBuiltIn()
1018 if (kernel == (KernelInfo *) NULL) in AcquireKernelBuiltIn()
1019 return(kernel); in AcquireKernelBuiltIn()
1020 (void) ResetMagickMemory(kernel,0,sizeof(*kernel)); in AcquireKernelBuiltIn()
1021 kernel->minimum = kernel->maximum = kernel->angle = 0.0; in AcquireKernelBuiltIn()
1022 kernel->negative_range = kernel->positive_range = 0.0; in AcquireKernelBuiltIn()
1023 kernel->type = type; in AcquireKernelBuiltIn()
1024 kernel->next = (KernelInfo *) NULL; in AcquireKernelBuiltIn()
1025 kernel->signature=MagickCoreSignature; in AcquireKernelBuiltIn()
1035 kernel->height = kernel->width = (size_t) 1; in AcquireKernelBuiltIn()
1036 kernel->x = kernel->y = (ssize_t) 0; in AcquireKernelBuiltIn()
1037 kernel->values=(MagickRealType *) MagickAssumeAligned( in AcquireKernelBuiltIn()
1038 AcquireAlignedMemory(1,sizeof(*kernel->values))); in AcquireKernelBuiltIn()
1039 if (kernel->values == (MagickRealType *) NULL) in AcquireKernelBuiltIn()
1040 return(DestroyKernelInfo(kernel)); in AcquireKernelBuiltIn()
1041 kernel->maximum = kernel->values[0] = args->rho; in AcquireKernelBuiltIn()
1054 kernel->width = (size_t)args->rho*2+1; in AcquireKernelBuiltIn()
1056 kernel->width = GetOptimalKernelWidth2D(args->rho,sigma); in AcquireKernelBuiltIn()
1058 kernel->width = GetOptimalKernelWidth2D(args->rho,sigma2); in AcquireKernelBuiltIn()
1059 kernel->height = kernel->width; in AcquireKernelBuiltIn()
1060 kernel->x = kernel->y = (ssize_t) (kernel->width-1)/2; in AcquireKernelBuiltIn()
1061 kernel->values=(MagickRealType *) MagickAssumeAligned( in AcquireKernelBuiltIn()
1062 AcquireAlignedMemory(kernel->width,kernel->height* in AcquireKernelBuiltIn()
1063 sizeof(*kernel->values))); in AcquireKernelBuiltIn()
1064 if (kernel->values == (MagickRealType *) NULL) in AcquireKernelBuiltIn()
1065 return(DestroyKernelInfo(kernel)); in AcquireKernelBuiltIn()
1079 for ( i=0, v=-kernel->y; v <= (ssize_t)kernel->y; v++) in AcquireKernelBuiltIn()
1080 for ( u=-kernel->x; u <= (ssize_t)kernel->x; u++, i++) in AcquireKernelBuiltIn()
1081 kernel->values[i] = exp(-((double)(u*u+v*v))*A)*B; in AcquireKernelBuiltIn()
1084 { (void) ResetMagickMemory(kernel->values,0, (size_t) in AcquireKernelBuiltIn()
1085 kernel->width*kernel->height*sizeof(*kernel->values)); in AcquireKernelBuiltIn()
1086 kernel->values[kernel->x+kernel->y*kernel->width] = 1.0; in AcquireKernelBuiltIn()
1096 for ( i=0, v=-kernel->y; v <= (ssize_t)kernel->y; v++) in AcquireKernelBuiltIn()
1097 for ( u=-kernel->x; u <= (ssize_t)kernel->x; u++, i++) in AcquireKernelBuiltIn()
1098 kernel->values[i] -= exp(-((double)(u*u+v*v))*A)*B; in AcquireKernelBuiltIn()
1101 kernel->values[kernel->x+kernel->y*kernel->width] -= 1.0; in AcquireKernelBuiltIn()
1109 for ( i=0, v=-kernel->y; v <= (ssize_t)kernel->y; v++) in AcquireKernelBuiltIn()
1110 for ( u=-kernel->x; u <= (ssize_t)kernel->x; u++, i++) in AcquireKernelBuiltIn()
1112 kernel->values[i] = (1-R)*exp(-R)*B; in AcquireKernelBuiltIn()
1116 { (void) ResetMagickMemory(kernel->values,0, (size_t) in AcquireKernelBuiltIn()
1117 kernel->width*kernel->height*sizeof(*kernel->values)); in AcquireKernelBuiltIn()
1118 kernel->values[kernel->x+kernel->y*kernel->width] = 1.0; in AcquireKernelBuiltIn()
1135 CalcKernelMetaData(kernel); /* the other kernel meta-data */ in AcquireKernelBuiltIn()
1136 ScaleKernelInfo(kernel, 1.0, CorrelateNormalizeValue); in AcquireKernelBuiltIn()
1146 kernel->width = (size_t)args->rho*2+1; in AcquireKernelBuiltIn()
1148 kernel->width = GetOptimalKernelWidth1D(args->rho,sigma); in AcquireKernelBuiltIn()
1149 kernel->height = 1; in AcquireKernelBuiltIn()
1150 kernel->x = (ssize_t) (kernel->width-1)/2; in AcquireKernelBuiltIn()
1151 kernel->y = 0; in AcquireKernelBuiltIn()
1152 kernel->negative_range = kernel->positive_range = 0.0; in AcquireKernelBuiltIn()
1153 kernel->values=(MagickRealType *) MagickAssumeAligned( in AcquireKernelBuiltIn()
1154 AcquireAlignedMemory(kernel->width,kernel->height* in AcquireKernelBuiltIn()
1155 sizeof(*kernel->values))); in AcquireKernelBuiltIn()
1156 if (kernel->values == (MagickRealType *) NULL) in AcquireKernelBuiltIn()
1157 return(DestroyKernelInfo(kernel)); in AcquireKernelBuiltIn()
1175 v = (ssize_t) (kernel->width*KernelRank-1)/2; /* start/end points to fit range */ in AcquireKernelBuiltIn()
1176 (void) ResetMagickMemory(kernel->values,0, (size_t) in AcquireKernelBuiltIn()
1177 kernel->width*kernel->height*sizeof(*kernel->values)); in AcquireKernelBuiltIn()
1184 kernel->values[(u+v)/KernelRank] += in AcquireKernelBuiltIn()
1189 kernel->values[kernel->x+kernel->y*kernel->width] = 1.0; in AcquireKernelBuiltIn()
1198 for ( i=0, u=-kernel->x; u <= (ssize_t)kernel->x; u++, i++) in AcquireKernelBuiltIn()
1199 kernel->values[i] = exp(-((double)(u*u))*alpha)*beta; in AcquireKernelBuiltIn()
1202 { (void) ResetMagickMemory(kernel->values,0, (size_t) in AcquireKernelBuiltIn()
1203 kernel->width*kernel->height*sizeof(*kernel->values)); in AcquireKernelBuiltIn()
1204 kernel->values[kernel->x+kernel->y*kernel->width] = 1.0; in AcquireKernelBuiltIn()
1221 CalcKernelMetaData(kernel); /* the other kernel meta-data */ in AcquireKernelBuiltIn()
1222 ScaleKernelInfo(kernel, 1.0, CorrelateNormalizeValue); in AcquireKernelBuiltIn()
1225 RotateKernelInfo(kernel, args->xi ); in AcquireKernelBuiltIn()
1234 kernel->width = (GetOptimalKernelWidth1D(args->rho,sigma)-1)/2+1; in AcquireKernelBuiltIn()
1236 kernel->width = (size_t)args->rho; in AcquireKernelBuiltIn()
1237 kernel->x = kernel->y = 0; in AcquireKernelBuiltIn()
1238 kernel->height = 1; in AcquireKernelBuiltIn()
1239 kernel->negative_range = kernel->positive_range = 0.0; in AcquireKernelBuiltIn()
1240 kernel->values=(MagickRealType *) MagickAssumeAligned( in AcquireKernelBuiltIn()
1241 AcquireAlignedMemory(kernel->width,kernel->height* in AcquireKernelBuiltIn()
1242 sizeof(*kernel->values))); in AcquireKernelBuiltIn()
1243 if (kernel->values == (MagickRealType *) NULL) in AcquireKernelBuiltIn()
1244 return(DestroyKernelInfo(kernel)); in AcquireKernelBuiltIn()
1260 v = (ssize_t) kernel->width*KernelRank; /* start/end points */ in AcquireKernelBuiltIn()
1261 (void) ResetMagickMemory(kernel->values,0, (size_t) in AcquireKernelBuiltIn()
1262 kernel->width*sizeof(*kernel->values)); in AcquireKernelBuiltIn()
1267 kernel->values[u/KernelRank] += in AcquireKernelBuiltIn()
1271 for (i=0; i < (ssize_t) kernel->width; i++) in AcquireKernelBuiltIn()
1272 kernel->positive_range += kernel->values[i]; in AcquireKernelBuiltIn()
1276 for ( i=0; i < (ssize_t) kernel->width; i++) in AcquireKernelBuiltIn()
1277 kernel->positive_range += in AcquireKernelBuiltIn()
1278 kernel->values[i] = exp(-((double)(i*i))*A); in AcquireKernelBuiltIn()
1283 { (void) ResetMagickMemory(kernel->values,0, (size_t) in AcquireKernelBuiltIn()
1284 kernel->width*kernel->height*sizeof(*kernel->values)); in AcquireKernelBuiltIn()
1285 kernel->values[kernel->x+kernel->y*kernel->width] = 1.0; in AcquireKernelBuiltIn()
1286 kernel->positive_range = 1.0; in AcquireKernelBuiltIn()
1289 kernel->minimum = 0.0; in AcquireKernelBuiltIn()
1290 kernel->maximum = kernel->values[0]; in AcquireKernelBuiltIn()
1291 kernel->negative_range = 0.0; in AcquireKernelBuiltIn()
1293 ScaleKernelInfo(kernel, 1.0, NormalizeValue); /* Normalize */ in AcquireKernelBuiltIn()
1294 RotateKernelInfo(kernel, args->xi); /* Rotate by angle */ in AcquireKernelBuiltIn()
1303 kernel->width = kernel->height = 3; /* default radius = 1 */ in AcquireKernelBuiltIn()
1305 kernel->width = kernel->height = ((size_t)args->rho)*2+1; in AcquireKernelBuiltIn()
1306 kernel->x = kernel->y = (ssize_t) (kernel->width-1)/2; in AcquireKernelBuiltIn()
1308 order_f = fact(kernel->width-1); in AcquireKernelBuiltIn()
1310 kernel->values=(MagickRealType *) MagickAssumeAligned( in AcquireKernelBuiltIn()
1311 AcquireAlignedMemory(kernel->width,kernel->height* in AcquireKernelBuiltIn()
1312 sizeof(*kernel->values))); in AcquireKernelBuiltIn()
1313 if (kernel->values == (MagickRealType *) NULL) in AcquireKernelBuiltIn()
1314 return(DestroyKernelInfo(kernel)); in AcquireKernelBuiltIn()
1317 for ( i=0, v=0; v < (ssize_t)kernel->height; v++) in AcquireKernelBuiltIn()
1319 alpha = order_f / ( fact((size_t) v) * fact(kernel->height-v-1) ); in AcquireKernelBuiltIn()
1320 for ( u=0; u < (ssize_t)kernel->width; u++, i++) in AcquireKernelBuiltIn()
1321 kernel->positive_range += kernel->values[i] = (double) in AcquireKernelBuiltIn()
1322 (alpha * order_f / ( fact((size_t) u) * fact(kernel->height-u-1) )); in AcquireKernelBuiltIn()
1324 kernel->minimum = 1.0; in AcquireKernelBuiltIn()
1325 kernel->maximum = kernel->values[kernel->x+kernel->y*kernel->width]; in AcquireKernelBuiltIn()
1326 kernel->negative_range = 0.0; in AcquireKernelBuiltIn()
1337 kernel=ParseKernelArray("3: -1,-1,-1 -1,8,-1 -1,-1,-1"); in AcquireKernelBuiltIn()
1340 kernel=ParseKernelArray("3: 0,-1,0 -1,4,-1 0,-1,0"); in AcquireKernelBuiltIn()
1343 kernel=ParseKernelArray("3: -2,1,-2 1,4,1 -2,1,-2"); in AcquireKernelBuiltIn()
1346 kernel=ParseKernelArray("3: 1,-2,1 -2,4,-2 1,-2,1"); in AcquireKernelBuiltIn()
1349 kernel=ParseKernelArray( in AcquireKernelBuiltIn()
1353 kernel=ParseKernelArray( in AcquireKernelBuiltIn()
1357 kernel=ParseKernelArray( in AcquireKernelBuiltIn()
1362 kernel=ParseKernelArray( in AcquireKernelBuiltIn()
1366 if (kernel == (KernelInfo *) NULL) in AcquireKernelBuiltIn()
1367 return(kernel); in AcquireKernelBuiltIn()
1368 kernel->type = type; in AcquireKernelBuiltIn()
1373 kernel=ParseKernelArray("3: 1,0,-1 2,0,-2 1,0,-1"); in AcquireKernelBuiltIn()
1374 if (kernel == (KernelInfo *) NULL) in AcquireKernelBuiltIn()
1375 return(kernel); in AcquireKernelBuiltIn()
1376 kernel->type = type; in AcquireKernelBuiltIn()
1377 RotateKernelInfo(kernel, args->rho); in AcquireKernelBuiltIn()
1382 kernel=ParseKernelArray("3: 0,0,0 1,-1,0 0,0,0"); in AcquireKernelBuiltIn()
1383 if (kernel == (KernelInfo *) NULL) in AcquireKernelBuiltIn()
1384 return(kernel); in AcquireKernelBuiltIn()
1385 kernel->type = type; in AcquireKernelBuiltIn()
1386 RotateKernelInfo(kernel, args->rho); in AcquireKernelBuiltIn()
1391 kernel=ParseKernelArray("3: 1,0,-1 1,0,-1 1,0,-1"); in AcquireKernelBuiltIn()
1392 if (kernel == (KernelInfo *) NULL) in AcquireKernelBuiltIn()
1393 return(kernel); in AcquireKernelBuiltIn()
1394 kernel->type = type; in AcquireKernelBuiltIn()
1395 RotateKernelInfo(kernel, args->rho); in AcquireKernelBuiltIn()
1400 kernel=ParseKernelArray("3: 1,1,-1 1,-2,-1 1,1,-1"); in AcquireKernelBuiltIn()
1401 if (kernel == (KernelInfo *) NULL) in AcquireKernelBuiltIn()
1402 return(kernel); in AcquireKernelBuiltIn()
1403 kernel->type = type; in AcquireKernelBuiltIn()
1404 RotateKernelInfo(kernel, args->rho); in AcquireKernelBuiltIn()
1409 kernel=ParseKernelArray("3: 5,-3,-3 5,0,-3 5,-3,-3"); in AcquireKernelBuiltIn()
1410 if (kernel == (KernelInfo *) NULL) in AcquireKernelBuiltIn()
1411 return(kernel); in AcquireKernelBuiltIn()
1412 kernel->type = type; in AcquireKernelBuiltIn()
1413 RotateKernelInfo(kernel, args->rho); in AcquireKernelBuiltIn()
1423 kernel=ParseKernelArray("3: 1,0,-1 2,0,-2 1,0,-1"); in AcquireKernelBuiltIn()
1424 if (kernel == (KernelInfo *) NULL) in AcquireKernelBuiltIn()
1425 return(kernel); in AcquireKernelBuiltIn()
1426 kernel->type = type; in AcquireKernelBuiltIn()
1427 kernel->values[3] = +(MagickRealType) MagickSQ2; in AcquireKernelBuiltIn()
1428 kernel->values[5] = -(MagickRealType) MagickSQ2; in AcquireKernelBuiltIn()
1429 CalcKernelMetaData(kernel); /* recalculate meta-data */ in AcquireKernelBuiltIn()
1432 kernel=ParseKernelArray("3: 1,2,0 2,0,-2 0,-2,-1"); in AcquireKernelBuiltIn()
1433 if (kernel == (KernelInfo *) NULL) in AcquireKernelBuiltIn()
1434 return(kernel); in AcquireKernelBuiltIn()
1435 kernel->type = type; in AcquireKernelBuiltIn()
1436 kernel->values[1] = kernel->values[3]= +(MagickRealType) MagickSQ2; in AcquireKernelBuiltIn()
1437 kernel->values[5] = kernel->values[7]= -(MagickRealType) MagickSQ2; in AcquireKernelBuiltIn()
1438 CalcKernelMetaData(kernel); /* recalculate meta-data */ in AcquireKernelBuiltIn()
1439 ScaleKernelInfo(kernel, (double) (1.0/2.0*MagickSQ2), NoValue); in AcquireKernelBuiltIn()
1443kernel=AcquireKernelInfo("FreiChen:11;FreiChen:12;FreiChen:13;FreiChen:14;FreiChen:15;FreiChen:16;… in AcquireKernelBuiltIn()
1444 if (kernel == (KernelInfo *) NULL) in AcquireKernelBuiltIn()
1445 return(kernel); in AcquireKernelBuiltIn()
1450 kernel=ParseKernelArray("3: 1,0,-1 2,0,-2 1,0,-1"); in AcquireKernelBuiltIn()
1451 if (kernel == (KernelInfo *) NULL) in AcquireKernelBuiltIn()
1452 return(kernel); in AcquireKernelBuiltIn()
1453 kernel->type = type; in AcquireKernelBuiltIn()
1454 kernel->values[3] = +(MagickRealType) MagickSQ2; in AcquireKernelBuiltIn()
1455 kernel->values[5] = -(MagickRealType) MagickSQ2; in AcquireKernelBuiltIn()
1456 CalcKernelMetaData(kernel); /* recalculate meta-data */ in AcquireKernelBuiltIn()
1457 ScaleKernelInfo(kernel, (double) (1.0/2.0*MagickSQ2), NoValue); in AcquireKernelBuiltIn()
1460 kernel=ParseKernelArray("3: 1,2,1 0,0,0 1,2,1"); in AcquireKernelBuiltIn()
1461 if (kernel == (KernelInfo *) NULL) in AcquireKernelBuiltIn()
1462 return(kernel); in AcquireKernelBuiltIn()
1463 kernel->type = type; in AcquireKernelBuiltIn()
1464 kernel->values[1] = +(MagickRealType) MagickSQ2; in AcquireKernelBuiltIn()
1465 kernel->values[7] = +(MagickRealType) MagickSQ2; in AcquireKernelBuiltIn()
1466 CalcKernelMetaData(kernel); in AcquireKernelBuiltIn()
1467 ScaleKernelInfo(kernel, (double) (1.0/2.0*MagickSQ2), NoValue); in AcquireKernelBuiltIn()
1470 kernel=ParseKernelArray("3: 2,-1,0 -1,0,1 0,1,-2"); in AcquireKernelBuiltIn()
1471 if (kernel == (KernelInfo *) NULL) in AcquireKernelBuiltIn()
1472 return(kernel); in AcquireKernelBuiltIn()
1473 kernel->type = type; in AcquireKernelBuiltIn()
1474 kernel->values[0] = +(MagickRealType) MagickSQ2; in AcquireKernelBuiltIn()
1475 kernel->values[8] = -(MagickRealType) MagickSQ2; in AcquireKernelBuiltIn()
1476 CalcKernelMetaData(kernel); in AcquireKernelBuiltIn()
1477 ScaleKernelInfo(kernel, (double) (1.0/2.0*MagickSQ2), NoValue); in AcquireKernelBuiltIn()
1480 kernel=ParseKernelArray("3: 0,1,-2 -1,0,1 2,-1,0"); in AcquireKernelBuiltIn()
1481 if (kernel == (KernelInfo *) NULL) in AcquireKernelBuiltIn()
1482 return(kernel); in AcquireKernelBuiltIn()
1483 kernel->type = type; in AcquireKernelBuiltIn()
1484 kernel->values[2] = -(MagickRealType) MagickSQ2; in AcquireKernelBuiltIn()
1485 kernel->values[6] = +(MagickRealType) MagickSQ2; in AcquireKernelBuiltIn()
1486 CalcKernelMetaData(kernel); in AcquireKernelBuiltIn()
1487 ScaleKernelInfo(kernel, (double) (1.0/2.0*MagickSQ2), NoValue); in AcquireKernelBuiltIn()
1490 kernel=ParseKernelArray("3: 0,-1,0 1,0,1 0,-1,0"); in AcquireKernelBuiltIn()
1491 if (kernel == (KernelInfo *) NULL) in AcquireKernelBuiltIn()
1492 return(kernel); in AcquireKernelBuiltIn()
1493 kernel->type = type; in AcquireKernelBuiltIn()
1494 ScaleKernelInfo(kernel, 1.0/2.0, NoValue); in AcquireKernelBuiltIn()
1497 kernel=ParseKernelArray("3: 1,0,-1 0,0,0 -1,0,1"); in AcquireKernelBuiltIn()
1498 if (kernel == (KernelInfo *) NULL) in AcquireKernelBuiltIn()
1499 return(kernel); in AcquireKernelBuiltIn()
1500 kernel->type = type; in AcquireKernelBuiltIn()
1501 ScaleKernelInfo(kernel, 1.0/2.0, NoValue); in AcquireKernelBuiltIn()
1504 kernel=ParseKernelArray("3: 1,-2,1 -2,4,-2 -1,-2,1"); in AcquireKernelBuiltIn()
1505 if (kernel == (KernelInfo *) NULL) in AcquireKernelBuiltIn()
1506 return(kernel); in AcquireKernelBuiltIn()
1507 kernel->type = type; in AcquireKernelBuiltIn()
1508 ScaleKernelInfo(kernel, 1.0/6.0, NoValue); in AcquireKernelBuiltIn()
1511 kernel=ParseKernelArray("3: -2,1,-2 1,4,1 -2,1,-2"); in AcquireKernelBuiltIn()
1512 if (kernel == (KernelInfo *) NULL) in AcquireKernelBuiltIn()
1513 return(kernel); in AcquireKernelBuiltIn()
1514 kernel->type = type; in AcquireKernelBuiltIn()
1515 ScaleKernelInfo(kernel, 1.0/6.0, NoValue); in AcquireKernelBuiltIn()
1518 kernel=ParseKernelArray("3: 1,1,1 1,1,1 1,1,1"); in AcquireKernelBuiltIn()
1519 if (kernel == (KernelInfo *) NULL) in AcquireKernelBuiltIn()
1520 return(kernel); in AcquireKernelBuiltIn()
1521 kernel->type = type; in AcquireKernelBuiltIn()
1522 ScaleKernelInfo(kernel, 1.0/3.0, NoValue); in AcquireKernelBuiltIn()
1527 RotateKernelInfo(kernel, args->sigma); in AcquireKernelBuiltIn()
1530 RotateKernelInfo(kernel, args->rho); in AcquireKernelBuiltIn()
1540 kernel->width = kernel->height = 3; /* default radius = 1 */ in AcquireKernelBuiltIn()
1542 kernel->width = kernel->height = ((size_t)args->rho)*2+1; in AcquireKernelBuiltIn()
1543 kernel->x = kernel->y = (ssize_t) (kernel->width-1)/2; in AcquireKernelBuiltIn()
1545 kernel->values=(MagickRealType *) MagickAssumeAligned( in AcquireKernelBuiltIn()
1546 AcquireAlignedMemory(kernel->width,kernel->height* in AcquireKernelBuiltIn()
1547 sizeof(*kernel->values))); in AcquireKernelBuiltIn()
1548 if (kernel->values == (MagickRealType *) NULL) in AcquireKernelBuiltIn()
1549 return(DestroyKernelInfo(kernel)); in AcquireKernelBuiltIn()
1552 for ( i=0, v=-kernel->y; v <= (ssize_t)kernel->y; v++) in AcquireKernelBuiltIn()
1553 for ( u=-kernel->x; u <= (ssize_t)kernel->x; u++, i++) in AcquireKernelBuiltIn()
1554 if ( (labs((long) u)+labs((long) v)) <= (long) kernel->x) in AcquireKernelBuiltIn()
1555 kernel->positive_range += kernel->values[i] = args->sigma; in AcquireKernelBuiltIn()
1557 kernel->values[i] = nan; in AcquireKernelBuiltIn()
1558 kernel->minimum = kernel->maximum = args->sigma; /* a flat shape */ in AcquireKernelBuiltIn()
1568 kernel->width = kernel->height = 3; /* default radius = 1 */ in AcquireKernelBuiltIn()
1570 kernel->width = kernel->height = (size_t) (2*args->rho+1); in AcquireKernelBuiltIn()
1571 kernel->x = kernel->y = (ssize_t) (kernel->width-1)/2; in AcquireKernelBuiltIn()
1577 return(DestroyKernelInfo(kernel)); /* invalid args given */ in AcquireKernelBuiltIn()
1578 kernel->width = (size_t)args->rho; in AcquireKernelBuiltIn()
1579 kernel->height = (size_t)args->sigma; in AcquireKernelBuiltIn()
1580 if ( args->xi < 0.0 || args->xi > (double)kernel->width || in AcquireKernelBuiltIn()
1581 args->psi < 0.0 || args->psi > (double)kernel->height ) in AcquireKernelBuiltIn()
1582 return(DestroyKernelInfo(kernel)); /* invalid args given */ in AcquireKernelBuiltIn()
1583 kernel->x = (ssize_t) args->xi; in AcquireKernelBuiltIn()
1584 kernel->y = (ssize_t) args->psi; in AcquireKernelBuiltIn()
1587 kernel->values=(MagickRealType *) MagickAssumeAligned( in AcquireKernelBuiltIn()
1588 AcquireAlignedMemory(kernel->width,kernel->height* in AcquireKernelBuiltIn()
1589 sizeof(*kernel->values))); in AcquireKernelBuiltIn()
1590 if (kernel->values == (MagickRealType *) NULL) in AcquireKernelBuiltIn()
1591 return(DestroyKernelInfo(kernel)); in AcquireKernelBuiltIn()
1594 u=(ssize_t) (kernel->width*kernel->height); in AcquireKernelBuiltIn()
1596 kernel->values[i] = scale; in AcquireKernelBuiltIn()
1597 kernel->minimum = kernel->maximum = scale; /* a flat shape */ in AcquireKernelBuiltIn()
1598 kernel->positive_range = scale*u; in AcquireKernelBuiltIn()
1604 kernel->width = kernel->height = 5; /* default radius = 2 */ in AcquireKernelBuiltIn()
1606 kernel->width = kernel->height = ((size_t)args->rho)*2+1; in AcquireKernelBuiltIn()
1607 kernel->x = kernel->y = (ssize_t) (kernel->width-1)/2; in AcquireKernelBuiltIn()
1609 kernel->values=(MagickRealType *) MagickAssumeAligned( in AcquireKernelBuiltIn()
1610 AcquireAlignedMemory(kernel->width,kernel->height* in AcquireKernelBuiltIn()
1611 sizeof(*kernel->values))); in AcquireKernelBuiltIn()
1612 if (kernel->values == (MagickRealType *) NULL) in AcquireKernelBuiltIn()
1613 return(DestroyKernelInfo(kernel)); in AcquireKernelBuiltIn()
1615 for ( i=0, v=-kernel->y; v <= (ssize_t)kernel->y; v++) in AcquireKernelBuiltIn()
1616 for ( u=-kernel->x; u <= (ssize_t)kernel->x; u++, i++) in AcquireKernelBuiltIn()
1618 ((long)kernel->x + (long)(kernel->x/2)) ) in AcquireKernelBuiltIn()
1619 kernel->positive_range += kernel->values[i] = args->sigma; in AcquireKernelBuiltIn()
1621 kernel->values[i] = nan; in AcquireKernelBuiltIn()
1622 kernel->minimum = kernel->maximum = args->sigma; /* a flat shape */ in AcquireKernelBuiltIn()
1631 kernel->width = kernel->height = 9L, limit = 18L; in AcquireKernelBuiltIn()
1633 kernel->width = kernel->height = (size_t)fabs(args->rho)*2+1; in AcquireKernelBuiltIn()
1634 kernel->x = kernel->y = (ssize_t) (kernel->width-1)/2; in AcquireKernelBuiltIn()
1636 kernel->values=(MagickRealType *) MagickAssumeAligned( in AcquireKernelBuiltIn()
1637 AcquireAlignedMemory(kernel->width,kernel->height* in AcquireKernelBuiltIn()
1638 sizeof(*kernel->values))); in AcquireKernelBuiltIn()
1639 if (kernel->values == (MagickRealType *) NULL) in AcquireKernelBuiltIn()
1640 return(DestroyKernelInfo(kernel)); in AcquireKernelBuiltIn()
1642 for ( i=0, v=-kernel->y; v <= (ssize_t)kernel->y; v++) in AcquireKernelBuiltIn()
1643 for ( u=-kernel->x; u <= (ssize_t)kernel->x; u++, i++) in AcquireKernelBuiltIn()
1645 kernel->positive_range += kernel->values[i] = args->sigma; in AcquireKernelBuiltIn()
1647 kernel->values[i] = nan; in AcquireKernelBuiltIn()
1648 kernel->minimum = kernel->maximum = args->sigma; /* a flat shape */ in AcquireKernelBuiltIn()
1654 kernel->width = kernel->height = 5; /* default radius 2 */ in AcquireKernelBuiltIn()
1656 kernel->width = kernel->height = ((size_t)args->rho)*2+1; in AcquireKernelBuiltIn()
1657 kernel->x = kernel->y = (ssize_t) (kernel->width-1)/2; in AcquireKernelBuiltIn()
1659 kernel->values=(MagickRealType *) MagickAssumeAligned( in AcquireKernelBuiltIn()
1660 AcquireAlignedMemory(kernel->width,kernel->height* in AcquireKernelBuiltIn()
1661 sizeof(*kernel->values))); in AcquireKernelBuiltIn()
1662 if (kernel->values == (MagickRealType *) NULL) in AcquireKernelBuiltIn()
1663 return(DestroyKernelInfo(kernel)); in AcquireKernelBuiltIn()
1666 for ( i=0, v=-kernel->y; v <= (ssize_t)kernel->y; v++) in AcquireKernelBuiltIn()
1667 for ( u=-kernel->x; u <= (ssize_t)kernel->x; u++, i++) in AcquireKernelBuiltIn()
1668 kernel->values[i] = (u == 0 || v == 0) ? args->sigma : nan; in AcquireKernelBuiltIn()
1669 kernel->minimum = kernel->maximum = args->sigma; /* a flat shape */ in AcquireKernelBuiltIn()
1670 kernel->positive_range = args->sigma*(kernel->width*2.0 - 1.0); in AcquireKernelBuiltIn()
1676 kernel->width = kernel->height = 5; /* default radius 2 */ in AcquireKernelBuiltIn()
1678 kernel->width = kernel->height = ((size_t)args->rho)*2+1; in AcquireKernelBuiltIn()
1679 kernel->x = kernel->y = (ssize_t) (kernel->width-1)/2; in AcquireKernelBuiltIn()
1681 kernel->values=(MagickRealType *) MagickAssumeAligned( in AcquireKernelBuiltIn()
1682 AcquireAlignedMemory(kernel->width,kernel->height* in AcquireKernelBuiltIn()
1683 sizeof(*kernel->values))); in AcquireKernelBuiltIn()
1684 if (kernel->values == (MagickRealType *) NULL) in AcquireKernelBuiltIn()
1685 return(DestroyKernelInfo(kernel)); in AcquireKernelBuiltIn()
1688 for ( i=0, v=-kernel->y; v <= (ssize_t)kernel->y; v++) in AcquireKernelBuiltIn()
1689 for ( u=-kernel->x; u <= (ssize_t)kernel->x; u++, i++) in AcquireKernelBuiltIn()
1690 kernel->values[i] = (u == v || u == -v) ? args->sigma : nan; in AcquireKernelBuiltIn()
1691 kernel->minimum = kernel->maximum = args->sigma; /* a flat shape */ in AcquireKernelBuiltIn()
1692 kernel->positive_range = args->sigma*(kernel->width*2.0 - 1.0); in AcquireKernelBuiltIn()
1708 kernel->width = ((size_t)args->sigma)*2+1; in AcquireKernelBuiltIn()
1714 kernel->width = ((size_t)args->rho)*2+1; in AcquireKernelBuiltIn()
1719 kernel->width = 7L, limit1 = 7L, limit2 = 11L; in AcquireKernelBuiltIn()
1721 kernel->height = kernel->width; in AcquireKernelBuiltIn()
1722 kernel->x = kernel->y = (ssize_t) (kernel->width-1)/2; in AcquireKernelBuiltIn()
1723 kernel->values=(MagickRealType *) MagickAssumeAligned( in AcquireKernelBuiltIn()
1724 AcquireAlignedMemory(kernel->width,kernel->height* in AcquireKernelBuiltIn()
1725 sizeof(*kernel->values))); in AcquireKernelBuiltIn()
1726 if (kernel->values == (MagickRealType *) NULL) in AcquireKernelBuiltIn()
1727 return(DestroyKernelInfo(kernel)); in AcquireKernelBuiltIn()
1731 for ( i=0, v= -kernel->y; v <= (ssize_t)kernel->y; v++) in AcquireKernelBuiltIn()
1732 for ( u=-kernel->x; u <= (ssize_t)kernel->x; u++, i++) in AcquireKernelBuiltIn()
1735 kernel->positive_range += kernel->values[i] = (double) scale; in AcquireKernelBuiltIn()
1737 kernel->values[i] = nan; in AcquireKernelBuiltIn()
1739 kernel->minimum = kernel->maximum = (double) scale; in AcquireKernelBuiltIn()
1742 kernel->values[kernel->x+kernel->y*kernel->width] = 1.0; in AcquireKernelBuiltIn()
1743 kernel->positive_range = 1.0; in AcquireKernelBuiltIn()
1744 kernel->maximum = 1.0; in AcquireKernelBuiltIn()
1750 kernel=AcquireKernelInfo("ThinSE:482",exception); in AcquireKernelBuiltIn()
1751 if (kernel == (KernelInfo *) NULL) in AcquireKernelBuiltIn()
1752 return(kernel); in AcquireKernelBuiltIn()
1753 kernel->type = type; in AcquireKernelBuiltIn()
1754 ExpandMirrorKernelInfo(kernel); /* mirror expansion of kernels */ in AcquireKernelBuiltIn()
1759 kernel=AcquireKernelInfo("ThinSE:87",exception); in AcquireKernelBuiltIn()
1760 if (kernel == (KernelInfo *) NULL) in AcquireKernelBuiltIn()
1761 return(kernel); in AcquireKernelBuiltIn()
1762 kernel->type = type; in AcquireKernelBuiltIn()
1763 ExpandRotateKernelInfo(kernel, 90.0); /* Expand 90 degree rotations */ in AcquireKernelBuiltIn()
1773 kernel=ParseKernelArray("3: 0,0,0 0,-,1 1,1,-"); in AcquireKernelBuiltIn()
1774 if (kernel == (KernelInfo *) NULL) in AcquireKernelBuiltIn()
1775 return(kernel); in AcquireKernelBuiltIn()
1776 kernel->type = type; in AcquireKernelBuiltIn()
1779 return(DestroyKernelInfo(kernel)); in AcquireKernelBuiltIn()
1781 LastKernelInfo(kernel)->next = new_kernel; in AcquireKernelBuiltIn()
1782 ExpandMirrorKernelInfo(kernel); in AcquireKernelBuiltIn()
1783 return(kernel); in AcquireKernelBuiltIn()
1786 kernel=ParseKernelArray("3: 0,0,0 0,-,1 1,1,-"); in AcquireKernelBuiltIn()
1789 kernel=ParseKernelArray("3: 0,0,1 0,-,1 0,1,-"); in AcquireKernelBuiltIn()
1792 if (kernel == (KernelInfo *) NULL) in AcquireKernelBuiltIn()
1793 return(kernel); in AcquireKernelBuiltIn()
1794 kernel->type = type; in AcquireKernelBuiltIn()
1795 RotateKernelInfo(kernel, args->sigma); in AcquireKernelBuiltIn()
1807 kernel=ParseKernelArray("3: 0,0,- 0,1,1 0,0,-"); in AcquireKernelBuiltIn()
1811 kernel=ParseKernelArray("3: 0,0,0 0,1,0 0,0,1"); in AcquireKernelBuiltIn()
1815 kernel=ParseKernelArray("3: 0,0,0 0,1,1 0,0,0"); in AcquireKernelBuiltIn()
1819 kernel=ParseKernelArray("3: 0,0,0 0,1,- 0,0,-"); in AcquireKernelBuiltIn()
1822 if (kernel == (KernelInfo *) NULL) in AcquireKernelBuiltIn()
1823 return(kernel); in AcquireKernelBuiltIn()
1824 kernel->type = type; in AcquireKernelBuiltIn()
1825 RotateKernelInfo(kernel, args->sigma); in AcquireKernelBuiltIn()
1837 kernel=ParseKernelArray("3: 1,-,1 -,1,- -,1,-"); in AcquireKernelBuiltIn()
1841 kernel=ParseKernelArray("3: 1,-,- -,1,- 1,-,1"); in AcquireKernelBuiltIn()
1845 kernel=ParseKernelArray("3: -,-,- 1,1,1 -,1,-"); in AcquireKernelBuiltIn()
1849 kernel=ParseKernelArray("3: 1,-,1 -,1,- 1,-,1"); in AcquireKernelBuiltIn()
1853 kernel=ParseKernelArray("3: -,1,- 1,1,1 -,1,-"); in AcquireKernelBuiltIn()
1856 if (kernel == (KernelInfo *) NULL) in AcquireKernelBuiltIn()
1857 return(kernel); in AcquireKernelBuiltIn()
1858 kernel->type = type; in AcquireKernelBuiltIn()
1859 RotateKernelInfo(kernel, args->sigma); in AcquireKernelBuiltIn()
1869 kernel=ParseKernelArray("3x1:0,1,0"); in AcquireKernelBuiltIn()
1870 if (kernel == (KernelInfo *) NULL) in AcquireKernelBuiltIn()
1871 return(kernel); in AcquireKernelBuiltIn()
1872 kernel->type = type; in AcquireKernelBuiltIn()
1873 ExpandRotateKernelInfo(kernel, 90.0); /* 2 rotated kernels (symmetrical) */ in AcquireKernelBuiltIn()
1876 kernel=ParseKernelArray("4x1:0,1,1,0"); in AcquireKernelBuiltIn()
1877 if (kernel == (KernelInfo *) NULL) in AcquireKernelBuiltIn()
1878 return(kernel); in AcquireKernelBuiltIn()
1879 kernel->type = type; in AcquireKernelBuiltIn()
1880 ExpandRotateKernelInfo(kernel, 90.0); /* 4 rotated kernels */ in AcquireKernelBuiltIn()
1887 return(DestroyKernelInfo(kernel)); in AcquireKernelBuiltIn()
1889 LastKernelInfo(kernel)->next = new_kernel; in AcquireKernelBuiltIn()
1892 return(DestroyKernelInfo(kernel)); in AcquireKernelBuiltIn()
1894 LastKernelInfo(kernel)->next = new_kernel; in AcquireKernelBuiltIn()
1897 return(DestroyKernelInfo(kernel)); in AcquireKernelBuiltIn()
1899 LastKernelInfo(kernel)->next = new_kernel; in AcquireKernelBuiltIn()
1902 return(DestroyKernelInfo(kernel)); in AcquireKernelBuiltIn()
1904 LastKernelInfo(kernel)->next = new_kernel; in AcquireKernelBuiltIn()
1907 return(DestroyKernelInfo(kernel)); in AcquireKernelBuiltIn()
1909 LastKernelInfo(kernel)->next = new_kernel; in AcquireKernelBuiltIn()
1912 return(DestroyKernelInfo(kernel)); in AcquireKernelBuiltIn()
1914 LastKernelInfo(kernel)->next = new_kernel; in AcquireKernelBuiltIn()
1917 return(DestroyKernelInfo(kernel)); in AcquireKernelBuiltIn()
1919 LastKernelInfo(kernel)->next = new_kernel; in AcquireKernelBuiltIn()
1922 return(DestroyKernelInfo(kernel)); in AcquireKernelBuiltIn()
1924 LastKernelInfo(kernel)->next = new_kernel; in AcquireKernelBuiltIn()
1934 kernel=ParseKernelArray("3: 1,1,- 1,0,- 1,-,0"); in AcquireKernelBuiltIn()
1935 if (kernel == (KernelInfo *) NULL) in AcquireKernelBuiltIn()
1936 return(kernel); in AcquireKernelBuiltIn()
1937 kernel->type = type; in AcquireKernelBuiltIn()
1938 ExpandRotateKernelInfo(kernel, 90.0); in AcquireKernelBuiltIn()
1942 return(DestroyKernelInfo(kernel)); in AcquireKernelBuiltIn()
1945 LastKernelInfo(kernel)->next = new_kernel; in AcquireKernelBuiltIn()
1956 kernel=AcquireKernelInfo("ThinSE:482",exception); in AcquireKernelBuiltIn()
1957 if (kernel == (KernelInfo *) NULL) in AcquireKernelBuiltIn()
1958 return(kernel); in AcquireKernelBuiltIn()
1959 kernel->type = type; in AcquireKernelBuiltIn()
1960 ExpandRotateKernelInfo(kernel, 45.0); /* 8 rotations */ in AcquireKernelBuiltIn()
1967 kernel=AcquireKernelInfo("ThinSE:482; ThinSE:87x90;",exception); in AcquireKernelBuiltIn()
1968 if (kernel == (KernelInfo *) NULL) in AcquireKernelBuiltIn()
1969 return(kernel); in AcquireKernelBuiltIn()
1970 if (kernel->next == (KernelInfo *) NULL) in AcquireKernelBuiltIn()
1971 return(DestroyKernelInfo(kernel)); in AcquireKernelBuiltIn()
1972 kernel->type = type; in AcquireKernelBuiltIn()
1973 kernel->next->type = type; in AcquireKernelBuiltIn()
1974 ExpandRotateKernelInfo(kernel, 90.0); /* 4 rotations of the 2 kernels */ in AcquireKernelBuiltIn()
1982 kernel=AcquireKernelInfo("ThinSE:41; ThinSE:42; ThinSE:43", in AcquireKernelBuiltIn()
1984 if (kernel == (KernelInfo *) NULL) in AcquireKernelBuiltIn()
1985 return(kernel); in AcquireKernelBuiltIn()
1986 kernel->type = type; in AcquireKernelBuiltIn()
1987 kernel->next->type = type; in AcquireKernelBuiltIn()
1988 kernel->next->next->type = type; in AcquireKernelBuiltIn()
1989 ExpandMirrorKernelInfo(kernel); /* 12 kernels total */ in AcquireKernelBuiltIn()
2008 kernel=ParseKernelArray("3: -,-,1 0,-,1 -,-,1"); in AcquireKernelBuiltIn()
2011 kernel=ParseKernelArray("3: -,-,1 0,-,1 -,0,-"); in AcquireKernelBuiltIn()
2014 kernel=ParseKernelArray("3: -,0,- 0,-,1 -,-,1"); in AcquireKernelBuiltIn()
2017 kernel=ParseKernelArray("3: -,0,- 0,-,1 -,0,-"); in AcquireKernelBuiltIn()
2020 kernel=ParseKernelArray("3: -,0,1 0,-,1 -,0,-"); in AcquireKernelBuiltIn()
2023 kernel=ParseKernelArray("3: -,0,- 0,-,1 -,0,1"); in AcquireKernelBuiltIn()
2026 kernel=ParseKernelArray("3: -,1,1 0,-,1 -,0,-"); in AcquireKernelBuiltIn()
2029 kernel=ParseKernelArray("3: -,-,1 0,-,1 0,-,1"); in AcquireKernelBuiltIn()
2032 kernel=ParseKernelArray("3: 0,-,1 0,-,1 -,-,1"); in AcquireKernelBuiltIn()
2036 kernel=ParseKernelArray("3: -,1,- 0,-,1 -,1,-"); in AcquireKernelBuiltIn()
2039 kernel=ParseKernelArray("3: -,1,- 0,-,1 0,-,-"); in AcquireKernelBuiltIn()
2042 kernel=ParseKernelArray("3: 0,-,- 0,-,1 -,1,-"); in AcquireKernelBuiltIn()
2045 kernel=ParseKernelArray("3: 0,-,- 0,-,1 0,-,-"); in AcquireKernelBuiltIn()
2048 kernel=ParseKernelArray("3: 0,-,1 0,-,1 0,-,-"); in AcquireKernelBuiltIn()
2051 kernel=ParseKernelArray("3: 0,-,- 0,-,1 0,-,1"); in AcquireKernelBuiltIn()
2054 kernel=ParseKernelArray("3: -,1,- 0,-,1 0,0,-"); in AcquireKernelBuiltIn()
2057 kernel=ParseKernelArray("3: -,1,- 0,-,1 0,1,-"); in AcquireKernelBuiltIn()
2060 kernel=ParseKernelArray("3: 0,1,- 0,-,1 -,1,-"); in AcquireKernelBuiltIn()
2064 kernel=ParseKernelArray("3: -,-,1 0,-,- -,0,-"); in AcquireKernelBuiltIn()
2067 kernel=ParseKernelArray("3: -,1,- -,-,1 0,-,-"); in AcquireKernelBuiltIn()
2070 kernel=ParseKernelArray("3: -,1,1 0,-,1 0,0,-"); in AcquireKernelBuiltIn()
2074 kernel=ParseKernelArray("3: 0,-,1 0,-,1 0,-,1"); in AcquireKernelBuiltIn()
2077 if (kernel == (KernelInfo *) NULL) in AcquireKernelBuiltIn()
2078 return(kernel); in AcquireKernelBuiltIn()
2079 kernel->type = type; in AcquireKernelBuiltIn()
2080 RotateKernelInfo(kernel, args->sigma); in AcquireKernelBuiltIn()
2089 kernel->width = kernel->height = 3; /* default radius = 1 */ in AcquireKernelBuiltIn()
2091 kernel->width = kernel->height = ((size_t)args->rho)*2+1; in AcquireKernelBuiltIn()
2092 kernel->x = kernel->y = (ssize_t) (kernel->width-1)/2; in AcquireKernelBuiltIn()
2094 kernel->values=(MagickRealType *) MagickAssumeAligned( in AcquireKernelBuiltIn()
2095 AcquireAlignedMemory(kernel->width,kernel->height* in AcquireKernelBuiltIn()
2096 sizeof(*kernel->values))); in AcquireKernelBuiltIn()
2097 if (kernel->values == (MagickRealType *) NULL) in AcquireKernelBuiltIn()
2098 return(DestroyKernelInfo(kernel)); in AcquireKernelBuiltIn()
2100 for ( i=0, v=-kernel->y; v <= (ssize_t)kernel->y; v++) in AcquireKernelBuiltIn()
2101 for ( u=-kernel->x; u <= (ssize_t)kernel->x; u++, i++) in AcquireKernelBuiltIn()
2102 kernel->positive_range += ( kernel->values[i] = in AcquireKernelBuiltIn()
2104 kernel->maximum = kernel->values[0]; in AcquireKernelBuiltIn()
2110 kernel->width = kernel->height = 3; /* default radius = 1 */ in AcquireKernelBuiltIn()
2112 kernel->width = kernel->height = ((size_t)args->rho)*2+1; in AcquireKernelBuiltIn()
2113 kernel->x = kernel->y = (ssize_t) (kernel->width-1)/2; in AcquireKernelBuiltIn()
2115 kernel->values=(MagickRealType *) MagickAssumeAligned( in AcquireKernelBuiltIn()
2116 AcquireAlignedMemory(kernel->width,kernel->height* in AcquireKernelBuiltIn()
2117 sizeof(*kernel->values))); in AcquireKernelBuiltIn()
2118 if (kernel->values == (MagickRealType *) NULL) in AcquireKernelBuiltIn()
2119 return(DestroyKernelInfo(kernel)); in AcquireKernelBuiltIn()
2121 for ( i=0, v=-kernel->y; v <= (ssize_t)kernel->y; v++) in AcquireKernelBuiltIn()
2122 for ( u=-kernel->x; u <= (ssize_t)kernel->x; u++, i++) in AcquireKernelBuiltIn()
2123 kernel->positive_range += ( kernel->values[i] = in AcquireKernelBuiltIn()
2125 kernel->maximum = kernel->values[0]; in AcquireKernelBuiltIn()
2131 kernel->width = kernel->height = 5; /* default/minimum radius = 2 */ in AcquireKernelBuiltIn()
2133 kernel->width = kernel->height = ((size_t)args->rho)*2+1; in AcquireKernelBuiltIn()
2134 kernel->x = kernel->y = (ssize_t) (kernel->width-1)/2; in AcquireKernelBuiltIn()
2136 kernel->values=(MagickRealType *) MagickAssumeAligned( in AcquireKernelBuiltIn()
2137 AcquireAlignedMemory(kernel->width,kernel->height* in AcquireKernelBuiltIn()
2138 sizeof(*kernel->values))); in AcquireKernelBuiltIn()
2139 if (kernel->values == (MagickRealType *) NULL) in AcquireKernelBuiltIn()
2140 return(DestroyKernelInfo(kernel)); in AcquireKernelBuiltIn()
2142 for ( i=0, v=-kernel->y; v <= (ssize_t)kernel->y; v++) in AcquireKernelBuiltIn()
2143 for ( u=-kernel->x; u <= (ssize_t)kernel->x; u++, i++) in AcquireKernelBuiltIn()
2148 kernel->positive_range += kernel->values[i] = in AcquireKernelBuiltIn()
2151 kernel->maximum = kernel->values[0]; in AcquireKernelBuiltIn()
2157 kernel->width = kernel->height = 3; /* default radius = 1 */ in AcquireKernelBuiltIn()
2159 kernel->width = kernel->height = ((size_t)args->rho)*2+1; in AcquireKernelBuiltIn()
2160 kernel->x = kernel->y = (ssize_t) (kernel->width-1)/2; in AcquireKernelBuiltIn()
2162 kernel->values=(MagickRealType *) MagickAssumeAligned( in AcquireKernelBuiltIn()
2163 AcquireAlignedMemory(kernel->width,kernel->height* in AcquireKernelBuiltIn()
2164 sizeof(*kernel->values))); in AcquireKernelBuiltIn()
2165 if (kernel->values == (MagickRealType *) NULL) in AcquireKernelBuiltIn()
2166 return(DestroyKernelInfo(kernel)); in AcquireKernelBuiltIn()
2168 for ( i=0, v=-kernel->y; v <= (ssize_t)kernel->y; v++) in AcquireKernelBuiltIn()
2169 for ( u=-kernel->x; u <= (ssize_t)kernel->x; u++, i++) in AcquireKernelBuiltIn()
2170 kernel->positive_range += ( kernel->values[i] = in AcquireKernelBuiltIn()
2172 kernel->maximum = kernel->values[0]; in AcquireKernelBuiltIn()
2178 kernel=ParseKernelArray("1:1"); in AcquireKernelBuiltIn()
2179 if (kernel == (KernelInfo *) NULL) in AcquireKernelBuiltIn()
2180 return(kernel); in AcquireKernelBuiltIn()
2181 kernel->type = UndefinedKernel; in AcquireKernelBuiltIn()
2186 return(kernel); in AcquireKernelBuiltIn()
2213 MagickExport KernelInfo *CloneKernelInfo(const KernelInfo *kernel) in CloneKernelInfo() argument
2221 assert(kernel != (KernelInfo *) NULL); in CloneKernelInfo()
2222 new_kernel=(KernelInfo *) AcquireMagickMemory(sizeof(*kernel)); in CloneKernelInfo()
2225 *new_kernel=(*kernel); /* copy values in structure */ in CloneKernelInfo()
2229 AcquireAlignedMemory(kernel->width,kernel->height*sizeof(*kernel->values))); in CloneKernelInfo()
2232 for (i=0; i < (ssize_t) (kernel->width*kernel->height); i++) in CloneKernelInfo()
2233 new_kernel->values[i]=kernel->values[i]; in CloneKernelInfo()
2236 if ( kernel->next != (KernelInfo *) NULL ) { in CloneKernelInfo()
2237 new_kernel->next = CloneKernelInfo(kernel->next); in CloneKernelInfo()
2268 MagickExport KernelInfo *DestroyKernelInfo(KernelInfo *kernel) in DestroyKernelInfo() argument
2270 assert(kernel != (KernelInfo *) NULL); in DestroyKernelInfo()
2271 if (kernel->next != (KernelInfo *) NULL) in DestroyKernelInfo()
2272 kernel->next=DestroyKernelInfo(kernel->next); in DestroyKernelInfo()
2273 kernel->values=(MagickRealType *) RelinquishAlignedMemory(kernel->values); in DestroyKernelInfo()
2274 kernel=(KernelInfo *) RelinquishMagickMemory(kernel); in DestroyKernelInfo()
2275 return(kernel); in DestroyKernelInfo()
2310 static void FlopKernelInfo(KernelInfo *kernel)
2319 for ( y=0, k=kernel->values; y < kernel->height; y++, k+=kernel->width)
2320 for ( x=0, r=kernel->width-1; x<kernel->width/2; x++, r--)
2323 kernel->x = kernel->width - kernel->x - 1;
2328 static void ExpandMirrorKernelInfo(KernelInfo *kernel) in ExpandMirrorKernelInfo() argument
2334 last = kernel; in ExpandMirrorKernelInfo()
2414 static void ExpandRotateKernelInfo(KernelInfo *kernel, const double angle) in ExpandRotateKernelInfo() argument
2420 last = kernel; in ExpandRotateKernelInfo()
2426 if ( SameKernelInfo(kernel, clone) != MagickFalse ) in ExpandRotateKernelInfo()
2471 static void CalcKernelMetaData(KernelInfo *kernel) in CalcKernelMetaData() argument
2476 kernel->minimum = kernel->maximum = 0.0; in CalcKernelMetaData()
2477 kernel->negative_range = kernel->positive_range = 0.0; in CalcKernelMetaData()
2478 for (i=0; i < (kernel->width*kernel->height); i++) in CalcKernelMetaData()
2480 if ( fabs(kernel->values[i]) < MagickEpsilon ) in CalcKernelMetaData()
2481 kernel->values[i] = 0.0; in CalcKernelMetaData()
2482 ( kernel->values[i] < 0) in CalcKernelMetaData()
2483 ? ( kernel->negative_range += kernel->values[i] ) in CalcKernelMetaData()
2484 : ( kernel->positive_range += kernel->values[i] ); in CalcKernelMetaData()
2485 Minimize(kernel->minimum, kernel->values[i]); in CalcKernelMetaData()
2486 Maximize(kernel->maximum, kernel->values[i]); in CalcKernelMetaData()
2553 const MorphologyMethod method,const KernelInfo *kernel,const double bias, in MorphologyPrimitive() argument
2584 assert(kernel != (KernelInfo *) NULL); in MorphologyPrimitive()
2585 assert(kernel->signature == MagickCoreSignature); in MorphologyPrimitive()
2592 width=image->columns+kernel->width-1; in MorphologyPrimitive()
2605 offset.x=(ssize_t) kernel->width-kernel->x-1; in MorphologyPrimitive()
2606 offset.y=(ssize_t) kernel->height-kernel->y-1; in MorphologyPrimitive()
2615 offset.x=kernel->x; in MorphologyPrimitive()
2616 offset.y=kernel->y; in MorphologyPrimitive()
2633 if ((method == ConvolveMorphology) && (kernel->width == 1)) in MorphologyPrimitive()
2668 kernel->height-1,exception); in MorphologyPrimitive()
2720 k=(&kernel->values[kernel->height-1]); in MorphologyPrimitive()
2726 for (v=0; v < (ssize_t) kernel->height; v++) in MorphologyPrimitive()
2738 for (v=0; v < (ssize_t) kernel->height; v++) in MorphologyPrimitive()
2754 gamma*=(double) kernel->height/count; in MorphologyPrimitive()
2812 kernel->height,exception); in MorphologyPrimitive()
2874 count=kernel->width*kernel->height; in MorphologyPrimitive()
2916 k=(&kernel->values[kernel->width*kernel->height-1]); in MorphologyPrimitive()
2923 for (v=0; v < (ssize_t) kernel->height; v++) in MorphologyPrimitive()
2925 for (u=0; u < (ssize_t) kernel->width; u++) in MorphologyPrimitive()
2943 for (v=0; v < (ssize_t) kernel->height; v++) in MorphologyPrimitive()
2945 for (u=0; u < (ssize_t) kernel->width; u++) in MorphologyPrimitive()
2971 k=kernel->values; in MorphologyPrimitive()
2972 for (v=0; v < (ssize_t) kernel->height; v++) in MorphologyPrimitive()
2974 for (u=0; u < (ssize_t) kernel->width; u++) in MorphologyPrimitive()
3002 k=(&kernel->values[kernel->width*kernel->height-1]); in MorphologyPrimitive()
3003 for (v=0; v < (ssize_t) kernel->height; v++) in MorphologyPrimitive()
3005 for (u=0; u < (ssize_t) kernel->width; u++) in MorphologyPrimitive()
3036 k=kernel->values; in MorphologyPrimitive()
3037 for (v=0; v < (ssize_t) kernel->height; v++) in MorphologyPrimitive()
3039 for (u=0; u < (ssize_t) kernel->width; u++) in MorphologyPrimitive()
3079 k=kernel->values; in MorphologyPrimitive()
3080 for (v=0; v < (ssize_t) kernel->height; v++) in MorphologyPrimitive()
3082 for (u=0; u < (ssize_t) kernel->width; u++) in MorphologyPrimitive()
3109 k=(&kernel->values[kernel->width*kernel->height-1]); in MorphologyPrimitive()
3110 for (v=0; v < (ssize_t) kernel->height; v++) in MorphologyPrimitive()
3112 for (u=0; u < (ssize_t) kernel->width; u++) in MorphologyPrimitive()
3157 k=(&kernel->values[kernel->width*kernel->height-1]); in MorphologyPrimitive()
3158 for (v=0; v < (ssize_t) kernel->height; v++) in MorphologyPrimitive()
3160 for (u=0; u < (ssize_t) kernel->width; u++) in MorphologyPrimitive()
3183 gamma*=(double) kernel->height*kernel->width/count; in MorphologyPrimitive()
3226 const MorphologyMethod method,const KernelInfo *kernel, in MorphologyPrimitiveDirect() argument
3251 assert(kernel != (KernelInfo *) NULL); in MorphologyPrimitiveDirect()
3252 assert(kernel->signature == MagickCoreSignature); in MorphologyPrimitiveDirect()
3266 offset.x=(ssize_t) kernel->width-kernel->x-1; in MorphologyPrimitiveDirect()
3267 offset.y=(ssize_t) kernel->height-kernel->y-1; in MorphologyPrimitiveDirect()
3272 offset.x=kernel->x; in MorphologyPrimitiveDirect()
3273 offset.y=kernel->y; in MorphologyPrimitiveDirect()
3282 width=image->columns+kernel->width-1; in MorphologyPrimitiveDirect()
3355 k=(&kernel->values[kernel->width*kernel->height-1]); in MorphologyPrimitiveDirect()
3358 for (u=0; u < (ssize_t) kernel->width; u++) in MorphologyPrimitiveDirect()
3370 k=(&kernel->values[kernel->width*(kernel->y+1)-1]); in MorphologyPrimitiveDirect()
3386 k=(&kernel->values[kernel->width*kernel->height-1]); in MorphologyPrimitiveDirect()
3389 for (u=0; u < (ssize_t) kernel->width; u++) in MorphologyPrimitiveDirect()
3401 k=(&kernel->values[kernel->width*(kernel->y+1)-1]); in MorphologyPrimitiveDirect()
3468 kernel->y+1,exception); in MorphologyPrimitiveDirect()
3516 k=(&kernel->values[kernel->width*(kernel->y+1)-1]); in MorphologyPrimitiveDirect()
3517 for (v=offset.y; v < (ssize_t) kernel->height; v++) in MorphologyPrimitiveDirect()
3519 for (u=0; u < (ssize_t) kernel->width; u++) in MorphologyPrimitiveDirect()
3531 k=(&kernel->values[kernel->width*kernel->y+kernel->x-1]); in MorphologyPrimitiveDirect()
3533 for (u=offset.x+1; u < (ssize_t) kernel->width; u++) in MorphologyPrimitiveDirect()
3547 k=(&kernel->values[kernel->width*(kernel->y+1)-1]); in MorphologyPrimitiveDirect()
3548 for (v=offset.y; v < (ssize_t) kernel->height; v++) in MorphologyPrimitiveDirect()
3550 for (u=0; u < (ssize_t) kernel->width; u++) in MorphologyPrimitiveDirect()
3562 k=(&kernel->values[kernel->width*(kernel->y+1)-1]); in MorphologyPrimitiveDirect()
3564 for (u=offset.x+1; u < (ssize_t) kernel->width; u++) in MorphologyPrimitiveDirect()
3614 const KernelInfo *kernel, const CompositeOperator compose,const double bias, in MorphologyApply() argument
3662 assert(kernel != (KernelInfo *) NULL); in MorphologyApply()
3663 assert(kernel->signature == MagickCoreSignature); in MorphologyApply()
3733 changed=MorphologyPrimitiveDirect(rslt_image,method,kernel,exception); in MorphologyApply()
3770 reflected_kernel = CloneKernelInfo(kernel); in MorphologyApply()
3790 norm_kernel = (KernelInfo *) kernel; in MorphologyApply()
3791 this_kernel = (KernelInfo *) kernel; in MorphologyApply()
3990 if ( kernel->next == (KernelInfo *) NULL ) in MorphologyApply()
4109 const KernelInfo *kernel,ExceptionInfo *exception) in MorphologyImage() argument
4126 curr_kernel = (KernelInfo *) kernel; in MorphologyImage()
4154 if ( curr_kernel == kernel ) in MorphologyImage()
4155 curr_kernel = CloneKernelInfo(kernel); in MorphologyImage()
4195 if ( curr_kernel != kernel ) in MorphologyImage()
4230 static void RotateKernelInfo(KernelInfo *kernel, double angle) in RotateKernelInfo() argument
4233 if ( kernel->next != (KernelInfo *) NULL) in RotateKernelInfo()
4234 RotateKernelInfo(kernel->next, angle); in RotateKernelInfo()
4250 switch (kernel->type) { in RotateKernelInfo()
4286 if ( kernel->width == 3 && kernel->height == 3 ) in RotateKernelInfo()
4288 double t = kernel->values[0]; in RotateKernelInfo()
4289 kernel->values[0] = kernel->values[3]; in RotateKernelInfo()
4290 kernel->values[3] = kernel->values[6]; in RotateKernelInfo()
4291 kernel->values[6] = kernel->values[7]; in RotateKernelInfo()
4292 kernel->values[7] = kernel->values[8]; in RotateKernelInfo()
4293 kernel->values[8] = kernel->values[5]; in RotateKernelInfo()
4294 kernel->values[5] = kernel->values[2]; in RotateKernelInfo()
4295 kernel->values[2] = kernel->values[1]; in RotateKernelInfo()
4296 kernel->values[1] = t; in RotateKernelInfo()
4298 if ( kernel->x != 1 || kernel->y != 1 ) { in RotateKernelInfo()
4300 x = (ssize_t) kernel->x-1; in RotateKernelInfo()
4301 y = (ssize_t) kernel->y-1; in RotateKernelInfo()
4306 kernel->x = (ssize_t) x+1; in RotateKernelInfo()
4307 kernel->y = (ssize_t) y+1; in RotateKernelInfo()
4310 kernel->angle = fmod(kernel->angle+45.0, 360.0); in RotateKernelInfo()
4317 if ( kernel->width == 1 || kernel->height == 1 ) in RotateKernelInfo()
4323 t = (ssize_t) kernel->width; in RotateKernelInfo()
4324 kernel->width = kernel->height; in RotateKernelInfo()
4325 kernel->height = (size_t) t; in RotateKernelInfo()
4326 t = kernel->x; in RotateKernelInfo()
4327 kernel->x = kernel->y; in RotateKernelInfo()
4328 kernel->y = t; in RotateKernelInfo()
4329 if ( kernel->width == 1 ) { in RotateKernelInfo()
4331 kernel->angle = fmod(kernel->angle+90.0, 360.0); in RotateKernelInfo()
4334 kernel->angle = fmod(kernel->angle+270.0, 360.0); in RotateKernelInfo()
4337 else if ( kernel->width == kernel->height ) in RotateKernelInfo()
4345 k=kernel->values; in RotateKernelInfo()
4346 for( i=0, x=(ssize_t) kernel->width-1; i<=x; i++, x--) in RotateKernelInfo()
4347 for( j=0, y=(ssize_t) kernel->height-1; j<y; j++, y--) in RotateKernelInfo()
4348 { t = k[i+j*kernel->width]; in RotateKernelInfo()
4349 k[i+j*kernel->width] = k[j+x*kernel->width]; in RotateKernelInfo()
4350 k[j+x*kernel->width] = k[x+y*kernel->width]; in RotateKernelInfo()
4351 k[x+y*kernel->width] = k[y+i*kernel->width]; in RotateKernelInfo()
4352 k[y+i*kernel->width] = t; in RotateKernelInfo()
4357 x = (ssize_t) (kernel->x*2-kernel->width+1); in RotateKernelInfo()
4358 y = (ssize_t) (kernel->y*2-kernel->height+1); in RotateKernelInfo()
4359 kernel->x = (ssize_t) ( -y +(ssize_t) kernel->width-1)/2; in RotateKernelInfo()
4360 kernel->y = (ssize_t) ( +x +(ssize_t) kernel->height-1)/2; in RotateKernelInfo()
4363 kernel->angle = fmod(kernel->angle+90.0, 360.0); in RotateKernelInfo()
4385 k=kernel->values; in RotateKernelInfo()
4386 j=(ssize_t) (kernel->width*kernel->height-1); in RotateKernelInfo()
4390 kernel->x = (ssize_t) kernel->width - kernel->x - 1; in RotateKernelInfo()
4391 kernel->y = (ssize_t) kernel->height - kernel->y - 1; in RotateKernelInfo()
4393 kernel->angle = fmod(kernel->angle+180.0, 360.0); in RotateKernelInfo()
4437 MagickExport void ScaleGeometryKernelInfo (KernelInfo *kernel, in ScaleGeometryKernelInfo() argument
4464 ScaleKernelInfo(kernel, args.rho, (GeometryFlags) flags); in ScaleGeometryKernelInfo()
4468 UnityAddKernelInfo(kernel, args.sigma); in ScaleGeometryKernelInfo()
4543 MagickExport void ScaleKernelInfo(KernelInfo *kernel, in ScaleKernelInfo() argument
4554 if ( kernel->next != (KernelInfo *) NULL) in ScaleKernelInfo()
4555 ScaleKernelInfo(kernel->next, scaling_factor, normalize_flags); in ScaleKernelInfo()
4560 if ( fabs(kernel->positive_range + kernel->negative_range) >= MagickEpsilon ) in ScaleKernelInfo()
4562 pos_scale = fabs(kernel->positive_range + kernel->negative_range); in ScaleKernelInfo()
4565 pos_scale = kernel->positive_range; in ScaleKernelInfo()
4569 pos_scale = ( fabs(kernel->positive_range) >= MagickEpsilon ) in ScaleKernelInfo()
4570 ? kernel->positive_range : 1.0; in ScaleKernelInfo()
4571 neg_scale = ( fabs(kernel->negative_range) >= MagickEpsilon ) in ScaleKernelInfo()
4572 ? -kernel->negative_range : 1.0; in ScaleKernelInfo()
4581 for (i=0; i < (ssize_t) (kernel->width*kernel->height); i++) in ScaleKernelInfo()
4582 if (!IsNaN(kernel->values[i])) in ScaleKernelInfo()
4583 kernel->values[i] *= (kernel->values[i] >= 0) ? pos_scale : neg_scale; in ScaleKernelInfo()
4586 kernel->positive_range *= pos_scale; in ScaleKernelInfo()
4587 kernel->negative_range *= neg_scale; in ScaleKernelInfo()
4589 kernel->maximum *= (kernel->maximum >= 0.0) ? pos_scale : neg_scale; in ScaleKernelInfo()
4590 kernel->minimum *= (kernel->minimum >= 0.0) ? pos_scale : neg_scale; in ScaleKernelInfo()
4595 t = kernel->positive_range; in ScaleKernelInfo()
4596 kernel->positive_range = kernel->negative_range; in ScaleKernelInfo()
4597 kernel->negative_range = t; in ScaleKernelInfo()
4598 t = kernel->maximum; in ScaleKernelInfo()
4599 kernel->maximum = kernel->minimum; in ScaleKernelInfo()
4600 kernel->minimum = 1; in ScaleKernelInfo()
4630 MagickPrivate void ShowKernelInfo(const KernelInfo *kernel) in ShowKernelInfo() argument
4638 for (c=0, k=kernel; k != (KernelInfo *) NULL; c++, k=k->next ) { in ShowKernelInfo()
4641 if ( kernel->next != (KernelInfo *) NULL ) in ShowKernelInfo()
4709 MagickExport void UnityAddKernelInfo(KernelInfo *kernel, in UnityAddKernelInfo() argument
4713 if ( kernel->next != (KernelInfo *) NULL) in UnityAddKernelInfo()
4714 UnityAddKernelInfo(kernel->next, scale); in UnityAddKernelInfo()
4717 kernel->values[kernel->x+kernel->y*kernel->width] += scale; in UnityAddKernelInfo()
4718 CalcKernelMetaData(kernel); /* recalculate the meta-data */ in UnityAddKernelInfo()
4748 MagickPrivate void ZeroKernelNans(KernelInfo *kernel) in ZeroKernelNans() argument
4754 if (kernel->next != (KernelInfo *) NULL) in ZeroKernelNans()
4755 ZeroKernelNans(kernel->next); in ZeroKernelNans()
4757 for (i=0; i < (kernel->width*kernel->height); i++) in ZeroKernelNans()
4758 if (IsNaN(kernel->values[i])) in ZeroKernelNans()
4759 kernel->values[i]=0.0; in ZeroKernelNans()