void RGB_LineTo_BGR( tImgViewLinear const& img, size_t y, vector<uint8_t>& v ) { tRGB const* source = ( tRGB const* )( img.row_ptr( y ) ); v.resize( img.pitch() ); tBGR* target = ( tBGR* )&v[0]; size_t count = img.size().x(); while( count-- ) { *target++ = *source++; } }