Thread: Linux Framebuffer Transparency

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User Sir Galahad's Avatar
    Join Date
    Nov 2016
    Location
    The Round Table
    Posts
    277
    If nothing else, transparency could be implemented at a higher level. At the expense of having to use a second buffer of course. Also seems a bit of a drawback, what with the need for sudo privileges to run such an application.

  2. #2
    Registered User
    Join Date
    Apr 2019
    Posts
    121
    Quote Originally Posted by Sir Galahad View Post
    Also seems a bit of a drawback, what with the need for sudo privileges to run such an application.
    I don't require sudo privileges. Normally I start my project with a base template that includes all header files (commented out), a main routine (for checking argument and privileges), and a starting function (in case I just want to dump some code and quickly run it.

    Anyway, I noticed when running my program, that the following was still commented out, meaning I don't need elevated privileges.

    Code:
    /*
    // Check that user is root or that sudo is used.
        if(geteuid() != 0)
        {
            fprintf(stderr, "%s: must be run as root or with 'sudo'\n", program_name);
            exit(EXIT_FAILURE);
        }
    */
    Edit: I don't know if adding my username to the group 'video' made a difference or not though.
    Last edited by Yonut; 04-14-2023 at 01:10 PM. Reason: Afterthought

  3. #3
    Registered User Sir Galahad's Avatar
    Join Date
    Nov 2016
    Location
    The Round Table
    Posts
    277
    Quote Originally Posted by Yonut View Post
    I don't require sudo privileges. Normally I start my project with a base template that includes all header files (commented out), a main routine (for checking argument and privileges), and a starting function (in case I just want to dump some code and quickly run it.

    Anyway, I noticed when running my program, that the following was still commented out, meaning I don't need elevated privileges.

    Code:
    /*
    // Check that user is root or that sudo is used.
        if(geteuid() != 0)
        {
            fprintf(stderr, "%s: must be run as root or with 'sudo'\n", program_name);
            exit(EXIT_FAILURE);
        }
    */
    Edit: I don't know if adding my username to the group 'video' made a difference or not though.

    Well sure if you're running things in "developer mode" (so to speak), why not? I was thinking more in terms of whether or not framebuffers might be a good route for "general application development".

    And yes the "video" group is naturally granted special privileges not available to the average user.

    I did notice that the program you've posted doesn't seem to write anything to the screen. Perchance do you have a more complete working example?

  4. #4
    Registered User
    Join Date
    Apr 2019
    Posts
    121
    Quote Originally Posted by Sir Galahad View Post
    I did notice that the program you've posted doesn't seem to write anything to the screen. Perchance do you have a more complete working example?
    This is a simple example of basic drawing, it should work from the console. When you use xwindows, it won't show the framebuffer I use in my program. Dunno why. But if you can exit xwindows or wayland and go back to the console (tty), it should display a red line. If you're on a tty and it isn't visible, maybe increase the following:
    Code:
    #define SIZE_OF_MARK           4
    Basically this all started from wanting to recreate the digital front cover of the "IT Crowd" dvd. I've got Moss all mapped out, but wanted to add the gradient background. Here is what I'm talking about:
    Linux Framebuffer Transparency-3y5807uroqcgexh8ryxgtquzwr4-jpg

  5. #5
    Registered User Sir Galahad's Avatar
    Join Date
    Nov 2016
    Location
    The Round Table
    Posts
    277
    Quote Originally Posted by Yonut View Post
    This is a simple example of basic drawing, it should work from the console. When you use xwindows, it won't show the framebuffer I use in my program. Dunno why. But if you can exit xwindows or wayland and go back to the console (tty), it should display a red line.
    Ah right, sudo chvt 1 to switch to pure-tty. Program displays just fine. Then sudo chvt 7 to get back to Xorg system. (CTL-ALT-F1/CTL-ALT-F7 also works).


    Quote Originally Posted by Yonut View Post
    Basically this all started from wanting to recreate the digital front cover of the "IT Crowd" dvd. I've got Moss all mapped out, but wanted to add the gradient background. Here is what I'm talking about:
    Again, just do the transparency masking "by hand". Long ago I put together a simple graphics library that did just that, drawing basic shapes with anti-aliasing, alpha channel, etc, all done directly on a chunk of memory. Pretty straight-forward stuff actually.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. framebuffer writing a new clut
    By carl mckenzie in forum C++ Programming
    Replies: 1
    Last Post: 06-13-2011, 10:59 AM
  2. Linux framebuffer
    By thinice16 in forum C Programming
    Replies: 4
    Last Post: 07-02-2008, 08:25 PM
  3. Display a string on Linux Framebuffer console
    By chandra80 in forum Linux Programming
    Replies: 2
    Last Post: 11-08-2005, 02:43 PM
  4. framebuffer implementation
    By v6sa in forum Linux Programming
    Replies: 1
    Last Post: 11-03-2005, 11:02 AM
  5. Linux framebuffer; display an image
    By bludstayne in forum Tech Board
    Replies: 1
    Last Post: 03-29-2004, 02:50 AM

Tags for this Thread