| 410 | } |
| 411 | |
| 412 | const char* vtkImageExport::ScalarTypeCallback() |
| 413 | { |
| 414 | if (!this->GetInput()) |
| 415 | { |
| 416 | return "unsigned char"; |
| 417 | } |
| 418 | |
| 419 | int scalarType; |
| 420 | if (this->GetInputAlgorithm()) |
| 421 | { |
| 422 | scalarType = this->GetDataScalarType(); |
| 423 | } |
| 424 | else |
| 425 | { |
| 426 | scalarType = this->GetInput()->GetScalarType(); |
| 427 | } |
| 428 | |
| 429 | switch (scalarType) |
| 430 | { |
| 431 | case VTK_DOUBLE: |
| 432 | { |
| 433 | return "double"; |
| 434 | } |
| 435 | case VTK_FLOAT: |
| 436 | { |
| 437 | return "float"; |
| 438 | } |
| 439 | case VTK_LONG: |
| 440 | { |
| 441 | return "long"; |
| 442 | } |
| 443 | case VTK_UNSIGNED_LONG: |
| 444 | { |
| 445 | return "unsigned long"; |
| 446 | } |
| 447 | case VTK_INT: |
| 448 | { |
| 449 | return "int"; |
| 450 | } |
| 451 | case VTK_UNSIGNED_INT: |
| 452 | { |
| 453 | return "unsigned int"; |
| 454 | } |
| 455 | case VTK_SHORT: |
| 456 | { |
| 457 | return "short"; |
| 458 | } |
| 459 | case VTK_UNSIGNED_SHORT: |
| 460 | { |
| 461 | return "unsigned short"; |
| 462 | } |
| 463 | case VTK_CHAR: |
| 464 | { |
| 465 | return "char"; |
| 466 | } |
| 467 | case VTK_UNSIGNED_CHAR: |
| 468 | { |
| 469 | return "unsigned char"; |
no test coverage detected