Skip to content

Conversation

@Asheikhm
Copy link
Contributor

@Asheikhm Asheikhm commented Oct 6, 2025

Fix :

Added C-contiguity detection to the applyRGB buffer method in PyCPUProcessor.cpp. The fix checks if the input NumPy array is stored in row-major order by verifying that the memory strides match the expected C-contiguous layout. If the array isn't C-contiguous (like when someone passes a transposed column-major array without copying it), the method now throws a runtime error saying "applyRGB only supports C-contiguous (row-major) arrays". This prevents the color processor from silently processing data in the wrong order and forces users to ensure their arrays are properly laid out in memory before calling applyRGB.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Oct 6, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

…ffer is C order or not, for now throw error

Signed-off-by: Afsaneh Sheikhmiri <afsaneh.sheikhmiri@autodesk.com>
… test is still not passing

Signed-off-by: Afsaneh Sheikhmiri <afsaneh.sheikhmiri@autodesk.com>
@Asheikhm Asheikhm force-pushed the Asheikh/dev-days/applyRGB_transpose branch from c0c9a8a to 8883342 Compare October 6, 2025 17:32
@doug-walker doug-walker requested a review from KelSolaar October 6, 2025 17:40
@Asheikhm Asheikhm force-pushed the Asheikh/dev-days/applyRGB_transpose branch 2 times, most recently from 5dc7b9e to dedb64e Compare October 6, 2025 18:05
… are still contiguous

Signed-off-by: Afsaneh Sheikhmiri <afsaneh.sheikhmiri@autodesk.com>
@Asheikhm Asheikhm force-pushed the Asheikh/dev-days/applyRGB_transpose branch from dedb64e to 1cfb236 Compare October 6, 2025 18:24
Copy link
Collaborator

@remia remia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran into the issue while using colour.LUT3D() utility, this was correctly caught by this PR, thank you @Asheikhm !

Copy link
Collaborator

@doug-walker doug-walker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @Asheikhm ! We will go ahead and merge this.

@doug-walker doug-walker merged commit 125af7d into AcademySoftwareFoundation:main Oct 28, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants