草庐IT

c++ - 吉尔提升 : convert rgb8_image_t to rgba8_image_t

我对GIL语法有点困惑。我要转换rgb8_image_t到rgba8_image_t并将alphachannel设置为1。有没有内置函数。如果不是如何手动执行此操作? 最佳答案 您想使用boost::gil::copy_and_convert_pixels并在范围内适当匹配color_convert特化。这是一个完整的例子:#include#includenamespaceboost{namespacegil{//DefineacolorconversionruleNBintheboost::gilnamespacetemplate