__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
==========================
Understanding fbdev's cmap
==========================
These notes explain how X's dix layer uses fbdev's cmap structures.
- example of relevant structures in fbdev as used for a 3-bit grayscale cmap::
struct fb_var_screeninfo {
.bits_per_pixel = 8,
.grayscale = 1,
.red = { 4, 3, 0 },
.green = { 0, 0, 0 },
.blue = { 0, 0, 0 },
}
struct fb_fix_screeninfo {
.visual = FB_VISUAL_STATIC_PSEUDOCOLOR,
}
for (i = 0; i < 8; i++)
info->cmap.red[i] = (((2*i)+1)*(0xFFFF))/16;
memcpy(info->cmap.green, info->cmap.red, sizeof(u16)*8);
memcpy(info->cmap.blue, info->cmap.red, sizeof(u16)*8);
- X11 apps do something like the following when trying to use grayscale::
for (i=0; i < 8; i++) {
char colorspec[64];
memset(colorspec,0,64);
sprintf(colorspec, "rgb:%x/%x/%x", i*36,i*36,i*36);
if (!XParseColor(outputDisplay, testColormap, colorspec, &wantedColor))
printf("Can't get color %s\n",colorspec);
XAllocColor(outputDisplay, testColormap, &wantedColor);
grays[i] = wantedColor;
}
There's also named equivalents like gray1..x provided you have an rgb.txt.
Somewhere in X's callchain, this results in a call to X code that handles the
colormap. For example, Xfbdev hits the following:
xc-011010/programs/Xserver/dix/colormap.c::
FindBestPixel(pentFirst, size, prgb, channel)
dr = (long) pent->co.local.red - prgb->red;
dg = (long) pent->co.local.green - prgb->green;
db = (long) pent->co.local.blue - prgb->blue;
sq = dr * dr;
UnsignedToBigNum (sq, &sum);
BigNumAdd (&sum, &temp, &sum);
co.local.red are entries that were brought in through FBIOGETCMAP which come
directly from the info->cmap.red that was listed above. The prgb is the rgb
that the app wants to match to. The above code is doing what looks like a least
squares matching function. That's why the cmap entries can't be set to the left
hand side boundaries of a color range.
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| api.rst.gz | File | 3.83 KB | 0644 |
|
| arkfb.rst | File | 2.01 KB | 0644 |
|
| aty128fb.rst | File | 2.21 KB | 0644 |
|
| cirrusfb.rst | File | 2 KB | 0644 |
|
| cmap_xfbdev.rst | File | 1.95 KB | 0644 |
|
| deferred_io.rst | File | 2.99 KB | 0644 |
|
| efifb.rst | File | 2.25 KB | 0644 |
|
| ep93xx-fb.rst.gz | File | 1.7 KB | 0644 |
|
| fbcon.rst.gz | File | 4.54 KB | 0644 |
|
| framebuffer.rst.gz | File | 4.82 KB | 0644 |
|
| gxfb.rst | File | 1.33 KB | 0644 |
|
| index.rst | File | 586 B | 0644 |
|
| intel810.rst.gz | File | 3.49 KB | 0644 |
|
| intelfb.rst | File | 3.77 KB | 0644 |
|
| internals.rst | File | 2.66 KB | 0644 |
|
| lxfb.rst | File | 1.33 KB | 0644 |
|
| matroxfb.rst.gz | File | 7.02 KB | 0644 |
|
| metronomefb.rst | File | 1.96 KB | 0644 |
|
| modedb.rst.gz | File | 3.2 KB | 0644 |
|
| pvr2fb.rst | File | 2.21 KB | 0644 |
|
| pxafb.rst.gz | File | 2.1 KB | 0644 |
|
| s3fb.rst | File | 2.59 KB | 0644 |
|
| sa1100fb.rst | File | 1.37 KB | 0644 |
|
| sh7760fb.rst.gz | File | 1.95 KB | 0644 |
|
| sisfb.rst.gz | File | 2.73 KB | 0644 |
|
| sm501.rst | File | 316 B | 0644 |
|
| sm712fb.rst | File | 858 B | 0644 |
|
| sstfb.rst.gz | File | 3.14 KB | 0644 |
|
| tgafb.rst | File | 2.46 KB | 0644 |
|
| tridentfb.rst | File | 2.78 KB | 0644 |
|
| udlfb.rst.gz | File | 3.12 KB | 0644 |
|
| uvesafb.rst.gz | File | 2.87 KB | 0644 |
|
| vesafb.rst.gz | File | 2.78 KB | 0644 |
|
| viafb.modes.gz | File | 5.03 KB | 0644 |
|
| viafb.rst.gz | File | 3.07 KB | 0644 |
|
| vt8623fb.rst | File | 1.85 KB | 0644 |
|