Commit graph

4 commits

Author SHA1 Message Date
Lucas CHOLLET
a08de19922 LibGfx/PortableFormat: Use FixedArray::unchecked_at
This allows us to drop from 7% to 5% passed on `add_pixels` when using
`image` to do conversions from JPEG to PPM.
2023-05-09 11:18:46 +02:00
Lucas CHOLLET
44905ed395 LibGfx/PortableFormat: Write to the output stream row by row
This is done by adding an intermediate buffer and flush it at the end of
every row. This makes the `add_pixels` method to drop from 50% to 7% in
profiles.
2023-05-09 11:18:46 +02:00
Lucas CHOLLET
d4d3c3f262 LibGfx/PortableFormat+image: Make encode take a Stream
As we directly write to the stream, we don't need to store a copy of the
entire image in memory. However, writing to a stream is heavier on the
CPU than to a ByteBuffer. This commit unfortunately makes `add_pixels`
two times slower.
2023-05-09 11:18:46 +02: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/PortableFormatWriter.cpp (Browse further)