Skip to content

Fix NDArrayInfo setting in ColorConvert#586

Open
gustavosr8 wants to merge 5 commits into
areaDetector:masterfrom
gustavosr8:cc-fix
Open

Fix NDArrayInfo setting in ColorConvert#586
gustavosr8 wants to merge 5 commits into
areaDetector:masterfrom
gustavosr8:cc-fix

Conversation

@gustavosr8
Copy link
Copy Markdown
Member

This PR was motivated after seeing different values of compressed and uncompressed size after performing a mono to RGB1 conversion.

Tested with ADSim converting its mono image to RGB1, 2 and 3. Inspecting the data end metadata with PVA plugin. The dimensions and the data size (compressed and uncompressed) are correct.

The dimensions are already being set in NDArrayPool::alloc [1], using
the given dims for each specific case. Remove the copy() overwriting by
setting to false the copyDimensions flag. This also makes it unnecessary
to set dimensions afterwards in most cases.

[1] ADApp/ADSrc/NDArrayPool.cpp, lines 193-199
Already done in NDArrayPool::copy [1].

[1] ADApp/ADSrc/NDArrayPool.cpp, lines 283-285
Changing compressed size is only relevant when copying the data - i.e.
copyData==true. Otherwise, if we are only interested in copying the
metadata, unconditionally setting it could be not accurate - e.g. when
resizing or changing the array dimensions.
Left behind in e788121 (Remove parameter counting (LAST_xxx_PARAM,
NUM_xxx_PARAMS; add maxThreads argument to constructor, 2017-03-23)
The tests converts a Mono image into each one of the RGB color modes,
and checks if the uniqueId and timeStamp remains the same, if the
compressedSize remains equal to the image size, and if the dimensions
are as expected according to the desired output color mode.
@gustavosr8 gustavosr8 changed the title Fix NDArrayInfo setting in ColorConvert#2 Fix NDArrayInfo setting in ColorConvert May 20, 2026
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