From 34b24eb0cb0103f8a1d24c528885f3c451aef3a6 Mon Sep 17 00:00:00 2001 From: Dzhoshkun Ismail Shakir Date: Tue, 30 Oct 2018 09:21:52 +0000 Subject: [PATCH] Issue #46: implemented naive conversion in ArgbToBgraConverter --- src/epiphansdk/argb_to_bgra_converter.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/epiphansdk/argb_to_bgra_converter.cpp b/src/epiphansdk/argb_to_bgra_converter.cpp index 4a379410..615f66b9 100644 --- a/src/epiphansdk/argb_to_bgra_converter.cpp +++ b/src/epiphansdk/argb_to_bgra_converter.cpp @@ -19,7 +19,14 @@ ArgbToBgraConverter::~ArgbToBgraConverter() void ArgbToBgraConverter::convert(const unsigned char *argb, unsigned char *bgra) { - + size_t length = 4 * _width * _height; + for (size_t i = 0; i < length; i += 4) + { + bgra[i] = argb[i+3]; + bgra[i+1] = argb[i+2]; + bgra[i+2] = argb[i+1]; + bgra[i+3] = argb[i]; + } } void ArgbToBgraConverter::set_frame_dimensions(size_t width,