Inside a function x_gradient(), I declare a type dst_channel_t like so:
Code:
typedef typename channel_type<DstView>::type dst_channel_t;
I'm trying to pass this type as a parameter to a another function (x_gradient_par()) which runs in a thread like so:
Code:
mythreads[i] = std::thread(&x_gradient_par<const SrcView&, const DstView&>, src, dst, dst_channel_t, start, end);
This is what function x_gradient_par() looks like:
Code:
template <typename SrcView, typename DstView>
void x_gradient_par(const SrcView& src, const DstView& dst, const typename channel_type<DstView>::type dst_channel_t, int start, int end) {
//typedef typename channel_type<DstView>::type dst_channel_t; //I was previously trying to define the type here, but it would always generate an 'invalid use of incomplete type..' error.
for (int y = start; y < end; ++y)
{
typename SrcView::x_iterator src_it = src.row_begin(y);
typename DstView::x_iterator dst_it = dst.row_begin(y);
for (int x = 1; x < src.width() - 1; ++x)
{
static_transform(src_it[x - 1], src_it[x + 1], dst_it[x],
halfdiff_cast_channels<dst_channel_t>());
}
}
}
Any hints?
I've attached both the header file and a log file that contains the errors being produced.
x_gradient_par.h
log.txt