2019-04-15 23:24:21 +00:00
|
|
|
//============================================================================
|
2016-08-26 19:30:52 +00:00
|
|
|
// Copyright (c) Kitware, Inc.
|
|
|
|
// All rights reserved.
|
|
|
|
// See LICENSE.txt for details.
|
|
|
|
//
|
|
|
|
// This software is distributed WITHOUT ANY WARRANTY; without even
|
|
|
|
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
// PURPOSE. See the above copyright notice for more information.
|
2019-04-15 23:24:21 +00:00
|
|
|
//============================================================================
|
2016-08-26 19:30:52 +00:00
|
|
|
#ifndef vtk_m_rendering_DecodePNG_h
|
|
|
|
#define vtk_m_rendering_DecodePNG_h
|
|
|
|
|
2019-06-18 19:19:05 +00:00
|
|
|
#include <vtkm/Types.h>
|
2016-08-26 19:30:52 +00:00
|
|
|
#include <vtkm/rendering/vtkm_rendering_export.h>
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
namespace vtkm
|
|
|
|
{
|
|
|
|
namespace rendering
|
|
|
|
{
|
2016-08-26 19:30:52 +00:00
|
|
|
|
2019-06-18 19:19:05 +00:00
|
|
|
/// Decodes a PNG file buffer in memory, into a raw pixel buffer
|
|
|
|
/// Output is RGBA 32-bit (8 bit per channel) color format
|
|
|
|
/// no matter what color type the original PNG image had. This gives predictable,
|
|
|
|
/// usable data from any random input PNG.
|
|
|
|
///
|
2016-08-26 19:30:52 +00:00
|
|
|
VTKM_RENDERING_EXPORT
|
2019-06-18 19:19:05 +00:00
|
|
|
vtkm::UInt32 DecodePNG(std::vector<unsigned char>& out_image,
|
|
|
|
unsigned long& image_width,
|
|
|
|
unsigned long& image_height,
|
|
|
|
const unsigned char* in_png,
|
|
|
|
std::size_t in_size);
|
2016-08-26 19:30:52 +00:00
|
|
|
}
|
|
|
|
} // vtkm::rendering
|
|
|
|
|
|
|
|
#endif //vtk_m_rendering_DecodePNG_h
|