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

SpectrogramGenerator private members to protected #57

Closed
jmcmeen opened this issue Oct 9, 2023 · 1 comment · Fixed by #62
Closed

SpectrogramGenerator private members to protected #57

jmcmeen opened this issue Oct 9, 2023 · 1 comment · Fixed by #62

Comments

@jmcmeen
Copy link
Contributor

jmcmeen commented Oct 9, 2023

I am extending/inheriting SpectrogramGenerator to implement a method called GetBytes that returns the spectrogram image data as an array of bytes. The method is modelled after SaveImage, where I am instead of saving the Bitmap to file, I am saving to a MemoryStream and returning the stream as a byte array. I am trying to minimize writing to disk in operations where I am calling SaveImage millions of times and I don't need the .png (or other formats), just it's bytes.

SaveImage requires the private FFTs property. So in my new GetBytes method, I can't access that property. If it were protected, along with some other methods and fields, I believe this would make the class more extensible.

@jmcmeen
Copy link
Contributor Author

jmcmeen commented Oct 9, 2023

Or add an implementation of a method GetImageBytes that mirrors SaveImage, allowing me to pass in the extension instead of the file name. Creates a memory stream and returns the memory stream as an array of bytes.

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 a pull request may close this issue.

1 participant