Hi Lubomir,
Thanks for the quick reply. I understand what you are saying and agree, but in my case I’m not doing the exact same thing as the example. I included the example for clarification. I’m actually manipulating an image and need a working copy with float point precision created inside a generic function. My function looks like the following and I want to remove the gray_layout_t with whatever layout src1 uses.
template <typename SrcView1, typename SrcView2, typename DstView>
void function(const SrcView1& src1, const SrcView2& src2, const DstView& dst)
{
gil_function_requires<ImageViewConcept<SrcView1> >();
gil_function_requires<ImageViewConcept<SrcView2> >();
gil_function_requires<MutableImageViewConcept<DstView> >();
assert(src1.dimensions() == src2.dimensions() && src1.dimensions() == dst.dimensions());
DstView::point_t dimensions = dst.dimensions();
typedef pixel<bits32f, gray_layout_t> copyPixel;
typedef image<copyPixel, false> copyImage;
copyImage newImage(src1.dimensions());
}
I might be able to use the derived_image_type metafunction, but now I need to figure out how to use this if the input I’m trying to derive from is a view and not an image.
Thanks,
Mark