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