Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Task
Fix the current way of processing the format of the source image in SimdSynetSetInput().
How it worked before a19e2d8: SimdSynetSetInput() either left the channel order low or swapped Red and Blue depending on the source image format. The change occurred when srcFormat was equal to Rgb24 or Rgba32. Thus, in order to pass the image in Rbg24 format as is, the format value had to be changed, leaving the actual channel order unchanged.
How it works after a19e2d8: the isRgb flag appeared in SynetSetInput(), and when set to true, srcFormat was changed to the reverse one (BGR -> RGB). Thus, depending on the source format and the value of the flag SimdSynetSetInput() either changes the channel order or not.
Issues:
Solution
Replace the isRgb parameter with swapChannels and add it to SimdSynetSetInput(). The swapChannels parameter now strictly specifies the change of channel order regardless of the format. Now user does not need to mess with changing the source image, and the effect of both functions is transparent.