Improve docs for ImageBuf, and some error detection and missing methods #2460
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.
Tried to expand and clarify explanations of the constructors and
reset methods in particular, after an issue was filed with some
confusion.
Added checks to ensure that for the ctrs and reset methods that take
an ImageSpec and allocate (or wrap) a buffer, if the spec doesn't
have enough information to do the allocation or know the size of the
wrapped memory (spec lacking nonzero width, height, depth,
nchannels, and a concrete data format), the buffer stays marked as
UNINITIALIZED.
Added
ImageBuf::reset()
as a synonym forclear()
and a resetvariety corresponding to the "wrapped app buffer" constructor.
This makes it so that every ctr has a corresponding reset method, and
vice versa. As I was clarifying the docs, I realized that this would
be better if fully symmetric. Because these are not virtual functions,
these changes should not break ABI compatibility and should be safe to
backport.
In a few spots nearby I renamed NULL to nullptr, couldn't help myself.