亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? fl_draw_image.cxx

?? flnx 0.17 是做嵌入linux gui 必備工具箱
?? CXX
?? 第 1 頁 / 共 2 頁
字號:
//// "$Id: fl_draw_image.cxx,v 1.1.1.1 2003/08/07 21:18:41 jasonk Exp $"//// Image drawing routines for the Fast Light Tool Kit (FLTK).//// Copyright 1998-1999 by Bill Spitzak and others.//// This library is free software; you can redistribute it and/or// modify it under the terms of the GNU Library General Public// License as published by the Free Software Foundation; either// version 2 of the License, or (at your option) any later version.//// This library is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU// Library General Public License for more details.//// You should have received a copy of the GNU Library General Public// License along with this library; if not, write to the Free Software// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307// USA.//// Please report all bugs and problems to "fltk-bugs@easysw.com".//// I hope a simple and portable method of drawing color and monochrome// images.  To keep this simple, only a single storage type is// supported: 8 bit unsigned data, byte order RGB, and pixels are// stored packed into rows with the origin at the top-left.  It is// possible to alter the size of pixels with the "delta" argument, to// add alpha or other information per pixel.  It is also possible to// change the origin and direction of the image data by messing with// the "delta" and "linedelta", making them negative, though this may// defeat some of the shortcuts in translating the image for X.#ifdef WIN32#include "fl_draw_image_win32.cxx"#else// A list of assumptions made about the X display:// bits_per_pixel must be one of 8, 16, 24, 32.// scanline_pad must be a power of 2 and greater or equal to 8.// PsuedoColor visuals must have 8 bits_per_pixel (although the depth// may be less than 8).  This is the only limitation that affects any// modern X displays, you can't use 12 or 16 bit colormaps.// The mask bits in TrueColor visuals for each color are// contiguous and have at least one bit of each color.  This// is not checked for.// For 24 and 32 bit visuals there must be at least 8 bits of each color.////////////////////////////////////////////////////////////////#include <FL/Fl.H>#include <FL/fl_draw.H>#include <FL/x.H>#include "Fl_XColor.H"#include <string.h>#ifndef NANO_X //tanghaostatic XImage i;	// template used to pass info to Xstatic int bytes_per_pixel;static int scanline_add;static int scanline_mask;static void (*converter)(const uchar *from, uchar *to, int w, int delta);static void (*mono_converter)(const uchar *from, uchar *to, int w, int delta);static int dir;		// direction-alternatorstatic int ri,gi,bi;	// saved error-diffusion value#if USE_COLORMAP////////////////////////////////////////////////////////////////// 8-bit converter with error diffusion// I make a 16x16x16 cube of the closest colors in the fltk colormap// we could allocate to each of the colors in a 4-bit image.  This is// then used to find the pixel values and actual colors for error diffusion.static uchar cube[16*16*16];// calculate sum-of-squares error between 4-bit index and pixel colors:static int calc_error(int r, int g, int b, int i) {  int t; int s;  t = ((r<<4)+8)-fl_xmap[0][i].r; s = t*t;  t = ((g<<4)+8)-fl_xmap[0][i].g; s += t*t;  t = ((b<<4)+8)-fl_xmap[0][i].b; s += t*t;  return s;}// replace the color stored at a location with a better one:static void improve(uchar *p, int& e, int r, int g, int b, int i) {  if (i < FL_GRAY_RAMP || i > 255) return;  int e1 = calc_error(r,g,b,i);  if (e1 < e) {*p = i; e = e1;}}static int filled_color_cube;static void fill_color_cube() {  filled_color_cube = 1;  int i;  // allocate all the colors in the fltk color cube and gray ramp:  // allocate widely seperated values first so that the bad ones are  // distributed evenly through the colormap:  for (i=0;;) {    fl_xpixel((Fl_Color)(i+FL_COLOR_CUBE));    i = (i+109)%(FL_NUM_RED*FL_NUM_GREEN*FL_NUM_BLUE); if (!i) break;  }  for (i=0;;) {    fl_xpixel((Fl_Color)(i+FL_GRAY_RAMP));    i = (i+7)%FL_NUM_GRAY; if (!i) break;  }  // fill in the 16x16x16 cube:  uchar *p = cube;  for (int r = 0; r<16; r++) {    for (int g = 0; g<16; g++) {      for (int b = 0; b<16; b++, p++) {	// initial try is value from color cube:	Fl_Color i = fl_color_cube(r*FL_NUM_RED/16, g*FL_NUM_GREEN/16,				   b*FL_NUM_BLUE/16);	int e = calc_error(r,g,b,i);	*p = uchar(i);	// try neighbor pixels in the cube to see if they are better:	improve(p,e,r,g,b,i+FL_NUM_RED*FL_NUM_GREEN);	improve(p,e,r,g,b,i-FL_NUM_RED*FL_NUM_GREEN);	improve(p,e,r,g,b,i+FL_NUM_GREEN);	improve(p,e,r,g,b,i-FL_NUM_GREEN);	improve(p,e,r,g,b,i+1);	improve(p,e,r,g,b,i-1);	// try the gray ramp:	i = fl_gray_ramp(g*FL_NUM_GRAY/15);	improve(p,e,r,g,b,i);	improve(p,e,r,g,b,i+1);	improve(p,e,r,g,b,i-1);      }    }  }}static void color8_converter(const uchar *from, uchar *to, int w, int delta) {  if (!filled_color_cube) fill_color_cube();  int r=ri, g=gi, b=bi;  int d, td;  if (dir) {    dir = 0;    from = from+(w-1)*delta;    to = to+(w-1);    d = -delta;    td = -1;  } else {    dir = 1;    d = delta;    td = 1;  }  for (; w--; from += d, to += td) {    r += from[0]; if (r < 0) r = 0; else if (r>255) r = 255;    g += from[1]; if (g < 0) g = 0; else if (g>255) g = 255;    b += from[2]; if (b < 0) b = 0; else if (b>255) b = 255;    Fl_XColor* x = fl_xmap[0] + cube[((r<<4)&0xf00)+(g&0xf0)+(b>>4)];    r -= x->r;    g -= x->g;    b -= x->b;    *to = uchar(x->pixel);  }  ri = r; gi = g; bi = b;}static void mono8_converter(const uchar *from, uchar *to, int w, int delta) {  if (!filled_color_cube) fill_color_cube();  int r=ri;  int d, td;  if (dir) {    dir = 0;    from = from+(w-1)*delta;    to = to+(w-1);    d = -delta;    td = -1;  } else {    dir = 1;    d = delta;    td = 1;  }  for (; w--; from += d, to += td) {    r += from[0]; if (r < 0) r = 0; else if (r>255) r = 255;    Fl_XColor* x = fl_xmap[0] + cube[(r>>4)*0x111];    r -= x->g;    *to = uchar(x->pixel);  }  ri = r;}#endif////////////////////////////////////////////////////////////////// 16 bit TrueColor converters with error diffusion// Cray computers have no 16-bit type, so we use character pointers// (which may be slow)#ifdef U16#define OUTTYPE U16#define OUTSIZE 1#define OUTASSIGN(v) *t = v#else#define OUTTYPE uchar#define OUTSIZE 2#define OUTASSIGN(v) int tt=v; t[0] = uchar(tt>>8); t[1] = uchar(tt)#endifstatic void color16_converter(const uchar *from, uchar *to, int w, int delta) {  OUTTYPE *t = (OUTTYPE *)to;  int d, td;  if (dir) {    dir = 0;    from = from+(w-1)*delta;    t = t+(w-1)*OUTSIZE;    d = -delta;    td = -OUTSIZE;  } else {    dir = 1;    d = delta;    td = OUTSIZE;  }  int r=ri, g=gi, b=bi;  for (; w--; from += d, t += td) {    r = (r&~fl_redmask)  +from[0]; if (r>255) r = 255;    g = (g&~fl_greenmask)+from[1]; if (g>255) g = 255;    b = (b&~fl_bluemask) +from[2]; if (b>255) b = 255;    OUTASSIGN((      ((r&fl_redmask)<<fl_redshift)+      ((g&fl_greenmask)<<fl_greenshift)+      ((b&fl_bluemask)<<fl_blueshift)      ) >> fl_extrashift);  }  ri = r; gi = g; bi = b;}static void mono16_converter(const uchar *from,uchar *to,int w, int delta) {  OUTTYPE *t = (OUTTYPE *)to;  int d, td;  if (dir) {    dir = 0;    from = from+(w-1)*delta;    t = t+(w-1)*OUTSIZE;    d = -delta;    td = -OUTSIZE;  } else {    dir = 1;    d = delta;    td = OUTSIZE;  }  uchar mask = fl_redmask & fl_greenmask & fl_bluemask;  int r=ri;  for (; w--; from += d, t += td) {    r = (r&~mask) + *from; if (r > 255) r = 255;    uchar m = r&mask;    OUTASSIGN((      (m<<fl_redshift)+      (m<<fl_greenshift)+      (m<<fl_blueshift)      ) >> fl_extrashift);  }  ri = r;}// special-case the 5r6g5b layout used by XFree86:static void c565_converter(const uchar *from, uchar *to, int w, int delta) {  OUTTYPE *t = (OUTTYPE *)to;  int d, td;  if (dir) {    dir = 0;    from = from+(w-1)*delta;    t = t+(w-1)*OUTSIZE;    d = -delta;    td = -OUTSIZE;  } else {    dir = 1;    d = delta;    td = OUTSIZE;  }  int r=ri, g=gi, b=bi;  for (; w--; from += d, t += td) {    r = (r&7)+from[0]; if (r>255) r = 255;    g = (g&3)+from[1]; if (g>255) g = 255;    b = (b&7)+from[2]; if (b>255) b = 255;    OUTASSIGN(((r&0xf8)<<8) + ((g&0xfc)<<3) + (b>>3));  }  ri = r; gi = g; bi = b;}static void m565_converter(const uchar *from,uchar *to,int w, int delta) {  OUTTYPE *t = (OUTTYPE *)to;  int d, td;  if (dir) {    dir = 0;    from = from+(w-1)*delta;    t = t+(w-1)*OUTSIZE;    d = -delta;    td = -OUTSIZE;  } else {    dir = 1;    d = delta;    td = OUTSIZE;  }  int r=ri;  for (; w--; from += d, t += td) {    r = (r&7) + *from; if (r > 255) r = 255;    OUTASSIGN((r>>3) * 0x841);  }  ri = r;}////////////////////////////////////////////////////////////////// 24bit TrueColor converters:static void rgb_converter(const uchar *from, uchar *to, int w, int delta) {  int d = delta-3;  for (; w--; from += d) {    *to++ = *from++;    *to++ = *from++;    *to++ = *from++;  }}static void bgr_converter(const uchar *from, uchar *to, int w, int delta) {  for (; w--; from += delta) {    uchar r = from[0];    uchar g = from[1];    *to++ = from[2];    *to++ = g;    *to++ = r;  }}static void rrr_converter(const uchar *from, uchar *to, int w, int delta) {  for (; w--; from += delta) {    *to++ = *from;    *to++ = *from;    *to++ = *from;  }}////////////////////////////////////////////////////////////////// 32bit TrueColor converters on a 32 or 64-bit machine:#ifdef U64#define STORETYPE U64#if WORDS_BIGENDIAN#define INNARDS32(f) \  U64 *t = (U64*)to; \  int w1 = (w+1)/2; \  for (; w1--; from += delta) {U64 i = f; from += delta; *t++ = (i<<32)|(f);}#else#define INNARDS32(f) \  U64 *t = (U64*)to; \  int w1 = (w+1)/2; \  for (; w1--; from += delta) {U64 i=f; from+= delta; *t++ = ((U64)(f)<<32)|i;}#endif#else#define STORETYPE U32#define INNARDS32(f)   U32 *t = (U32*)to; for(; w--; from += delta) *t++ = f;#endifstatic void rgbx_converter(const uchar *from, uchar *to, int w, int delta) {  INNARDS32((unsigned(from[0])<<24)+(from[1]<<16)+(from[2]<<8));}static void xbgr_converter(const uchar *from, uchar *to, int w, int delta) {  INNARDS32((from[0])+(from[1]<<8)+(from[2]<<16));

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕不卡在线播放| 经典三级在线一区| 国产乱码精品1区2区3区| 91麻豆精品在线观看| 欧美r级电影在线观看| 亚洲精品成人a在线观看| 国产很黄免费观看久久| 日韩视频免费观看高清完整版在线观看 | 欧美日韩三级视频| 国产精品丝袜黑色高跟| 老司机午夜精品99久久| 欧美唯美清纯偷拍| 一区二区三区在线视频观看| 国产成人午夜精品5599 | 久久成人精品无人区| 欧美性感一区二区三区| 亚洲美女区一区| 91亚洲午夜精品久久久久久| 中文字幕av一区二区三区免费看 | 欧美一级生活片| 亚洲国产日韩a在线播放| 日本伦理一区二区| 日韩美女视频一区二区| 成人av片在线观看| 国产人久久人人人人爽| 国产精品一卡二卡| 久久久久97国产精华液好用吗| 看国产成人h片视频| 欧美一级在线观看| 免费在线成人网| 日韩欧美中文一区二区| 国产在线国偷精品产拍免费yy| 日韩一级二级三级| 秋霞电影网一区二区| 欧美一二三四区在线| 久久国产婷婷国产香蕉| 日韩免费电影一区| 国产在线一区二区| 中文字幕不卡三区| 欧洲激情一区二区| 首页国产欧美日韩丝袜| 欧美一级片免费看| 精品一区二区av| 国产日韩欧美a| 色综合久久久久综合体| 亚洲国产视频网站| 日韩三级电影网址| 成人毛片在线观看| 一区二区三区在线视频免费| 欧美日韩日本视频| 久久66热偷产精品| 国产精品女主播在线观看| 94-欧美-setu| 日日夜夜精品视频免费| 久久免费视频色| 在线免费观看日本欧美| 美女网站色91| 亚洲女性喷水在线观看一区| 欧美剧情片在线观看| 韩国欧美一区二区| 亚洲欧洲精品天堂一级 | 国产自产高清不卡| 亚洲欧洲av色图| 日韩一区二区免费在线观看| 国产成人在线色| 一区二区三区不卡在线观看| 日韩精品一区二区三区视频| 99国产精品国产精品久久| 日韩av一二三| 国产精品久久久久影院| 日韩欧美一区电影| 91黄色免费版| 国产激情91久久精品导航| 夜夜精品视频一区二区| 国产午夜精品一区二区三区四区| 在线观看日韩毛片| 国产成人午夜视频| 午夜成人免费视频| 亚洲乱码中文字幕综合| 2021中文字幕一区亚洲| 欧美图片一区二区三区| eeuss影院一区二区三区| 青青草原综合久久大伊人精品 | 蜜桃传媒麻豆第一区在线观看| 中文字幕不卡三区| 久久综合色天天久久综合图片| 色一情一伦一子一伦一区| 国产成人av一区二区三区在线观看| 亚洲一级二级三级在线免费观看| 国产欧美一区二区精品忘忧草| 欧美一级日韩一级| 88在线观看91蜜桃国自产| 一本大道久久精品懂色aⅴ| 国产福利一区在线| 国产综合成人久久大片91| 欧美bbbbb| 亚洲网友自拍偷拍| 一区二区三区资源| 亚洲天堂福利av| 国产精品美女久久久久av爽李琼| 久久五月婷婷丁香社区| 欧美精品第1页| 欧美日韩免费高清一区色橹橹 | 欧美v日韩v国产v| 911精品产国品一二三产区| 欧美色综合影院| 色综合咪咪久久| 欧美日韩精品电影| 国产91精品一区二区麻豆亚洲| 狠狠色丁香久久婷婷综| 免费xxxx性欧美18vr| 青青国产91久久久久久 | 日日夜夜精品视频天天综合网| 亚洲国产成人av| 水蜜桃久久夜色精品一区的特点| 亚洲国产一区二区在线播放| 一区二区视频免费在线观看| 亚洲一线二线三线久久久| 一级特黄大欧美久久久| 午夜av一区二区| 免费欧美在线视频| 国内精品国产成人国产三级粉色| 国产一区二区三区黄视频| 国产精品自在在线| 成人动漫av在线| 91久久奴性调教| 欧美男男青年gay1069videost| 欧美日韩成人综合| www日韩大片| 国产精品久久久久一区| 亚洲与欧洲av电影| 日本不卡视频在线| 国产成人精品影院| 色综合久久中文综合久久97| 欧美视频日韩视频在线观看| 在线成人免费观看| 久久日一线二线三线suv| 国产精品私房写真福利视频| 成人欧美一区二区三区视频网页| 亚洲综合在线视频| 人禽交欧美网站| 成人综合在线观看| 欧美一a一片一级一片| 日韩欧美电影在线| 亚洲免费资源在线播放| 久久av老司机精品网站导航| 成人国产精品免费观看动漫| 欧美日免费三级在线| 欧美sm极限捆绑bd| 樱桃国产成人精品视频| av成人免费在线观看| 欧美一级二级三级蜜桃| 18成人在线观看| 美女视频黄频大全不卡视频在线播放 | 亚洲精品一区二区三区99 | 国产亚洲欧美日韩在线一区| 亚洲色图20p| 黑人精品欧美一区二区蜜桃| 91免费看视频| 久久色在线观看| 日韩成人午夜精品| 色综合久久久久久久| 久久亚洲精精品中文字幕早川悠里| 中文字幕亚洲电影| 久久se精品一区二区| 欧美在线观看视频一区二区三区| 国产亚洲一二三区| 日韩激情av在线| 欧美性做爰猛烈叫床潮| 国产精品日韩精品欧美在线| 青青草原综合久久大伊人精品| 日本黄色一区二区| 国产精品免费观看视频| 美女一区二区三区| 欧美精品99久久久**| 综合电影一区二区三区| 粗大黑人巨茎大战欧美成人| 日韩一级欧美一级| 天堂精品中文字幕在线| 久久久久久日产精品| 天天操天天色综合| 欧美性感一类影片在线播放| 国产精品国产精品国产专区不片| 国产精品亚洲视频| 精品国产三级电影在线观看| 日韩电影在线免费看| 欧美性xxxxxxxx| 亚洲专区一二三| 欧美亚洲综合另类| 亚洲男人的天堂网| 在线免费观看日本欧美| 一区二区三区四区在线免费观看| 99久久伊人精品| 中文字幕中文字幕一区| 97se亚洲国产综合自在线| 18成人在线观看| 在线亚洲+欧美+日本专区| 亚洲精品国产品国语在线app| 91蜜桃免费观看视频| 综合在线观看色|