Skip to content

Refine SimdLib API docs for BGRA/BGR conversion functions - #358

Merged
ermig1979 merged 7 commits into
masterfrom
copilot/improve-function-descriptions-again
May 28, 2026
Merged

Refine SimdLib API docs for BGRA/BGR conversion functions#358
ermig1979 merged 7 commits into
masterfrom
copilot/improve-function-descriptions-again

Conversation

Copilot AI commented May 28, 2026

Copy link
Copy Markdown
Contributor

The SimdLib.h descriptions for several BGRA/BGR conversion APIs were too generic and, in places, inaccurate about subsampling, alpha handling, and dimensional constraints. This update aligns those comments with the actual implementation behavior.

  • YUV conversion semantics (BGRA → YUV*)

    • Clarified per-format sampling behavior for:
      • SimdBgraToYuv420pV2 (4:2:0, 2x2 chroma averaging, even width/height)
      • SimdBgraToYuv422pV2 (4:2:2, horizontal-pair chroma averaging, even width)
      • SimdBgraToYuv444pV2 (4:4:4, per-pixel chroma)
      • SimdBgraToYuva420pV2 (4:2:0 YUV + full-resolution alpha copy)
    • Explicitly documented that BGRA alpha is ignored for YUV-only outputs and copied for YUVA output.
  • Bayer/BGRA conversion behavior

    • SimdBgrToBayer: documented mosaic selection semantics from bayerFormat and even-dimension requirement.
    • SimdBgrToBgra: documented constant-alpha fill behavior.
    • SimdBgr48pToBgra32: documented 16-bit planar-to-8-bit channel extraction behavior (endianness-dependent byte choice) and alpha fill.
  • Color-space output details

    • SimdBgrToGray: documented weighted grayscale conversion formula with rounding.
    • SimdBgrToHsl / SimdBgrToHsv: documented channel layout ([H,S,L], [H,S,V]) and 8-bit component ranges.
// SimdBgraToYuv420pV2 docs now state:
// - Y: per-pixel from B,G,R
// - U/V: one sample per 2x2 block from averaged B,G,R
// - constraints: width and height must be even

@ermig1979
ermig1979 marked this pull request as ready for review May 28, 2026 15:51
Copilot AI review requested due to automatic review settings May 28, 2026 15:51
@ermig1979
ermig1979 merged commit ef4dbbe into master May 28, 2026
1 check failed
Copilot AI removed the request for review from Copilot May 28, 2026 16:13
@ermig1979
ermig1979 deleted the copilot/improve-function-descriptions-again branch July 1, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants