@@ -271,7 +271,8 @@ class jpegls_decoder final
271
271
// / <exception cref="charls::jpegls_error">An error occurred during the operation.</exception>
272
272
// / <exception cref="std::bad_alloc">Thrown when memory for the decoder could not be allocated.</exception>
273
273
// / <returns>Frame info of the decoded image and the interleave mode.</returns>
274
- template <typename SourceContainer, typename DestinationContainer>
274
+ template <typename SourceContainer, typename DestinationContainer, typename T1 = typename SourceContainer::value_type,
275
+ typename T2 = typename DestinationContainer::value_type>
275
276
static std::pair<charls::frame_info, charls::interleave_mode>
276
277
decode (const SourceContainer& source, DestinationContainer& destination,
277
278
const size_t maximum_size_in_bytes = 7680 * 4320 * 3 )
@@ -324,7 +325,7 @@ class jpegls_decoder final
324
325
// / </param>
325
326
// / <exception cref="charls::jpegls_error">An error occurred during the operation.</exception>
326
327
// / <exception cref="std::bad_alloc">Thrown when memory for the decoder could not be allocated.</exception>
327
- template <typename Container>
328
+ template <typename Container, typename T = typename Container::value_type >
328
329
jpegls_decoder (const Container& source_container, const bool parse_header) :
329
330
jpegls_decoder (source_container.data(), source_container.size() * sizeof (typename Container::value_type),
330
331
parse_header)
@@ -354,7 +355,7 @@ class jpegls_decoder final
354
355
// / A STL like container that provides the functions data() and size() and the type value_type.
355
356
// / </param>
356
357
// / <exception cref="charls::jpegls_error">An error occurred during the operation.</exception>
357
- template <typename Container>
358
+ template <typename Container, typename T = typename Container::value_type >
358
359
jpegls_decoder& source (const Container& source_container)
359
360
{
360
361
return source (source_container.data (), source_container.size () * sizeof (typename Container::value_type));
@@ -557,7 +558,7 @@ class jpegls_decoder final
557
558
// / </param>
558
559
// / <param name="stride">Number of bytes to the next line in the buffer, when zero, decoder will compute it.</param>
559
560
// / <exception cref="charls::jpegls_error">An error occurred during the operation.</exception>
560
- template <typename Container>
561
+ template <typename Container, typename T = typename Container::value_type >
561
562
void decode (CHARLS_OUT Container& destination_container, const uint32_t stride = 0 ) const
562
563
{
563
564
decode (destination_container.data (), destination_container.size () * sizeof (typename Container::value_type), stride);
@@ -569,7 +570,7 @@ class jpegls_decoder final
569
570
// / <param name="stride">Number of bytes to the next line in the buffer, when zero, decoder will compute it.</param>
570
571
// / <exception cref="charls::jpegls_error">An error occurred during the operation.</exception>
571
572
// / <returns>Container with the decoded data.</returns>
572
- template <typename Container>
573
+ template <typename Container, typename T = typename Container::value_type >
573
574
CHARLS_CHECK_RETURN Container decode (const uint32_t stride = 0 ) const
574
575
{
575
576
Container destination (destination_size () / sizeof (typename Container::value_type));
0 commit comments