FileDataSource(3)

πŸ“¦
version 0.1.0 Β· 2 versions
, in fedora 43

✨ 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 at offset.
  • ~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

  • true if 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