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.
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.
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.