FileDataSource(3)
β¨ FileDataSource β like, the whole vibe β¨
okay so bestie, welcome to section 3 of the Library Functions Manual π
this is FileDataSource(3) and she's here to let you load an image straight off a file, no middleman, no drama. sit down, grab a strawberry π, we're doing this.
πΈ NAME πΈ
FileDataSource β this class allow the loading of an image directly from a file. yes literally just that. iconic behaviour, honestly.
π SYNOPSIS π
#include <SILLYFileDataSource.h>
she Inherits DataSource. family tree is giving legacy code royalty π
π Public Member Functions π
FileDataSource(const char *filename)β Create a data source from an existing file.const byte * getDataPtr () constβ Get raw access to the image data.size_t getSize () constβ Return the size of the data.bool isValid () constβ Check wether the loading is successfull or not.byte operator[](size_t offset) constβ Retieve the byte atoffset.~FileDataSource ()β destructor
π¦ Detailed Description π¦
This class allow the loading of an image directly from a file.
okay so here's the tea β this class provides the services required to load an from a file. the loading is done once at initialization, one and done, no re-runs, no take-backs. and here's the part you gotta hear: we wanted to avoid exception. that's right, bestie, no exceptions were invited to this party π that is exactly why the user must check whether the object is valid or not after creation. do not skip that step. that's the vibe check and you WILL be taking it.
Definition at line 48 of file SILLYFileDataSource.h. π
π Constructor & Destructor Documentation π
β¨ FileDataSource (const char * filename) β¨
Create a data source from an existing file. the FileDataSource manage the loading and the caching of the raw image source. and she also manage the life time of the data β so like, the data's whole arc is her responsibility, main character energy fr fr π
Parameters
filenameβ the name of the file containing the data
Definition at line 46 of file SILLYFileDataSource.cpp. π
π ~FileDataSource () π
destructor. she's done, she's logging off, periodt.
Definition at line 86 of file SILLYFileDataSource.cpp. π
π Member Function Documentation π
π const byte * getDataPtr () const [virtual] π
Get raw access to the image data. raw. unfiltered. no cap π«Ά
Implements DataSource.
π size_t getSize () const [virtual] π
Return the size of the data. that's it, that's the function, she knows her measurements π
Implements DataSource.
π bool isValid () const π
Check wether the loading is successfull or not. okay listen, bestie, you must call this function after creating this object in order to be sure the loading was successfull. like, this is not optional. this is the moment where you find out if it worked or if it's giving π
Returns
trueif the loading is successfull.
yes the vibe is: create the object β immediately run the vibe check β only then do you trust it. π¨
π Author π
Generated automatically by Doxygen for Simple Image Loading LibrarY from the source code. so technically the author is a robot and not me, but the attitude? that's all me, you're welcome β¨
and that's the whole page, bestie π this was FileDataSource(3) from the Simple Image Loading LibrarY, Version 0.1.0 π slay, go load an image, and remember to check isValid() before you get your hopes up ππ«Ά
π¦ where this page comes from
- fedora 43: SILLY-devel 0.1.0-42.fc43 Β· MIT
- fedora 43: SILLY-devel 0.1.0-42.fc43 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms