Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve docs for ImageBuf, and some error detection and missing methods #2460

Merged
merged 1 commit into from
Jan 12, 2020

Conversation

lgritz
Copy link
Collaborator

@lgritz lgritz commented Jan 12, 2020

  • 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 for clear() and a reset
    variety 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.

* 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 for `clear()` and a reset
  variety 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.
@lgritz
Copy link
Collaborator Author

lgritz commented Jan 12, 2020

Fixes #2458

@lgritz lgritz merged commit 0eacfc5 into AcademySoftwareFoundation:master Jan 12, 2020
@lgritz lgritz deleted the lg-imagebuf branch January 12, 2020 16:52
lgritz added a commit to lgritz/OpenImageIO that referenced this pull request Jan 20, 2020
…ds (AcademySoftwareFoundation#2460)

* 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 for `clear()` and a reset
  variety 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.
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.

None yet

1 participant