Task #12081 (accepted)
Opened 11 years ago
Last modified 9 years ago
Bug: C++ PixelBuffer needs a companion proxy pixel buffer
Reported by: | rleigh | Owned by: | rleigh |
---|---|---|---|
Priority: | minor | Milestone: | Unscheduled |
Component: | Bio-Formats | Version: | 5.0.0 |
Keywords: | cpp | Cc: | |
Resources: | n.a. | Referenced By: | n.a. |
References: | n.a. | Remaining Time: | n.a. |
Sprint: | n.a. |
Description
In order to allow safe access to sub-regions of a pixel buffer, we need a proxy buffer which allows access to a range of bytes within an existing buffer. This will remove the possibility of buffer overflows when reading arbitrary ranges of bytes into the buffer since we won't need to use raw pointers.
Change History (10)
comment:1 Changed 11 years ago by rleigh
- Keywords cpp added
comment:2 Changed 11 years ago by rleigh
comment:3 Changed 11 years ago by rleigh
- Add iterator types; see http://www.boost.org/doc/libs/1_55_0/libs/iterator/doc/index.html for helpers. Use a random_access_iterator_tag.
- Add begin/end methods.
- Add ctor from iterator range to both plain and shared pixel buffer.
- Iterators should store a reference to the buffer
- Shared buffer should store reference obtained from iterator (and validate the begin and end are in the same buffer)
- Also check that iterators are not reversed
- Check subrange bounds are within the bounds of the original buffer
comment:4 Changed 10 years ago by rleigh
- Status changed from new to accepted
Note that #11827 should permit this once Boost.MultiArray? subsetting methods are added.
comment:5 Changed 10 years ago by rleigh
This is achievable using multi_array (subarray), but since subarray doesn't derive from multi_array_ref, this will require adding it to the PixelBuffer? internal variant, and updating code using direct pixel access (e.g. IFD visitors) to special case transfers so that sparse storage works without corrupting the pixel data.
comment:6 Changed 10 years ago by rleigh
- Summary changed from Bug: C++ PixelBufferRaw needs a companion proxy pixel buffer to Bug: C++ PixelBuffer needs a companion proxy pixel buffer
This can be done directly inside PixelBuffer? if it can be extended nicely to include support for multi_array_ref, with methods to create a reference from an existing pixel buffer.
comment:7 Changed 9 years ago by rleigh
- Milestone changed from 5.1.0 to 5.1.2
comment:8 Changed 9 years ago by jamoore
- Milestone changed from 5.1.4 to B-F-5.1.4
Splitting 5.1.4 due to milestone decoupling
comment:9 Changed 9 years ago by jburel
- Milestone changed from B-F-5.1.5 to B-F-5.1.6
comment:10 Changed 9 years ago by sbesson
- Milestone changed from B-F-5.2.0 to Unscheduled
Initial work is here: https://github.com/rleigh-dundee/bioformats/compare/cpp-pixbuf-sharedtemplate?expand=1