Sponsored Content
Top Forums Programming Xlib - Mapping Pixel Values to RGB Colors Post 302158408 by thebin on Tuesday 15th of January 2008 07:14:32 AM
Old 01-15-2008
Question Xlib - Mapping Pixel Values to RGB Colors

Hi everyone...
I'm working with XLib and I want to find out the pixel value of a particular point on screen and then map it to RGB values. I used XGetImage and XGetPixel to get the pixel value, but how do I get the RGB values of the pixel?
I went through a few XLib manuals, there seems to be no way. Any solution?
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Lowdown on Pixel Script-PHP based

Hi ! Can someone give me the lowdown on the various pixel scripts that are out there...what's the best, what's the cheapest, which will work well on php/mysql systems, etc... I'm currently looking at GPix (http://www.tufat.com/millionpixelscript.php), and similar offerings from ... (0 Replies)
Discussion started by: tufat123
0 Replies

2. UNIX for Advanced & Expert Users

How to create & use a personal rgb.txt

Greetings -- I'm curious as to an effective way for a user (not root) to set-up a supplemental rgb.txt file for personal use on an X11 system. It's easy to set up the rgb.txt file (with only new colors) in my directory, but how can I use it in addition to the standard rgb.txt file. Thanks.... (0 Replies)
Discussion started by: slapshot_paulie
0 Replies

3. Shell Programming and Scripting

[BASH] mapping of values from file line into variables

Hello, I've been struggling with this for some time but can't find a way to do it and I haven't found any other similar thread. I'd like to get the 'fields' in a line from a file into variables in just one command. The file contains data with the next structure:... (4 Replies)
Discussion started by: semaler
4 Replies

4. Shell Programming and Scripting

mapping of values in shell scripting

sample content of file1: SSTY1 2145228348 652011011715140100000002419005432092074 008801726143662 VDZX01 MIO2 008801726143662 SSRTY 2145228349 ... (3 Replies)
Discussion started by: vsachan
3 Replies

5. Programming

Help with mapping two tables and filling the null values

Hi All , I have two tables. I will provide sample data in the tables below. table1: dept_id dept_name rep_id admin_lastname 10 dept of int.medicine Paul 10 dept of int.medicine Frank 20 dept of chemistry Young 20 dept of chemistry Bill 30 school of denistry kaufmann 40... (3 Replies)
Discussion started by: megha2525
3 Replies

6. Shell Programming and Scripting

Creating unique mapping from multiple mapping

Hello, I do not know if this is the right title to use. I have a large dictionary database which has the following structure: where a b c d e are in English and p q r s t are in a target language., the two separated by the delimiter =. What I am looking for is a perl script which will take... (5 Replies)
Discussion started by: gimley
5 Replies

7. Shell Programming and Scripting

awk (or) UNIX random RGB colors generator?

Dear UNIX Friends, I was wondering if there is a random RGB color generator or any function in any unix platforms. Please share your ideas. Thanks (2 Replies)
Discussion started by: jacobs.smith
2 Replies

8. Shell Programming and Scripting

Mapping the values of ids of two columns of file1 from file2

I have of two space separated files: ==> File1 <== PT|np_496075.1 st|K92748.1 st|K89648.1 PT|np_001300561.1 PT|np_497284.1 st|K90752.1 st|K90279.1 PT|np_740775.1 PT|np_497749.1 st|K90752.1 st|K92038.1 PT|np_490856.1 PT|np_497284.1 st|K90752.1 st|K88095.1 PT|np_494764.1 ==> File 2 <==... (2 Replies)
Discussion started by: sammy777888
2 Replies
RGBPIX(2)							System Calls Manual							 RGBPIX(2)

NAME
RGB, rgbpix, rdcolmap, wrcolmap - handle color screens SYNOPSIS
#include <u.h> #include <libc.h> #include <libg.h> ulong rgbpix(Bitmap *b, RGB rgb) void rdcolmap(Bitmap *b, RGB *map) void wrcolmap(Bitmap *b, RGB *map) DESCRIPTION
Colors are described by the red, green, and blue light intensities, in an RGB datum: typedef struct RGB { ulong red; ulong green; ulong blue; } RGB; Black is represented by zero in all three positions and white has the maximum unsigned long value in all three positions. Some of the graphics functions, such as point (see bitblt(2)), take a pixel value argument, which is a single unsigned long. For a given bitmap, rgbpix returns the pixel value with a color closest to the color represented by the rgb argument. There is a colormap associated with each Bitmap. A colormap is an array of RGBs, of length 2^(2^ldepth), giving the colors for pixels 0, 1, 2, etc. Rdcolmap reads the colormap for the given bitmap into the provided map, which must have enough space to hold it. Wrcolmap associates the given colormap with the given bitmap, if possible. (The hardware might not allow this.) SOURCE
/sys/src/libg SEE ALSO
graphics(2) BUGS
These functions work only for the screen bitmap. This interface will have to be refined for screens with more than 8 bits per pixel. RGBPIX(2)
All times are GMT -4. The time now is 07:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy