dotnet / dotnet/dotnet-api-docs

Byte order is unclear

Open
#1,742 0 comments 0 reactions 0 assignees View on GitHub
area-WPF dotnet-api/prod Pri2 untriaged
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

Documentation should specify for BGR and RGB pixel formats the order of the color channels in memory. It is not clear from the documentation.
For example, in GDI, RGB is specified in MSB order, so that, when mapped to an int32, R is stored in the most significant byte, followed by G, then B. x86 being little endian, this means channels are stored in the order of B-G-R in memory.
It is not clear from this documentation if System.Windows.Media works the same way, or if RGB pixel format means channels are stored in RGB order in memory.
Please clarify.

Additionally, when the PixelFormat originates from a BitmapSource, there is the question of whether the byte order signifies byt order in the file, or byte order once read into memory.

---
#### Document Details

⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*

* ID: 6d29397a-4f05-b17b-7611-98f6d879f14b
* Version Independent ID: e18fcb57-e336-7f6c-b9a7-5abcb2bce7c9
* Content: [PixelFormats.Bgr24 Property (System.Windows.Media)](https://docs.microsoft.com/en-us/dotnet/api/system.windows.media.pixelformats.bgr24?view=netframework-4.7.2)
* Content Source: [xml/System.Windows.Media/PixelFormats.xml](https://github.com/dotnet/dotnet-api-docs/blob/master/xml/System.Windows.Media/PixelFormats.xml)
* Product: **dotnet-api**
* GitHub Login: @dotnet-bot
* Microsoft Alias: **dotnetcontent**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.