Skip to content

How can I modify Frame Data directly? #79

Closed Answered by asticode
kurochan asked this question in Q&A
Discussion options

You must be logged in to vote

@kurochan I've created the branch frame-data-write with the following:

  • FrameData.SetBytes(b []byte, align int) error which allows you to copy a buffer inside a frame's data
  • FrameData.FromImage(src image.Image) error which allows you to copy a Go image.Image inside a frame's data

Bare in mind that the developer is responsible for handling the writability of the frame. For that, I've added

  • Frame.MakeWritable()
  • Frame.IsWritable()

I'm not sure I've implemented the most efficient way to do this but I couldn't think of a better way. Also, memory management shouldn't be a problem, but for those features only time can tell 😬

Could you try this new branch and let me know whether this work as e…

Replies: 3 comments 9 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
9 replies
@asticode
Comment options

@kurochan
Comment options

@asticode
Comment options

@kurochan
Comment options

@asticode
Comment options

Answer selected by kurochan
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants