Skip to content

ENH: Declare RGBPixel, RGBAPixel constructors from component explicit#3238

Merged
hjmjohnson merged 1 commit into
InsightSoftwareConsortium:masterfrom
N-Dekker:RGB-constructors-explicit
Mar 1, 2022
Merged

ENH: Declare RGBPixel, RGBAPixel constructors from component explicit#3238
hjmjohnson merged 1 commit into
InsightSoftwareConsortium:masterfrom
N-Dekker:RGB-constructors-explicit

Conversation

@N-Dekker
Copy link
Copy Markdown
Contributor

Prevents implicit conversion of a component value to RGBPixel or
RGBAPixel. Aims to avoid possible flaws, like the one addressed by:

Pull request #3223
commit 490ef8c
"BUG: Fix ColorTableTestSpecialConditionChecker component/pixel mix-up"

Added deleted RGBPixel(nullptr_t) and RGBAPixel(nullptr_t)
constructors, especially to avoid erroneous user code like
RGBPixel pixel = 0.

Prevents implicit conversion of a component value to `RGBPixel` or
`RGBAPixel`. Aims to avoid possible flaws, like the one addressed by:

Pull request InsightSoftwareConsortium#3223
commit 490ef8c
"BUG: Fix `ColorTableTestSpecialConditionChecker` component/pixel mix-up"

Added _deleted_ `RGBPixel(nullptr_t)` and `RGBAPixel(nullptr_t)`
constructors, especially to avoid erroneous user code like
`RGBPixel pixel = 0`.
@github-actions github-actions Bot added area:Core Issues affecting the Core module type:Enhancement Improvement of existing methods or implementation labels Feb 28, 2022
@N-Dekker N-Dekker marked this pull request as ready for review March 1, 2022 09:37
@N-Dekker
Copy link
Copy Markdown
Contributor Author

N-Dekker commented Mar 1, 2022

/azp run ITK.Linux

@hjmjohnson hjmjohnson merged commit 0d352bd into InsightSoftwareConsortium:master Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Core Issues affecting the Core module type:Enhancement Improvement of existing methods or implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants