MCPcopy Create free account
hub / github.com/Kitware/VTK / GetFormat

Method GetFormat

IO/Image/vtkTIFFReader.cxx:670–710  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

668
669//------------------------------------------------------------------------------
670unsigned int vtkTIFFReader::GetFormat()
671{
672 if (this->ImageFormat != vtkTIFFReader::NOFORMAT)
673 {
674 return this->ImageFormat;
675 }
676
677 switch (this->InternalImage->Photometrics)
678 {
679 case PHOTOMETRIC_RGB:
680 case PHOTOMETRIC_YCBCR:
681 this->ImageFormat = vtkTIFFReader::RGB;
682 return this->ImageFormat;
683 case PHOTOMETRIC_MINISWHITE:
684 case PHOTOMETRIC_MINISBLACK:
685 this->ImageFormat = vtkTIFFReader::GRAYSCALE;
686 return this->ImageFormat;
687 case PHOTOMETRIC_PALETTE:
688 if (this->IgnoreColorMap)
689 {
690 // ignore color map; setting vtkTIFFReader::PALETTE_GRAYSCALE ensures
691 // we'll pick correct number of components.
692 this->ImageFormat = vtkTIFFReader::PALETTE_GRAYSCALE;
693 return this->ImageFormat;
694 }
695 for (unsigned int cc = 0; cc < 256; ++cc)
696 {
697 unsigned short red, green, blue;
698 this->GetColor(cc, &red, &green, &blue);
699 if (red != green || red != blue)
700 {
701 this->ImageFormat = vtkTIFFReader::PALETTE_RGB;
702 return this->ImageFormat;
703 }
704 }
705 this->ImageFormat = vtkTIFFReader::PALETTE_GRAYSCALE;
706 return this->ImageFormat;
707 }
708 this->ImageFormat = vtkTIFFReader::OTHER;
709 return this->ImageFormat;
710}
711
712//------------------------------------------------------------------------------
713void vtkTIFFReader::GetColor(

Callers 6

ExecuteInformationMethod · 0.95
ReadGenericImageMethod · 0.95
ReadImageInternalMethod · 0.95
EvaluateImageAtMethod · 0.95
InheritMethod · 0.45
CopyMethod · 0.45

Calls 1

GetColorMethod · 0.95

Tested by

no test coverage detected