Skip to content

Commit

Permalink
Issue #46: implemented naive conversion in ArgbToBgraConverter
Browse files Browse the repository at this point in the history
  • Loading branch information
dzhoshkun committed Oct 30, 2018
1 parent ddd4487 commit 34b24eb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/epiphansdk/argb_to_bgra_converter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 34b24eb

Please sign in to comment.