I am trying to implement a library which supports drawing different types of bitmaps, and later may have the functionality to draw compressed format images. The most simple example of a class which represents the Bitmap structure may look like this:
The problem is that now the _root file is closed after the bitmap header scan (for each Bitmap object the scan has to be automatic) , and there is no way that I know which let's me reopen the file exclude using SD.open(), but this function works with a file path and not the file itself, that means that SD.open(_root.name()) will not work if the file is not in a root directory(the "path/to/filename" will become just "filename" in this case).
of course I can store the path to the file separately but in this case there will be useless memory duplication in File member "name" and the path and the library results unoptimized.
this example shows the base case of the algorithm - if the file size is less than the required number, than copy it, but if not do nothing. I want to make predefined boundaries and copy the bitmap by parts into small buffers, load the buffer to a display and than load the other parts of the bitmap as so.
Maybe it's better to use some operating system, or maybe a board that already has an operating system, like Raspberry Pi.
From what I understand of SD card in Arduino, you have to open the file, read or write, and close. What you said about 'Instantiate' sounds to me like you're trying to create a pointer address that can be accessed directly without opening the file, and I believe it doesn't work that way.