GithubHelp home page GithubHelp logo

ffshot's People

Contributors

g-rden avatar vifino avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ffshot's Issues

incorrect 8bpc output

ffshot/ffshot.c

Lines 141 to 143 in 853b1eb

img[p + 0] = htobe16(r << scale);
img[p + 1] = htobe16(g << scale);
img[p + 2] = htobe16(b << scale);

For 8bpc it outputs 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);
}

Makefile?

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:

ffshot/Makefile

Lines 14 to 15 in 854c537

ffshot: ffshot.c
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o ffshot $^

to

$(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

Fix more-than-8-bit displays

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.