mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
Meta: Remove convert-raw-to-rgb thingy since we have PNG support nowadays.
This commit is contained in:
parent
dbf5a7e4a6
commit
2d736d5591
Notes:
sideshowbarker
2024-07-19 14:38:34 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/2d736d5591c
1 changed files with 0 additions and 33 deletions
|
@ -1,33 +0,0 @@
|
|||
#include <stdio.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
int main(int argc, char**argv)
|
||||
{
|
||||
int fd = open(argv[1], O_RDONLY);
|
||||
if (fd < 0) {
|
||||
perror("open");
|
||||
return 1;
|
||||
}
|
||||
for (;;) {
|
||||
unsigned buffer;
|
||||
ssize_t nread = read(fd, &buffer, sizeof(buffer));
|
||||
if (nread == 0)
|
||||
break;
|
||||
if (nread < 0) {
|
||||
perror("read");
|
||||
return 1;
|
||||
}
|
||||
unsigned converted = buffer & 0xff00ff00;
|
||||
converted |= (buffer & 0xff0000) >> 16;
|
||||
converted |= (buffer & 0xff) << 16;
|
||||
write(1, &converted, sizeof(unsigned));
|
||||
}
|
||||
int rc = close(fd);
|
||||
if (rc < 0) {
|
||||
perror("close");
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
Loading…
Reference in a new issue