screenshot for vt(4)

From: Hiroo Ono <hiroo_at_oikumene.net>
Date: Mon, 03 Jul 2023 15:44:37 UTC
Hello,

I made a patch to enable screenshot with vt(4). The patch is here.
https://reviews.freebsd.org/D40858

I would like to hear comments and reviews if it can be merged to FreeBSD.
When I mentioned it on mastodon, the patch lacked one file, sorry.
Please try this if you want to get the patch in one file.
http://barleycorn.oikumene.net/ports-patch/0001-Implement-screenshot-with-vt-4.patch

There are three types of screenshot.
1. vidcontrol -p text < /dev/ttyv0 > screenshot.txt
   which generate plain text output.
2. vidcontrol -p term < /dev/ttyv0 > screenshot.txt
  which generate text with ansi escape sequences.
3. vidcontrol -p raw < /dev/ttyv0 > screenshot.raw
  which generate a raw picture file.

The raw file can be converted to PNG via separate program.
http://barleycorn.oikumene.net/ports-patch/vtraw2png.tar.gz 
https://helixteamhub.cloud/individual674914/projects/vtraw2png/repositories/vtraw2png/tree/default
It needs libpng (graphics/png).
It only supports 32bit depth, but I think it is enough for vt(4). Sorry if 
I am wrong.

I only tested this patch on i386(vga) and amd64(efifb). The vga fb does not 
support raw output (it does not have vt_fb_ioctl function).

Best regards.