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

Method SelectTextureFormat

Rendering/VolumeOpenGL2/vtkVolumeTexture.cxx:708–835  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

706
707//------------------------------------------------------------------------------
708void vtkVolumeTexture::SelectTextureFormat(
709 unsigned int& format, unsigned int& internalFormat, int& type, int scalarType, int noOfComponents)
710{
711 bool supportsFloat = true;
712 this->HandleLargeDataTypes = false;
713
714 switch (scalarType)
715 {
716 case VTK_FLOAT:
717 if (supportsFloat)
718 {
719 switch (noOfComponents)
720 {
721 case 1:
722 internalFormat = GL_R32F;
723 format = GL_RED;
724 break;
725 case 2:
726 internalFormat = GL_RG32F;
727 format = GL_RG;
728 break;
729 case 3:
730 internalFormat = GL_RGB32F;
731 format = GL_RGB;
732 break;
733 case 4:
734 internalFormat = GL_RGBA32F;
735 format = GL_RGBA;
736 break;
737 }
738 }
739 else
740 {
741 switch (noOfComponents)
742 {
743 case 1:
744 internalFormat = GL_RED;
745 format = GL_RED;
746 break;
747 case 2:
748 internalFormat = GL_RG;
749 format = GL_RG;
750 break;
751 case 3:
752 internalFormat = GL_RGB;
753 format = GL_RGB;
754 break;
755 case 4:
756 internalFormat = GL_RGBA;
757 format = GL_RGBA;
758 break;
759 }
760 }
761 break;
762 case VTK_UNSIGNED_CHAR:
763 case VTK_SIGNED_CHAR:
764 case VTK_SHORT:
765 case VTK_UNSIGNED_SHORT:

Callers 1

LoadVolumeMethod · 0.95

Calls 4

GetScaleAndBiasMethod · 0.95
MinFunction · 0.85
GetFiniteRangeMethod · 0.80
assertFunction · 0.50

Tested by

no test coverage detected