-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for ITU's T.416 - ODA SGR (38/48) sequence #15729
Conversation
Yeah, totally makes sense. And don't worry, this is not the final look of the PR 😄. I put it up so I get some early reviews and suggestion on how we'd like to go about implementing this. I have few alternative ideas: Separator info inside
|
I think it's fine to put the separator info into But I think I have an idea how to simplify it a bit. Instead of adding multiple new struct TextColor
{
// ...
private:
union
{
BYTE _red, _index;
};
BYTE _green;
BYTE _blue;
ColorType _meta : 7;
BYTE _isColon : 1 = 0;
}; Now we can properly store it as if it was a boolean and simplify const auto sep = color.GetSeparator();
fmt::format_to(std::back_inserter(response), FMT_COMPILE(L";{}{2}5{2}{}"), base + 8, index, sep);
|
FWIW, exposing the separator as a character will give us a false sense of equivalence. It is not as simple as replacing
It just so happens that I would swing the other way and call it |
Oh I didn't notice that there are two |
I'm super cool with the bitfield version though - that's clever! |
🤯 that's a TIL for me. This is definitely a cleaner approach than mine! Thanks. As @j4james suggested we don't need to track colour type, let's see if that works out for us. If not, we'll go ahead with bitfields approach then. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another fantastic PR. Thanks! 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made a couple of suggestions, but nothing blocking. I'd be quite happy with this as it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love this! I'm going to give you a little bit to address open feedback before I merge this PR, but thank you so much for doing it.
My only nit -- and it's a small one -- is that I personally prefer SubParam
instead of Alt
. It makes it clearer when to use which one. I might even go so far as to call it _ApplyGraphicsOptionWithSubParams
, _SetRgbColorsHelperFromSubParams
Up to you!
Pushed the requested changes. I've also included some tests to ensure that we ignore colors if any of the following conditions are true:
|
Oh, in case I didn't say it enough: HELL YES, THANK YOU. I've wanted this for EVER. |
Add test for subparameter based `GraphicOptions`. `GraphicsSingleWithSubParamTests` is added for subparameter based `GraphicOptions`. This should've been included with #15729. Also, while working on #15795, I realized creating and passing subparameters for the tests is painful right now. I've added a small util `MakeSubParamsAndRanges(...)` that eases creating subparameters and subparameter ranges from a simple list of (lists of) subparameters. ## Validation Steps Performed - All tests passed.
This PR adds support for ITU's T.416 - ODA SGR (38/48) colour sequence, which makes use of colon instead of semi-colon as a parameter separator.
DECRQSS
query, we have decided to use colons, as the major usecase for such queries are feature detection (whether client supports ODA colours), and tracking the original separator may add too much complexity to the codebase.Validation Steps Performed
DECRQSS
response.Closes #15706