@@ -271,7 +271,8 @@ class jpegls_decoder final
271271 // / <exception cref="charls::jpegls_error">An error occurred during the operation.</exception>
272272 // / <exception cref="std::bad_alloc">Thrown when memory for the decoder could not be allocated.</exception>
273273 // / <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>
275276 static std::pair<charls::frame_info, charls::interleave_mode>
276277 decode (const SourceContainer& source, DestinationContainer& destination,
277278 const size_t maximum_size_in_bytes = 7680 * 4320 * 3 )
@@ -324,7 +325,7 @@ class jpegls_decoder final
324325 // / </param>
325326 // / <exception cref="charls::jpegls_error">An error occurred during the operation.</exception>
326327 // / <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 >
328329 jpegls_decoder (const Container& source_container, const bool parse_header) :
329330 jpegls_decoder (source_container.data(), source_container.size() * sizeof (typename Container::value_type),
330331 parse_header)
@@ -354,7 +355,7 @@ class jpegls_decoder final
354355 // / A STL like container that provides the functions data() and size() and the type value_type.
355356 // / </param>
356357 // / <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 >
358359 jpegls_decoder& source (const Container& source_container)
359360 {
360361 return source (source_container.data (), source_container.size () * sizeof (typename Container::value_type));
@@ -557,7 +558,7 @@ class jpegls_decoder final
557558 // / </param>
558559 // / <param name="stride">Number of bytes to the next line in the buffer, when zero, decoder will compute it.</param>
559560 // / <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 >
561562 void decode (CHARLS_OUT Container& destination_container, const uint32_t stride = 0 ) const
562563 {
563564 decode (destination_container.data (), destination_container.size () * sizeof (typename Container::value_type), stride);
@@ -569,7 +570,7 @@ class jpegls_decoder final
569570 // / <param name="stride">Number of bytes to the next line in the buffer, when zero, decoder will compute it.</param>
570571 // / <exception cref="charls::jpegls_error">An error occurred during the operation.</exception>
571572 // / <returns>Container with the decoded data.</returns>
572- template <typename Container>
573+ template <typename Container, typename T = typename Container::value_type >
573574 CHARLS_CHECK_RETURN Container decode (const uint32_t stride = 0 ) const
574575 {
575576 Container destination (destination_size () / sizeof (typename Container::value_type));
0 commit comments