IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 32333


Ignore:
Timestamp:
Sep 6, 2011, 10:53:01 AM (15 years ago)
Author:
eugene
Message:

do not crash on color scales with bad (nan,inf) values

Location:
branches/eam_branches/ipp-20110710/Ohana/src/kapa2/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110710/Ohana/src/kapa2/src/DrawObjects.c

    r31665 r32333  
    408408          (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) {
    409409        if (scaleColor) {
     410          if (!finite(z[i])) continue;
    410411          int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1)));
    411412          XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel);
     
    424425          (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) {
    425426        if (scaleColor) {
     427          if (!finite(z[i])) continue;
    426428          int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1)));
    427429          XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel);
     
    440442          (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) {
    441443        if (scaleColor) {
     444          if (!finite(z[i])) continue;
    442445          int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1)));
    443446          XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel);
     
    457460          (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) {
    458461        if (scaleColor) {
     462          if (!finite(z[i])) continue;
    459463          int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1)));
    460464          XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel);
     
    475479          (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) {
    476480        if (scaleColor) {
     481          if (!finite(z[i])) continue;
    477482          int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1)));
    478483          XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel);
     
    495500          (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) {
    496501        if (scaleColor) {
     502          if (!finite(z[i])) continue;
    497503          int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1)));
    498504          XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel);
     
    513519          (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) {
    514520        if (scaleColor) {
     521          if (!finite(z[i])) continue;
    515522          int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1)));
    516523          XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel);
     
    531538          (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) {
    532539        if (scaleColor) {
     540          if (!finite(z[i])) continue;
    533541          int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1)));
    534542          XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel);
     
    547555          (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) {
    548556        if (scaleColor) {
     557          if (!finite(z[i])) continue;
    549558          int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1)));
    550559          XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel);
     
    567576          (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) {
    568577        if (scaleColor) {
     578          if (!finite(z[i])) continue;
    569579          int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1)));
    570580          XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel);
     
    589599          (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy)) {
    590600        if (scaleColor) {
     601          if (!finite(z[i])) continue;
    591602          int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1)));
    592603          XSetForeground (graphic->display, graphic->gc, graphic->cmap[pixel].pixel);
  • branches/eam_branches/ipp-20110710/Ohana/src/kapa2/src/PSObjects.c

    r31665 r32333  
    323323      {
    324324        if (scaleColor) {
     325          if (!finite(z[i])) continue;
    325326          int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1)));
    326327          fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]);
     
    340341      {
    341342        if (scaleColor) {
     343          if (!finite(z[i])) continue;
    342344          int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1)));
    343345          fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]);
     
    357359      {
    358360        if (scaleColor) {
     361          if (!finite(z[i])) continue;
    359362          int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1)));
    360363          fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]);
     
    375378      {
    376379        if (scaleColor) {
     380          if (!finite(z[i])) continue;
    377381          int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1)));
    378382          fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]);
     
    393397      {
    394398        if (scaleColor) {
     399          if (!finite(z[i])) continue;
    395400          int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1)));
    396401          fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]);
     
    415420      {
    416421        if (scaleColor) {
     422          if (!finite(z[i])) continue;
    417423          int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1)));
    418424          fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]);
     
    434440      {
    435441        if (scaleColor) {
     442          if (!finite(z[i])) continue;
    436443          int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1)));
    437444          fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]);
     
    453460      {
    454461        if (scaleColor) {
     462          if (!finite(z[i])) continue;
    455463          int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1)));
    456464          fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]);
     
    470478      {
    471479        if (scaleColor) {
     480          if (!finite(z[i])) continue;
    472481          int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1)));
    473482          fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]);
     
    491500      {
    492501        if (scaleColor) {
     502          if (!finite(z[i])) continue;
    493503          int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1)));
    494504          fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]);
     
    514524      {
    515525        if (scaleColor) {
     526          if (!finite(z[i])) continue;
    516527          int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1)));
    517528          fprintf (f, "%4.2f %4.2f %4.2f setrgbcolor\n", pixel1[pixel], pixel2[pixel], pixel3[pixel]);
  • branches/eam_branches/ipp-20110710/Ohana/src/kapa2/src/bDrawObjects.c

    r31665 r32333  
    307307      {
    308308        if (scaleColor) {
     309          if (!finite(z[i])) continue;
    309310          int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1)));
    310311          buffer->bColor_R = pixel1[pixel];
     
    326327      {
    327328        if (scaleColor) {
     329          if (!finite(z[i])) continue;
    328330          int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1)));
    329331          buffer->bColor_R = pixel1[pixel];
     
    345347      {
    346348        if (scaleColor) {
     349          if (!finite(z[i])) continue;
    347350          int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1)));
    348351          buffer->bColor_R = pixel1[pixel];
     
    365368      {
    366369        if (scaleColor) {
     370          if (!finite(z[i])) continue;
    367371          int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1)));
    368372          buffer->bColor_R = pixel1[pixel];
     
    385389      {
    386390        if (scaleColor) {
     391          if (!finite(z[i])) continue;
    387392          int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1)));
    388393          buffer->bColor_R = pixel1[pixel];
     
    405410      {
    406411        if (scaleColor) {
     412          if (!finite(z[i])) continue;
    407413          int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1)));
    408414          buffer->bColor_R = pixel1[pixel];
     
    424430      {
    425431        if (scaleColor) {
     432          if (!finite(z[i])) continue;
    426433          int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1)));
    427434          buffer->bColor_R = pixel1[pixel];
     
    445452      {
    446453        if (scaleColor) {
     454          if (!finite(z[i])) continue;
    447455          int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1)));
    448456          buffer->bColor_R = pixel1[pixel];
     
    464472      {
    465473        if (scaleColor) {
     474          if (!finite(z[i])) continue;
    466475          int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1)));
    467476          buffer->bColor_R = pixel1[pixel];
     
    487496      {
    488497        if (scaleColor) {
     498          if (!finite(z[i])) continue;
    489499          int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1)));
    490500          buffer->bColor_R = pixel1[pixel];
     
    511521      {
    512522        if (scaleColor) {
     523          if (!finite(z[i])) continue;
    513524          int pixel = MIN (graphic->Npixels - 2, MAX (0, z[i]*(graphic->Npixels - 1)));
    514525          buffer->bColor_R = pixel1[pixel];
Note: See TracChangeset for help on using the changeset viewer.