Salome HOME
Merge from V5_1_main 10/06/2010
[modules/visu.git] / src / PIPELINE / VISU_LookupTable.cxx
1 //  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 //  VISU OBJECT : interactive object for VISU entities implementation
24 //  File   : VISU_LookupTable.cxx
25 //  Author : Vitaliy Smetannikov
26 //  Module : VISU
27 //
28 #include "VISU_LookupTable.hxx"
29
30 #include <vtkObjectFactory.h>
31 #include <vtkBitArray.h>
32 #include <math.h>
33
34 using namespace std;
35
36
37 //----------------------------------------------------------------------------
38 vtkStandardNewMacro(VISU_LookupTable);
39
40
41 //----------------------------------------------------------------------------
42 VISU_LookupTable
43 ::VISU_LookupTable(int sze, int ext):
44   vtkLookupTable(sze, ext),
45   myScale(1.0),
46   myBicolor(false),
47   myHasMarkedValues(false)
48 {}
49
50 //----------------------------------------------------------------------------
51 namespace
52 {
53   inline
54   void
55   CopyColor( unsigned char* theTaget, const unsigned char* theSource )
56   {
57     theTaget[0] = theSource[0];
58     theTaget[1] = theSource[1];
59     theTaget[2] = theSource[2];
60   }
61 }
62
63
64 //----------------------------------------------------------------------------
65 void
66 VISU_LookupTable
67 ::MarkValueByColor( vtkFloatingPointType theValue,
68                     unsigned char* theColor )
69 {
70   vtkIdType anIndex = this->GetIndex( theValue );
71   unsigned char *aTablePtr = this->GetPointer( anIndex );
72   CopyColor( aTablePtr, theColor );
73   myHasMarkedValues = true;
74 }
75
76
77 //----------------------------------------------------------------------------
78 void
79 VISU_LookupTable
80 ::FillByColor( unsigned char* theColor )
81 {
82   vtkIdType aNbColors = this->GetNumberOfColors();
83   for(int i = 0; i < aNbColors; i++){
84     unsigned char *aTablePtr = this->GetPointer(i);
85     CopyColor( aTablePtr, theColor );
86   }
87 }
88
89
90 //----------------------------------------------------------------------------
91 void
92 VISU_LookupTable
93 ::MakeBiColor()
94 {
95   unsigned char aRedPtr[3] = {255, 0, 0};
96   unsigned char aBluePtr[3] = {0, 0, 255};
97
98   vtkFloatingPointType aRange[2];
99   this->GetTableRange(aRange);
100   vtkIdType aNbColors = this->GetNumberOfColors();
101
102   vtkFloatingPointType aDelta = (aRange[1]-aRange[0])/aNbColors;
103   vtkFloatingPointType aValue = aRange[0]+0.5*aDelta;
104   for(int i = 0; i < aNbColors; i++){
105     vtkIdType anIndex = this->GetIndex(aValue);
106     unsigned char* aTablePtr = this->GetPointer(anIndex);
107     if(aValue > 0.0){
108       CopyColor(aTablePtr,aRedPtr);
109     }else{
110       CopyColor(aTablePtr,aBluePtr);
111     }
112     aValue += aDelta;
113   }
114 }
115
116
117 //----------------------------------------------------------------------------
118 void
119 VISU_LookupTable
120 ::SetMapScale(vtkFloatingPointType theScale)
121 {
122   if( myScale != theScale )
123   {
124     myScale = theScale;
125     Modified();
126   }
127 }
128
129 void VISU_LookupTable::SetBicolor( bool theBicolor )
130 {
131   if( myBicolor != theBicolor )
132   {
133     myBicolor = theBicolor;
134     Modified();
135   }
136 }
137
138
139 int
140 VISU_LookupTable
141 ::ComputeLogRange(vtkFloatingPointType inRange[2],
142                   vtkFloatingPointType outRange[2])
143 {
144   if(inRange[0] >= inRange[1])
145     return -1;
146   if(0.0 <= inRange[0] && 0.0 < inRange[1]){
147     if(inRange[0] != 0.0)
148       outRange[0] = log10((double)inRange[0]);
149     else
150       outRange[0] = log10((double)inRange[1]*1.0E-6);
151     outRange[1] = log10((double)inRange[1]);
152     return 0;
153   }else if(inRange[0] < 0.0 && inRange[1] <= 0.0){
154     outRange[0] = log10((double)-inRange[0]);
155     outRange[1] = log10((double)-inRange[1]);
156     return 1;
157   }else
158     return -1;
159 }
160
161 unsigned char*
162 VISU_LookupTable
163 ::MapValue(vtkFloatingPointType v)
164 {
165   if(GetScale() == VTK_SCALE_LOG10) {
166     vtkFloatingPointType aLowBound = log10(this->TableRange[0]);
167     v = pow(vtkFloatingPointType(10.0), aLowBound + (v - aLowBound)*myScale);
168     return vtkLookupTable::MapValue(v);
169   } else if (!myBicolor) {
170     v = this->TableRange[0] + (v - this->TableRange[0])*myScale;
171     return vtkLookupTable::MapValue(v);
172   } else {
173     unsigned char* table = this->Table->GetPointer(0);
174     int index = v > 0 ? 4*static_cast<int>(this->GetNumberOfColors()-1) : 0;
175     return &table[index];
176   }
177 }
178
179 void
180 VISU_LookupTable
181 ::ForceBuild()
182 {
183   Superclass::ForceBuild();
184   myHasMarkedValues = false;
185 }
186
187 // Apply log to value, with appropriate constraints.
188 inline
189 vtkFloatingPointType
190 VISU_ApplyLogScale(vtkFloatingPointType v,
191                    vtkFloatingPointType range[2],
192                    vtkFloatingPointType logRange[2])
193 {
194   // is the range set for negative numbers?
195   if (range[0] < 0) {
196     if (v < 0) {
197       v = log10(-static_cast<double>(v));
198     }
199     else if (range[0] > range[1]) {
200       v = logRange[0];
201     }
202     else {
203       v = logRange[1];
204     }
205   }
206   else {
207     if (v > 0) {
208       v = log10(static_cast<double>(v));
209     }
210     else if (range[0] < range[1]) {
211       v = logRange[0];
212     }
213     else {
214       v = logRange[1];
215     }
216   }
217   return v;
218 }
219
220 // Apply shift/scale to the scalar value v and do table lookup.
221 inline
222 unsigned char *
223 VISU_LinearLookup(vtkFloatingPointType v,
224                   unsigned char *table,
225                   vtkFloatingPointType maxIndex,
226                   vtkFloatingPointType shift,
227                   vtkFloatingPointType scale,
228                   bool bicolor)
229 {
230   if( !bicolor )
231   {
232     vtkFloatingPointType findx = (v + shift)*scale;
233     if (findx < 0)
234       findx = 0;
235     if (findx > maxIndex)
236       findx = maxIndex;
237
238     return &table[4*static_cast<int>(findx)];
239     // round
240     //return &table[4*(int)(findx + 0.5f)];
241   }
242   else
243   {
244     int index = v > 0 ? 4*static_cast<int>(maxIndex) : 0;
245     return &table[index];
246   }
247 }
248
249 // accelerate the mapping by copying the data in 32-bit chunks instead
250 // of 8-bit chunks
251 template<class T>
252 void
253 VISU_LookupTableMapData(vtkLookupTable *self,
254                         T *input,
255                         unsigned char *output,
256                         int length,
257                         int inIncr,
258                         int outFormat,
259                         vtkFloatingPointType theMapScale,
260                         bool bicolor)
261 {
262   int i = length;
263   vtkFloatingPointType *range = self->GetTableRange();
264   vtkFloatingPointType maxIndex = self->GetNumberOfColors() - 1;
265   vtkFloatingPointType shift, scale;
266   unsigned char *table = self->GetPointer(0);
267   unsigned char *cptr;
268   vtkFloatingPointType alpha;
269
270   if ( (alpha=self->GetAlpha()) >= 1.0 ) //no blending required
271   {
272     if (self->GetScale() == VTK_SCALE_LOG10)
273     {
274       vtkFloatingPointType val;
275       vtkFloatingPointType logRange[2];
276       VISU_LookupTable::ComputeLogRange(range, logRange);
277       shift = -logRange[0];
278       if (logRange[1] <= logRange[0])
279       {
280         scale = VTK_LARGE_FLOAT;
281       }
282       else
283       {
284         scale = (maxIndex + 1)/(logRange[1] - logRange[0]);
285       }
286       /* correct scale
287       scale = maxIndex/(logRange[1] - logRange[0]);
288       */
289       if (outFormat == VTK_RGBA)
290       {
291         while (--i >= 0)
292         {
293           val = VISU_ApplyLogScale(*input, range, logRange);
294           cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
295           *output++ = *cptr++;
296           *output++ = *cptr++;
297           *output++ = *cptr++;
298           *output++ = *cptr++;
299           input += inIncr;
300         }
301       }
302       else if (outFormat == VTK_RGB)
303       {
304         while (--i >= 0)
305         {
306           val = VISU_ApplyLogScale(*input, range, logRange);
307           cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
308           *output++ = *cptr++;
309           *output++ = *cptr++;
310           *output++ = *cptr++;
311           input += inIncr;
312         }
313       }
314       else if (outFormat == VTK_LUMINANCE_ALPHA)
315       {
316         while (--i >= 0)
317         {
318           val = VISU_ApplyLogScale(*input, range, logRange);
319           cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
320           *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
321                                                  cptr[2]*0.11 + 0.5);
322           *output++ = cptr[3];
323           input += inIncr;
324         }
325       }
326       else // outFormat == VTK_LUMINANCE
327       {
328         while (--i >= 0)
329         {
330           val = VISU_ApplyLogScale(*input, range, logRange);
331           cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
332           *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
333                                                  cptr[2]*0.11 + 0.5);
334           input += inIncr;
335         }
336       }
337     }//if log scale
338
339     else //not log scale
340     {
341       shift = -range[0];
342       if (range[1] <= range[0])
343       {
344         scale = VTK_LARGE_FLOAT;
345       }
346       else
347       {
348         scale = (maxIndex + 1)/(range[1] - range[0]);
349       }
350       /* correct scale
351       scale = maxIndex/(range[1] - range[0]);
352       */
353
354       if (outFormat == VTK_RGBA)
355       {
356         while (--i >= 0)
357         {
358           cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
359           *output++ = *cptr++;
360           *output++ = *cptr++;
361           *output++ = *cptr++;
362           *output++ = *cptr++;
363           input += inIncr;
364         }
365       }
366       else if (outFormat == VTK_RGB)
367       {
368         while (--i >= 0)
369         {
370           cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
371           *output++ = *cptr++;
372           *output++ = *cptr++;
373           *output++ = *cptr++;
374           input += inIncr;
375         }
376       }
377       else if (outFormat == VTK_LUMINANCE_ALPHA)
378       {
379         while (--i >= 0)
380         {
381           cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
382           *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
383                                                  cptr[2]*0.11 + 0.5);
384           *output++ = cptr[3];
385           input += inIncr;
386         }
387       }
388       else // outFormat == VTK_LUMINANCE
389       {
390         while (--i >= 0)
391         {
392           cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
393           *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
394                                                  cptr[2]*0.11 + 0.5);
395           input += inIncr;
396         }
397       }
398     }//if not log lookup
399   }//if blending not needed
400
401   else //blend with the specified alpha
402   {
403     if (self->GetScale() == VTK_SCALE_LOG10)
404     {
405       vtkFloatingPointType val;
406       vtkFloatingPointType logRange[2];
407       VISU_LookupTable::ComputeLogRange(range, logRange);
408       shift = -logRange[0];
409       if (logRange[1] <= logRange[0])
410       {
411         scale = VTK_LARGE_FLOAT;
412       }
413       else
414       {
415         scale = (maxIndex + 1)/(logRange[1] - logRange[0]);
416       }
417       /* correct scale
418       scale = maxIndex/(logRange[1] - logRange[0]);
419       */
420       if (outFormat == VTK_RGBA)
421       {
422         while (--i >= 0)
423         {
424           val = VISU_ApplyLogScale(*input, range, logRange);
425           cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
426           *output++ = *cptr++;
427           *output++ = *cptr++;
428           *output++ = *cptr++;
429           *output++ = static_cast<unsigned char>((*cptr)*alpha); cptr++;
430           input += inIncr;
431         }
432       }
433       else if (outFormat == VTK_RGB)
434       {
435         while (--i >= 0)
436         {
437           val = VISU_ApplyLogScale(*input, range, logRange);
438           cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
439           *output++ = *cptr++;
440           *output++ = *cptr++;
441           *output++ = *cptr++;
442           input += inIncr;
443         }
444       }
445       else if (outFormat == VTK_LUMINANCE_ALPHA)
446       {
447         while (--i >= 0)
448         {
449           val = VISU_ApplyLogScale(*input, range, logRange);
450           cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
451           *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
452                                                  cptr[2]*0.11 + 0.5);
453           *output++ = static_cast<unsigned char>(alpha*cptr[3]);
454           input += inIncr;
455         }
456       }
457       else // outFormat == VTK_LUMINANCE
458       {
459         while (--i >= 0)
460         {
461           val = VISU_ApplyLogScale(*input, range, logRange);
462           cptr = VISU_LinearLookup(val, table, maxIndex, shift, scale*theMapScale, bicolor);
463           *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
464                                                  cptr[2]*0.11 + 0.5);
465           input += inIncr;
466         }
467       }
468     }//log scale with blending
469
470     else //no log scale with blending
471     {
472       shift = -range[0];
473       if (range[1] <= range[0])
474       {
475         scale = VTK_LARGE_FLOAT;
476       }
477       else
478       {
479         scale = (maxIndex + 1)/(range[1] - range[0]);
480       }
481       /* correct scale
482       scale = maxIndex/(range[1] - range[0]);
483       */
484
485       if (outFormat == VTK_RGBA)
486       {
487         while (--i >= 0)
488         {
489           cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
490           *output++ = *cptr++;
491           *output++ = *cptr++;
492           *output++ = *cptr++;
493           *output++ = static_cast<unsigned char>((*cptr)*alpha); cptr++;
494           input += inIncr;
495         }
496       }
497       else if (outFormat == VTK_RGB)
498       {
499         while (--i >= 0)
500         {
501           cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
502           *output++ = *cptr++;
503           *output++ = *cptr++;
504           *output++ = *cptr++;
505           input += inIncr;
506         }
507       }
508       else if (outFormat == VTK_LUMINANCE_ALPHA)
509       {
510         while (--i >= 0)
511         {
512           cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
513           *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
514                                                  cptr[2]*0.11 + 0.5);
515           *output++ = static_cast<unsigned char>(cptr[3]*alpha);
516           input += inIncr;
517         }
518       }
519       else // outFormat == VTK_LUMINANCE
520       {
521         while (--i >= 0)
522         {
523           cptr = VISU_LinearLookup(*input, table, maxIndex, shift, scale*theMapScale, bicolor);
524           *output++ = static_cast<unsigned char>(cptr[0]*0.30 + cptr[1]*0.59 +
525                                                  cptr[2]*0.11 + 0.5);
526           input += inIncr;
527         }
528       }
529     }//no log scale
530   }//alpha blending
531 }
532
533 // Although this is a relatively expensive calculation,
534 // it is only done on the first render. Colors are cached
535 // for subsequent renders.
536 template<class T>
537 void
538 VISU_LookupTableMapMag(vtkLookupTable *self,
539                        T *input,
540                        unsigned char *output,
541                        int length,
542                        int inIncr,
543                        int outFormat,
544                        vtkFloatingPointType theMapScale,
545                        bool bicolor)
546 {
547   double tmp, sum;
548   double *mag;
549   int i, j;
550
551   mag = new double[length];
552   for (i = 0; i < length; ++i)
553   {
554     sum = 0;
555     for (j = 0; j < inIncr; ++j)
556     {
557       tmp = (double)(*input);
558       sum += (tmp * tmp);
559       ++input;
560     }
561     mag[i] = sqrt(sum);
562   }
563
564   VISU_LookupTableMapData(self, mag, output, length, 1, outFormat, theMapScale, bicolor);
565
566   delete [] mag;
567 }
568
569
570 void VISU_LookupTable::MapScalarsThroughTable2(void *input,
571                                                unsigned char *output,
572                                                int inputDataType,
573                                                int numberOfValues,
574                                                int inputIncrement,
575                                                int outputFormat)
576 {
577   if (this->UseMagnitude && inputIncrement > 1)
578   {
579     switch (inputDataType)
580     {
581       case VTK_BIT:
582         vtkErrorMacro("Cannot comput magnitude of bit array.");
583         break;
584       case VTK_CHAR:
585         VISU_LookupTableMapMag(this,static_cast<char *>(input),output,
586                                numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
587         return;
588       case VTK_UNSIGNED_CHAR:
589         VISU_LookupTableMapMag(this,static_cast<unsigned char *>(input),output,
590                              numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
591         return;
592       case VTK_SHORT:
593         VISU_LookupTableMapMag(this,static_cast<short *>(input),output,
594                              numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
595         return;
596       case VTK_UNSIGNED_SHORT:
597         VISU_LookupTableMapMag(this,static_cast<unsigned short *>(input),output,
598                              numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
599         return;
600       case VTK_INT:
601         VISU_LookupTableMapMag(this,static_cast<int *>(input),output,
602                              numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
603         return;
604       case VTK_UNSIGNED_INT:
605         VISU_LookupTableMapMag(this,static_cast<unsigned int *>(input),output,
606                              numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
607         return;
608       case VTK_LONG:
609         VISU_LookupTableMapMag(this,static_cast<long *>(input),output,
610                              numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
611         return;
612       case VTK_UNSIGNED_LONG:
613         VISU_LookupTableMapMag(this,static_cast<unsigned long *>(input),output,
614                              numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
615         return;
616       case VTK_FLOAT:
617         VISU_LookupTableMapMag(this,static_cast<float *>(input),output,
618                              numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
619         return;
620       case VTK_DOUBLE:
621         VISU_LookupTableMapMag(this,static_cast<double *>(input),output,
622                              numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
623         return;
624       default:
625         vtkErrorMacro(<< "MapImageThroughTable: Unknown input ScalarType");
626         return;
627     }
628   }
629
630   switch (inputDataType)
631   {
632     case VTK_BIT:
633     {
634       vtkIdType i, id;
635       vtkBitArray *bitArray = vtkBitArray::New();
636       bitArray->SetVoidArray(input,numberOfValues,1);
637       vtkUnsignedCharArray *newInput = vtkUnsignedCharArray::New();
638       newInput->SetNumberOfValues(numberOfValues);
639       for (id=i=0; i<numberOfValues; i++, id+=inputIncrement)
640       {
641         newInput->SetValue(i, bitArray->GetValue(id));
642       }
643       VISU_LookupTableMapData(this,
644                               static_cast<unsigned char*>(newInput->GetPointer(0)),
645                               output,numberOfValues,
646                               inputIncrement,outputFormat,myScale,myBicolor);
647       newInput->Delete();
648       bitArray->Delete();
649     }
650     break;
651
652     case VTK_CHAR:
653       VISU_LookupTableMapData(this,static_cast<char *>(input),output,
654                               numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
655       break;
656
657     case VTK_UNSIGNED_CHAR:
658       VISU_LookupTableMapData(this,static_cast<unsigned char *>(input),output,
659                               numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
660       break;
661
662     case VTK_SHORT:
663       VISU_LookupTableMapData(this,static_cast<short *>(input),output,
664                               numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
665       break;
666
667     case VTK_UNSIGNED_SHORT:
668       VISU_LookupTableMapData(this,static_cast<unsigned short *>(input),output,
669                               numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
670       break;
671
672     case VTK_INT:
673       VISU_LookupTableMapData(this,static_cast<int *>(input),output,
674                               numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
675       break;
676
677     case VTK_UNSIGNED_INT:
678       VISU_LookupTableMapData(this,static_cast<unsigned int *>(input),output,
679                               numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
680       break;
681
682     case VTK_LONG:
683       VISU_LookupTableMapData(this,static_cast<long *>(input),output,
684                               numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
685       break;
686
687     case VTK_UNSIGNED_LONG:
688       VISU_LookupTableMapData(this,static_cast<unsigned long *>(input),output,
689                               numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
690       break;
691
692     case VTK_FLOAT:
693       VISU_LookupTableMapData(this,static_cast<float *>(input),output,
694                               numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
695       break;
696
697     case VTK_DOUBLE:
698       VISU_LookupTableMapData(this,static_cast<double *>(input),output,
699                               numberOfValues,inputIncrement,outputFormat,myScale,myBicolor);
700       break;
701
702     default:
703       vtkErrorMacro(<< "MapImageThroughTable: Unknown input ScalarType");
704       return;
705   }
706 }