Commit graph

11 commits

Author SHA1 Message Date
Lucas CHOLLET
fd04b2dc9b LibGfx/PortableFormat: Propagate errors from decode() 2023-03-24 10:56:58 +01:00
Lucas CHOLLET
7ec310384a LibGfx/PortableFormat: Propagate errors from read_image_data() 2023-03-24 10:56:58 +01:00
Lucas CHOLLET
2356b48f13 LibGfx/PortableFormat: Propagate errors from read_magic_number() 2023-03-24 10:56:58 +01:00
Lucas CHOLLET
7cafd7d177 LibGfx/PortableFormat: Port to Stream
Each one of `[PBM, PGM, PPM]Loader` used yet another stream-like relic.
This patch ports all of them to `AK::Stream`.
2023-03-24 10:56:58 +01:00
Lucas CHOLLET
4554d10fe5 LibGfx: Remove unused functions load_from_memory and load_impl 2023-03-24 10:56:58 +01:00
Lucas CHOLLET
05e6ed6ecb LibGfx/PortableFormat: Propagate errors from some read_* functions
These functions are:
 - read_width
 - read_height
 - read_max_val
2023-03-24 10:56:58 +01:00
Lucas CHOLLET
bab2113ec1 LibGfx/PortableFormat: Make read_whitespace return an ErrorOr 2023-03-24 10:56:58 +01:00
Lucas CHOLLET
74f893e9f4 LibGfx/PortableFormat: Make read_comment return an ErrorOr 2023-03-24 10:56:58 +01:00
Lucas CHOLLET
964172754e LibGfx/PortableFormat: Don't accept comments that don't start with # 2023-03-24 10:56:58 +01:00
Lucas CHOLLET
9052a6febf LibGfx/PortableFormat: Simplify read_number signature
The function signature goes from:
`bool read_number(Streamer& streamer, TValue* value)`
to
`ErrorOr<u16> read_number(Streamer& streamer)`

It allows us to, on one hand use `ErrorOr` for error propagation,
removing an out parameter in the meantime, and on the other hand remove
the useless template.
2023-03-24 10:56:58 +01:00
Lucas CHOLLET
496b7ffb2b LibGfx: Move all image loaders and writers to a subdirectory 2023-03-21 22:39:25 +01:00
Renamed from Userland/Libraries/LibGfx/PortableImageLoaderCommon.h (Browse further)