[Feature] Add Image and variable-shape ImageBatch core types#151
Open
zacharyvincze wants to merge 13 commits into
Open
[Feature] Add Image and variable-shape ImageBatch core types#151zacharyvincze wants to merge 13 commits into
zacharyvincze wants to merge 13 commits into
Conversation
… wrappers" This reverts commit 9055ed0.
There was a problem hiding this comment.
Pull request overview
This PR adds foundational C++ core types for representing single images and variable-shape (heterogeneous) image batches, along with a comprehensive new test suite to validate ownership, casting, and export/snapshot behavior.
Changes:
- Introduces new core runtime types:
Image/ImageStorage,ImageData*,ImageBatchData*, and producer containerImageBatchVarShape. - Extends
ImageFormatto have a constexpr default representingFMT_NONEand adds equality operators. - Adds new C++ tests and test helpers for image and variable-shape batch behavior.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/roccv/cpp/src/tests/core/image/test_image.cpp | New unit tests for Image requirements, allocation, lifecycle, export, and wrapping. |
| tests/roccv/cpp/src/tests/core/image/test_image_data.cpp | New unit tests for ImageData strided variants and runtime cast behavior. |
| tests/roccv/cpp/src/tests/core/image/test_image_batch_var_shape.cpp | New unit tests for ImageBatchVarShape push/pop/clear/export/move/iteration behavior. |
| tests/roccv/cpp/src/tests/core/image/test_image_batch_data.cpp | New unit tests for ImageBatchData varshape descriptors and cast behavior. |
| tests/roccv/cpp/include/test_helpers.hpp | Adds AsInt/AsAddr/AsSize helpers for safer EXPECT_EQ comparisons. |
| tests/roccv/cpp/include/image_test_helpers.hpp | Adds fake image/buffer builders and a counting allocator for tests. |
| src/core/image.cpp | Implements Image allocation, requirements calculation, export, and wrapping. |
| src/core/image_data.cpp | Implements ImageData/ImageDataStrided* accessors and buffer-kind tagging. |
| src/core/image_batch_var_shape.cpp | Implements ImageBatchVarShape storage, lazy sync, caching, and export. |
| src/core/image_batch_data.cpp | Implements ImageBatchData/varshape accessors and buffer-kind tagging. |
| include/core/image.hpp | Declares the Image handle type, requirements, and ImageWrapData. |
| include/core/image_storage.hpp | Declares refcounted storage holder for Image buffers. |
| include/core/image_format.hpp | Makes default ImageFormat represent FMT_NONE; adds ==/!=. |
| include/core/image_data.hpp | Declares ImageData hierarchy, buffer-kind enum, and cast mechanism. |
| include/core/image_buffer.hpp | Declares plane/strided buffer descriptors and ImageBuffer aggregate. |
| include/core/image_batch_var_shape.hpp | Declares producer-side variable-shape batch container and export APIs. |
| include/core/image_batch_data.hpp | Declares ImageBatchData hierarchy, buffer-kind enum, and accessors. |
| include/core/image_batch_buffer.hpp | Declares varshape batch descriptor buffer layout (ImageBatchVarShapeBufferStrided). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces foundational types for variable-shape image batches.
New core types (
include/core/,src/core/):Image/ImageStorage— single-image handle and backing storageImageData/ImageBuffer— descriptor + raw buffer for a single imageImageBatchData/ImageBatchBuffer— descriptors for batches of heterogeneous imagesImageBatchVarShape— user-facing variable-shape batch containerSupporting changes:
ImageFormattweaksimage_test_helpers.hppand a small addition totest_helpers.hppTests (
tests/roccv/cpp/src/tests/core/image/): ~1,250 lines covering Image, ImageData, ImageBatchData, and ImageBatchVarShape.Next Steps: