0
Fork 0
mirror of https://github.com/emersion/grim.git synced 2026-10-22 19:11:38 +00:00
Commit graph

128 commits

Author SHA1 Message Date
Simon Ser
47e2658619
readme: move to sr.ht 2022-03-30 10:20:08 +02:00
Oğuz Ersen
238079e734 bash-completion: localize variables 2022-03-27 16:37:23 +02:00
Simon Ser
89e02e663f write_jpg: fix printf format specifier 2022-02-08 20:11:10 -05:00
Simon Ser
e2cb2d1279 build: bump to version 1.4.0 v1.4.0 2022-02-09 00:20:30 +01:00
Simon Ser
3c55e3f7d6 build: stop using sh to invoke scdoc 2022-02-09 00:12:01 +01:00
Simon Ser
69f874d0b0 build: bump to Meson 0.58.0
Cleanup deprecated usage. We'll need a newer Meson soon.
2022-02-09 00:09:48 +01:00
Simon Ser
795ff08d40 build: fix indentation and style 2022-02-09 00:04:47 +01:00
Manuel Stoeckl
20c7c47a0a Remove cairo dependency 2022-01-20 11:19:49 +01:00
Manuel Stoeckl
248210d6e8 Stop using cairo_surface_t 2022-01-20 11:19:49 +01:00
Manuel Stoeckl
c0859c96ba write_png: switch from cairo_surface_t to pixman_image_t 2022-01-20 11:19:49 +01:00
Manuel Stoeckl
6742c6b347 write_jpg: switch from cairo_surface_t to pixman_image_t 2022-01-20 11:19:49 +01:00
Manuel Stoeckl
67b7f51f76 write_ppm: switch from cairo_surface_t to pixman_image_t 2022-01-20 11:19:49 +01:00
Manuel Stoeckl
a8d802235d write_jpg: remove unnecessary format conversion code 2022-01-20 11:19:49 +01:00
Manuel Stoeckl
e57b8fa7a0 Stop using cairo_status_t 2022-01-20 11:19:49 +01:00
Manuel Stoeckl
6947e6d43d write_jpg: use FILE* in cairo_surface_write_to_jpeg_stream 2022-01-20 11:19:49 +01:00
Manuel Stoeckl
c608cf08da write_ppm: use FILE* in cairo_surface_write_to_ppm_stream 2022-01-20 11:19:49 +01:00
Manuel Stoeckl
4bc093405d Remove unused functions to write image to file 2022-01-20 11:19:49 +01:00
Manuel Stoeckl
6639821e94 Use stream-type functions to save images 2022-01-20 11:19:49 +01:00
Manuel Stoeckl
982d2783b3 Rename cairo_{jpg,ppm} to write_{jpg,ppm} 2022-01-20 11:19:49 +01:00
Manuel Stoeckl
c2e07e5eb8 Use alternate Wayland to Pixman format conversion on big-endian
The Wayland shm formats (almost equivalently, DRM fourcc pixel format
codes) are specified as being little endian, but Pixman's format codes
are generally native-endian. The existing conversions all assume
native=little; this commit introduces format conversions for when
native=big.

Not all DRM/wayland fourcc formats have a big endian pixman_format_code
equivalent, but the most popular (A|X)(RGB|BGR)8888 formats all do.
2022-01-18 13:23:28 +01:00
Manuel Stoeckl
66c4c3a4af render: add support for ≤ 24bpp pixel formats 2022-01-17 14:33:10 +01:00
Jason Nader
b518aac6fd Read XDG_PICTURES_DIR from user-dirs.dirs file
According to the spec, XDG_PICTURES_DIR is an entry in $XDG_CONFIG_HOME/user-dirs.dirs.
This file can be sourced which will set the env var, however it may not always be.
Hence we should read the path from the file rather than trying to get it from the env.

spec: https://www.freedesktop.org/wiki/Software/xdg-user-dirs/
2021-12-23 20:43:46 +01:00
Manuel Stoeckl
d570e13d6f write_png: fix out of bounds read 2021-11-07 09:14:55 +01:00
Manuel Stoeckl
fcaba96aab Allow setting compression level for PNG output
Because cairo_surface_write_to_png does not have a way to configure
the compression level, this change adds code which directly uses
libpng to save images in 'write_png.c'.
2021-10-08 14:12:45 +02:00
Manuel Stoeckl
e658b13d16 render: use convolution filter when downscaling
This fixes a regression from the earlier commit switching from Cairo
to Pixman, where downscaling images inaccurately computed pixel values
in the result.

Now the code uses a convolution filter when downscaling, to get a more
accurate combined color for a downscaled pixel. The 2-lobe Lanczos
filter now used is very close to the Catmull-Rom filter applied by the
CAIRO_FILTER_BEST setting. Downscaling images now runs roughly as
slowly as the Cairo implementation did.

Bilinear filtering is still used for upscaling; while it may not give
results as nice as what Cairo had, rendering quickly becomes even more
important which the screenshot being produced is large.
2021-10-07 12:57:33 +02:00
Manuel Stoeckl
af000f9900 render: use pixman to compose output buffers
The previous code using Cairo ultimately used Pixman to draw the
transformed output buffers onto a common image; switching to use
Pixman directly makes it easier to remove the Cairo dependency in the
future, and increases the number of buffer formats which the
rendering code can directly use.

This change also sometimes speeds up the image rendering, by using
Pixman's OP_SRC composition instead of the slower OP_OVER when we
are guaranteed that an output image will not share pixels with another
output's image when drawn on the common image. Cairo sometimes did
this, but not always.

The rendered images may change very slightly due to the new way of
computing transforms, which has slightly different rounding artifacts.
2021-10-05 09:44:20 +02:00
Oğuz Ersen
f746858ba7 man: fix wrong section headers 2021-08-22 20:54:57 +02:00
Lars Lenckowski
e1cdbf0fdf add bash completion
only check optional deps when the features are enabled
2021-08-13 14:54:40 +02:00
Simon Ser
c7ef385b55 Stop using PATH_MAX
PATH_MAX is usually not reliable.
2021-07-05 14:18:34 +02:00
Simon Ser
a4d6697cb5 Make output_filename const 2021-07-05 14:12:41 +02:00
Simon Ser
2140d00aac Replace sprintf with snprintf
sprintf is dangerous, it's missing bounds checks.

While at it, drop the filepath() function, which had a confusing
name and a single caller.
2021-07-05 14:10:43 +02:00
Simon Ser
0d3fab7e1d Make get_output_dir return value const 2021-07-05 14:07:22 +02:00
Simon Ser
dea954de0a readme: IRC channel moved to Libera Chat 2021-07-04 22:30:08 +02:00
Siavash Askari Nasr
0e677488ad Add example for taking screenshot of active window
Using `swaymsg` and `jq`.
2021-06-03 09:16:20 +02:00
Simon Ser
c860a2473a Bump to v1.3.2 v1.3.2 2021-04-17 19:41:14 +02:00
Simon Ser
070226c012 build: bump to 1.3.2 2021-04-17 19:40:57 +02:00
Érico Rolim
4d94e0b135 main,render: replace assert(false) with abort(). 2021-02-03 00:39:15 +01:00
Simon Ser
2c15b09fa4 Fix 180-degree rotated buffers without Y_INVERT
When the compositor sends a buffer without the Y_INVERT flag, the
resulting image had it rotated by 180 degrees.

References: https://github.com/swaywm/sway/issues/5818
2020-11-17 22:12:04 +01:00
Simon Ser
2278f44477
Remove unnecessary wl_display_dispatch calls 2020-08-24 10:57:53 +02:00
Simon Ser
a5e009a870
Bump to v1.3.1 v1.3.1 2020-07-21 20:11:14 +02:00
Adrian Ratnapala
fd01cf8215
Explain that '.' is grim's final fallback dir
This is a documentation tweak to say that if no filename is given, and no
relevant environment variables are set, grim will write to the current working
directory.
2020-06-22 10:22:16 +02:00
Robin Karlsson
55a6ff24ec fix bufferoverflow in output_filepath 2020-05-21 20:54:02 +02:00
Jason Nader
5d5f0f4390 Improve error message for when supplied region is invalid 2020-05-10 16:41:19 +02:00
Daniel Playfair Cal
8f9d60885c Correct interpretation of output rotation
This fixes grim to treat the rotations as counterclockwise and applied
to the surface. This became necessary because wlroots recently corrected
its rotation similarly in https://github.com/swaywm/wlroots/pull/2023.
2020-04-21 14:16:22 +02:00
Simon Ser
7a55773724
contrib/completions: fix unset datadir variable 2020-03-20 15:23:50 +01:00
Simon Ser
05927ea82b
contrib/completions: fix fish file path 2020-03-20 14:49:28 +01:00
Jason Nader
ba7e55ca1e completions: add missing option 2020-03-20 14:27:03 +01:00
Jason Nader
dc36684d9b Add completions for fish-shell 2020-03-06 18:24:21 +01:00
Gilles Talis
862aeee61f Fix maybe-uninitialized warning
Signed-off-by: Gilles Talis <gilles.talis@gmail.com>
2020-02-10 01:05:43 +01:00
Simon Ser
8f6a654b4a
build: bump version to 1.3.0 v1.3.0 2020-01-16 12:33:31 +01:00