shinyblink / ffshot Goto Github PK
View Code? Open in Web Editor NEWfarbfeld screenshot utility
License: ISC License
farbfeld screenshot utility
License: ISC License
As the title states.
They are broken.
Lines 141 to 143 in 853b1eb
00 15 00 21 00 32
instead of 15 15 21 21 32 32
for example.
From the official png2ff.c file:
switch(png_get_bit_depth(pngs, pngi)) {
case 8:
for (r = 0; r < height; ++r) {
for (i = 0; i < rowlen; i++) {
row[i] = htons(257 * pngrows[r][i]);
}
efwrite(row, sizeof(uint16_t), rowlen, stdout);
}
My (stupid) fix would be to replace lines 141 to 143 with this:
if (bpc == 8) {
img[p + 0] = htobe16(r * 257);
img[p + 1] = htobe16(g * 257);
img[p + 2] = htobe16(b * 257);
} else {
img[p + 0] = htobe16(r << scale);
img[p + 1] = htobe16(g << scale);
img[p + 2] = htobe16(b << scale);
}
Hi @shinyblink , @vifino , @g-rden .
$ make
cc -pedantic -Wall -Wextra -Os -lxcb -lxcb-image -o ffshot ffshot.c
/usr/bin/ld: /tmp/ccIPsFIF.o: in function «main»:
ffshot.c:(.text.startup+0x4b): undefined reference to «xcb_connect»
...
Maybe replace:
Lines 14 to 15 in 854c537
$(BINS): ffshot.c
$(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@
?
PS:
$ uname -a
Linux devuan-zvezdochiot 5.10.0-14-amd64 #1 SMP Debian 5.10.113-1 (2022-04-29) x86_64 GNU/Linux
$ cc --version
cc (Debian 10.2.1-6) 10.2.1 20210110
Currently, this software just bails out if the display is not 8bpc.
On my new laptop, I have 10bpc. This needs to be fixed, but I have no idea how.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.