Merge topic 'allow_rendering_to_build_on_windows'
6d9dd7d2 Correct conversion warning in VolumeRendererStructured cc8121d9 Fix uninitialized warnings from DecodePNG. c75feb74 Don't build vtkm_rendering if we can't find opengl. Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !595
This commit is contained in:
commit
25dae61fa7
@ -235,7 +235,7 @@ macro(vtkm_configure_component_Rendering)
|
||||
|
||||
vtkm_finish_configure_component(Rendering
|
||||
DEPENDENT_VARIABLES VTKm_ENABLE_RENDERING VTKm_Base_FOUND
|
||||
ADD_LIBRARIES vtkm_rendering ${GLEW_LIBRARIES}
|
||||
ADD_LIBRARIES vtkm_rendering
|
||||
)
|
||||
endmacro(vtkm_configure_component_Rendering)
|
||||
|
||||
|
@ -118,7 +118,7 @@ vtkm_configure_component_OpenGL()
|
||||
if(VTKm_OpenGL_FOUND)
|
||||
list(APPEND headers ${opengl_headers})
|
||||
list(APPEND sources ${opengl_sources})
|
||||
|
||||
|
||||
vtkm_configure_component_OSMesa()
|
||||
if(VTKm_OSMesa_FOUND)
|
||||
list(APPEND headers ${osmesa_headers})
|
||||
@ -130,36 +130,35 @@ if(VTKm_OpenGL_FOUND)
|
||||
list(APPEND headers ${egl_headers})
|
||||
list(APPEND sources ${egl_sources})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(VTKm_ENABLE_OSMESA AND NOT VTKm_OSMesa_FOUND)
|
||||
message(SEND_ERROR "OSMesa was requested by not properly configured.
|
||||
Either make sure the OSMesa headers and library are properly found or set
|
||||
VTKm_ENABLE_OSMESA to OFF.")
|
||||
endif()
|
||||
if(VTKm_ENABLE_OSMESA AND NOT VTKm_OSMesa_FOUND)
|
||||
message(SEND_ERROR "OSMesa was requested by not properly configured.
|
||||
Either make sure the OSMesa headers and library are properly found or set
|
||||
VTKm_ENABLE_OSMESA to OFF.")
|
||||
endif()
|
||||
|
||||
vtkm_declare_headers(${headers})
|
||||
vtkm_declare_headers(${headers})
|
||||
|
||||
if (VTKm_ENABLE_CUDA)
|
||||
vtkm_library(
|
||||
SOURCES ${sources}
|
||||
CUDA
|
||||
WRAP_FOR_CUDA ${device_sources}
|
||||
)
|
||||
else()
|
||||
vtkm_library(
|
||||
SOURCES ${sources}
|
||||
)
|
||||
endif()
|
||||
if (VTKm_ENABLE_CUDA)
|
||||
vtkm_library(
|
||||
SOURCES ${sources}
|
||||
CUDA
|
||||
WRAP_FOR_CUDA ${device_sources}
|
||||
)
|
||||
else()
|
||||
vtkm_library(
|
||||
SOURCES ${sources}
|
||||
)
|
||||
endif()
|
||||
|
||||
# Subclasses need rendering library
|
||||
vtkm_configure_component_Rendering()
|
||||
# Subclasses need rendering library
|
||||
vtkm_configure_component_Rendering()
|
||||
|
||||
add_subdirectory(internal)
|
||||
add_subdirectory(raytracing)
|
||||
add_subdirectory(internal)
|
||||
add_subdirectory(raytracing)
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
add_subdirectory(testing)
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
add_subdirectory(testing)
|
||||
endif() #opengl found
|
||||
|
@ -301,6 +301,7 @@ int DecodePNG(std::vector<unsigned char>& out_image, unsigned long& image_width,
|
||||
{
|
||||
error = 0;
|
||||
info.width = 0; info.height = 0; //changed if header read successfully
|
||||
info.key_r = info.key_g = info.key_b = 0;
|
||||
if(size == 0 || in == 0) { error = 48; return; } //the given data is empty
|
||||
readPngHeader(&in[0], size); if(error) return;
|
||||
std::size_t pos = 33; //first byte of the first chunk after the header
|
||||
|
@ -221,7 +221,7 @@ public:
|
||||
//normalize scalar
|
||||
finalScalar = (finalScalar - MinScalar) * InverseDeltaScalar;
|
||||
|
||||
vtkm::Id colorIndex = vtkm::Id(finalScalar * ColorMapSize);
|
||||
vtkm::Id colorIndex = static_cast<vtkm::Id>(finalScalar) * ColorMapSize;
|
||||
//colorIndex = vtkm::Min(ColorMapSize, vtkm::Max(0,colorIndex));
|
||||
vtkm::Vec<vtkm::Float32,4> sampleColor = ColorMap.Get(colorIndex);
|
||||
//sampleColor[3] = .05f;
|
||||
|
Loading…
Reference in New Issue
Block a user