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

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

?? gdk-pixbuf-xlib-render.c

?? linux下電話本所依賴的一些圖形庫
?? C
字號:
/* GdkPixbuf library - Rendering functions * * Copyright (C) 1999 The Free Software Foundation * * Author: Federico Mena-Quintero <federico@gimp.org> * * 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. *//* Trivially ported to Xlib(RGB) by John Harper. */#include <config.h>#include "gdk-pixbuf-private.h"#include "gdk-pixbuf-xlib-private.h"/** * gdk_pixbuf_xlib_render_threshold_alpha: * @pixbuf: A pixbuf. * @bitmap: Bitmap where the bilevel mask will be painted to. * @src_x: Source X coordinate. * @src_y: source Y coordinate. * @dest_x: Destination X coordinate. * @dest_y: Destination Y coordinate. * @width: Width of region to threshold. * @height: Height of region to threshold. * @alpha_threshold: Opacity values below this will be painted as zero; all * other values will be painted as one. * * Takes the opacity values in a rectangular portion of a pixbuf and thresholds * them to produce a bi-level alpha mask that can be used as a clipping mask for * a drawable. * **/voidgdk_pixbuf_xlib_render_threshold_alpha (GdkPixbuf *pixbuf, Pixmap bitmap,					int src_x, int src_y,					int dest_x, int dest_y,					int width, int height,					int alpha_threshold){	GC gc;	XColor color;	int x, y;	guchar *p;	int start, start_status;	int status;	XGCValues gcv;	g_return_if_fail (pixbuf != NULL);	g_return_if_fail (pixbuf->colorspace == GDK_COLORSPACE_RGB);	g_return_if_fail (pixbuf->n_channels == 3 || pixbuf->n_channels == 4);	g_return_if_fail (pixbuf->bits_per_sample == 8);	g_return_if_fail (bitmap != 0);	g_return_if_fail (width >= 0 && height >= 0);	g_return_if_fail (src_x >= 0 && src_x + width <= pixbuf->width);	g_return_if_fail (src_y >= 0 && src_y + height <= pixbuf->height);	g_return_if_fail (alpha_threshold >= 0 && alpha_threshold <= 255);	if (width == 0 || height == 0)		return;	gc = XCreateGC (gdk_pixbuf_dpy, bitmap, 0, &gcv);	if (!pixbuf->has_alpha) {		color.pixel = (alpha_threshold == 255) ? 0 : 1;		XSetForeground (gdk_pixbuf_dpy, gc, color.pixel);		XFillRectangle (gdk_pixbuf_dpy, bitmap, gc,				dest_x, dest_y, width, height);		XFreeGC (gdk_pixbuf_dpy, gc);		return;	}	color.pixel = 0;	XSetForeground (gdk_pixbuf_dpy, gc, color.pixel);	XFillRectangle (gdk_pixbuf_dpy, bitmap, gc,			dest_x, dest_y, width, height);	color.pixel = 1;	XSetForeground (gdk_pixbuf_dpy, gc, color.pixel);	for (y = 0; y < height; y++) {		p = (pixbuf->pixels + (y + src_y) * pixbuf->rowstride + src_x * pixbuf->n_channels		     + pixbuf->n_channels - 1);		start = 0;		start_status = *p < alpha_threshold;		for (x = 0; x < width; x++) {			status = *p < alpha_threshold;			if (status != start_status) {				if (!start_status)					XDrawLine (gdk_pixbuf_dpy, bitmap, gc,						   start + dest_x, y + dest_y,						   x - 1 + dest_x, y + dest_y);				start = x;				start_status = status;			}			p += pixbuf->n_channels;		}		if (!start_status)			XDrawLine (gdk_pixbuf_dpy, bitmap, gc,				   start + dest_x, y + dest_y,				   x - 1 + dest_x, y + dest_y);	}	XFreeGC (gdk_pixbuf_dpy, gc);}/* Creates a buffer by stripping the alpha channel of a pixbuf */static guchar *remove_alpha (GdkPixbuf *pixbuf, int x, int y, int width, int height, int *rowstride){	guchar *buf;	int xx, yy;	guchar *src, *dest;	g_assert (pixbuf->n_channels == 4);	g_assert (pixbuf->has_alpha);	g_assert (width > 0 && height > 0);	g_assert (x >= 0 && x + width <= pixbuf->width);	g_assert (y >= 0 && y + height <= pixbuf->height);	*rowstride = 4 * ((width * 3 + 3) / 4);	buf = g_new (guchar, *rowstride * height);	for (yy = 0; yy < height; yy++) {		src = pixbuf->pixels + pixbuf->rowstride * (yy + y) + x * pixbuf->n_channels;		dest = buf + *rowstride * yy;		for (xx = 0; xx < width; xx++) {			*dest++ = *src++;			*dest++ = *src++;			*dest++ = *src++;			src++;		}	}	return buf;}/** * gdk_pixbuf_xlib_render_to_drawable: * @pixbuf: A pixbuf. * @drawable: Destination drawable. * @gc: GC used for rendering. * @src_x: Source X coordinate within pixbuf. * @src_y: Source Y coordinate within pixbuf. * @dest_x: Destination X coordinate within drawable. * @dest_y: Destination Y coordinate within drawable. * @width: Width of region to render, in pixels. * @height: Height of region to render, in pixels. * @dither: Dithering mode for XlibRGB. * @x_dither: X offset for dither. * @y_dither: Y offset for dither. * * Renders a rectangular portion of a pixbuf to a drawable while using the * specified GC.  This is done using XlibRGB, so the specified drawable must * have the XlibRGB visual and colormap.  Note that this function will ignore * the opacity information for images with an alpha channel; the GC must already * have the clipping mask set if you want transparent regions to show through. * * For an explanation of dither offsets, see the XlibRGB documentation.  In * brief, the dither offset is important when re-rendering partial regions of an * image to a rendered version of the full image, or for when the offsets to a * base position change, as in scrolling.  The dither matrix has to be shifted * for consistent visual results.  If you do not have any of these cases, the * dither offsets can be both zero. **/voidgdk_pixbuf_xlib_render_to_drawable (GdkPixbuf *pixbuf,				    Drawable drawable, GC gc,				    int src_x, int src_y,				    int dest_x, int dest_y,				    int width, int height,				    XlibRgbDither dither,				    int x_dither, int y_dither){	guchar *buf;	int rowstride;	g_return_if_fail (pixbuf != NULL);	g_return_if_fail (pixbuf->colorspace == GDK_COLORSPACE_RGB);	g_return_if_fail (pixbuf->n_channels == 3 || pixbuf->n_channels == 4);	g_return_if_fail (pixbuf->bits_per_sample == 8);	g_return_if_fail (drawable != 0);	g_return_if_fail (gc != 0);	g_return_if_fail (width >= 0 && height >= 0);	g_return_if_fail (src_x >= 0 && src_x + width <= pixbuf->width);	g_return_if_fail (src_y >= 0 && src_y + height <= pixbuf->height);	if (width == 0 || height == 0)		return;	/* This will have to be modified once we support other image types.	 * Also, GdkRGB does not have gdk_draw_rgb_32_image_dithalign(), so we	 * have to pack the buffer first.  Sigh.	 */	if (pixbuf->has_alpha)		buf = remove_alpha (pixbuf, src_x, src_y, width, height, &rowstride);	else {		buf = pixbuf->pixels + src_y * pixbuf->rowstride + src_x * 3;		rowstride = pixbuf->rowstride;	}	xlib_draw_rgb_image_dithalign (drawable, gc,				       dest_x, dest_y,				       width, height,				       dither,				       buf, rowstride,				       x_dither, y_dither);	if (pixbuf->has_alpha)		g_free (buf);}/** * gdk_pixbuf_xlib_render_to_drawable_alpha: * @pixbuf: A pixbuf. * @drawable: Destination drawable. * @src_x: Source X coordinate within pixbuf. * @src_y: Source Y coordinates within pixbuf. * @dest_x: Destination X coordinate within drawable. * @dest_y: Destination Y coordinate within drawable. * @width: Width of region to render, in pixels. * @height: Height of region to render, in pixels. * @alpha_mode: If the image does not have opacity information, this is ignored. * Otherwise, specifies how to handle transparency when rendering. * @alpha_threshold: If the image does have opacity information and @alpha_mode * is GDK_PIXBUF_ALPHA_BILEVEL, specifies the threshold value for opacity * values. * @dither: Dithering mode for XlibRGB. * @x_dither: X offset for dither. * @y_dither: Y offset for dither. * * Renders a rectangular portion of a pixbuf to a drawable.  This is done using * XlibRGB, so the specified drawable must have the XlibRGB visual and colormap. * * When used with #GDK_PIXBUF_ALPHA_BILEVEL, this function has to create a bitmap * out of the thresholded alpha channel of the image and, it has to set this * bitmap as the clipping mask for the GC used for drawing.  This can be a * significant performance penalty depending on the size and the complexity of * the alpha channel of the image.  If performance is crucial, consider handling * the alpha channel yourself (possibly by caching it in your application) and * using gdk_pixbuf_xlib_render_to_drawable() or GdkRGB directly instead. **/voidgdk_pixbuf_xlib_render_to_drawable_alpha (GdkPixbuf *pixbuf, Drawable drawable,					  int src_x, int src_y,					  int dest_x, int dest_y,					  int width, int height,					  GdkPixbufAlphaMode alpha_mode,					  int alpha_threshold,					  XlibRgbDither dither,					  int x_dither, int y_dither){	Pixmap bitmap = 0;	GC gc;	XGCValues gcv;	g_return_if_fail (pixbuf != NULL);	g_return_if_fail (pixbuf->colorspace == GDK_COLORSPACE_RGB);	g_return_if_fail (pixbuf->n_channels == 3 || pixbuf->n_channels == 4);	g_return_if_fail (pixbuf->bits_per_sample == 8);	g_return_if_fail (drawable != 0);	g_return_if_fail (width >= 0 && height >= 0);	g_return_if_fail (src_x >= 0 && src_x + width <= pixbuf->width);	g_return_if_fail (src_y >= 0 && src_y + height <= pixbuf->height);	if (width == 0 || height == 0)		return;	gc = XCreateGC (gdk_pixbuf_dpy, drawable, 0, &gcv);	if (pixbuf->has_alpha) {		/* Right now we only support GDK_PIXBUF_ALPHA_BILEVEL, so we		 * unconditionally create the clipping mask.		 */		bitmap = XCreatePixmap (gdk_pixbuf_dpy,					RootWindow (gdk_pixbuf_dpy,						    gdk_pixbuf_screen),					width, height, 1);		gdk_pixbuf_xlib_render_threshold_alpha (pixbuf, bitmap,							src_x, src_y,							0, 0,							width, height,							alpha_threshold);		XSetClipMask (gdk_pixbuf_dpy, gc, bitmap);		XSetClipOrigin (gdk_pixbuf_dpy, gc, dest_x, dest_y);	}	gdk_pixbuf_xlib_render_to_drawable (pixbuf, drawable, gc,					    src_x, src_y,					    dest_x, dest_y,					    width, height,					    dither,					    x_dither, y_dither);	if (bitmap)	        XFreePixmap (gdk_pixbuf_dpy, bitmap);	XFreeGC (gdk_pixbuf_dpy, gc);}/** * gdk_pixbuf_xlib_render_pixmap_and_mask: * @pixbuf: A pixbuf. * @pixmap_return: Return value for the created pixmap. * @mask_return: Return value for the created mask. * @alpha_threshold: Threshold value for opacity values. * * Creates a pixmap and a mask bitmap which are returned in the @pixmap_return * and @mask_return arguments, respectively, and renders a pixbuf and its * corresponding tresholded alpha mask to them.  This is merely a convenience * function; applications that need to render pixbufs with dither offsets or to * given drawables should use gdk_pixbuf_xlib_render_to_drawable_alpha() or * gdk_pixbuf_xlib_render_to_drawable(), and * gdk_pixbuf_xlib_render_threshold_alpha(). * * If the pixbuf does not have an alpha channel, then *@mask_return will be set * to None. **/voidgdk_pixbuf_xlib_render_pixmap_and_mask (GdkPixbuf *pixbuf,					Pixmap *pixmap_return,					Pixmap *mask_return,					int alpha_threshold){        g_return_if_fail (pixbuf != NULL);	if (pixmap_return) {		GC gc;		XGCValues gcv;		*pixmap_return = XCreatePixmap (gdk_pixbuf_dpy,						RootWindow (gdk_pixbuf_dpy,							    gdk_pixbuf_screen),						pixbuf->width,						pixbuf->height,						xlib_rgb_get_depth ());		gc = XCreateGC (gdk_pixbuf_dpy, *pixmap_return, 0, &gcv);		gdk_pixbuf_xlib_render_to_drawable (pixbuf, *pixmap_return, gc,						    0, 0, 0, 0,						    pixbuf->width,						    pixbuf->height,						    XLIB_RGB_DITHER_NORMAL,						    0, 0);		XFreeGC (gdk_pixbuf_dpy, gc);	}	if (mask_return) {		if (pixbuf->has_alpha) {		    *mask_return = XCreatePixmap (gdk_pixbuf_dpy,						  RootWindow (gdk_pixbuf_dpy,							      gdk_pixbuf_screen),						  pixbuf->width,						  pixbuf->height, 1);		    gdk_pixbuf_xlib_render_threshold_alpha (pixbuf,							    *mask_return,							    0, 0, 0, 0,							    pixbuf->width,							    pixbuf->height,							    alpha_threshold);		} else			*mask_return = 0;	}}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美专区亚洲专区| 成人动漫一区二区| 久久免费午夜影院| 欧美日韩免费一区二区三区视频| 国产91精品一区二区麻豆网站| 国产不卡视频一区| 日本一区二区在线不卡| 欧美午夜一区二区三区免费大片| 99久久伊人久久99| 午夜精品福利一区二区蜜股av | 综合激情成人伊人| 久久亚区不卡日本| 久久影院电视剧免费观看| 亚洲欧洲三级电影| 国产精品美女一区二区三区| 久久久99精品久久| 国产亚洲综合在线| 亚洲国产另类av| 亚洲午夜激情网页| 国产精一品亚洲二区在线视频| 国内精品国产三级国产a久久| 蜜臀av性久久久久蜜臀aⅴ| 日韩精彩视频在线观看| 成人性生交大片免费看中文网站| 国产一区二区三区美女| 国产精品18久久久| av在线不卡免费看| 欧美成人三级在线| 日韩写真欧美这视频| 91精品国产免费| 精品久久久久久久久久久久包黑料 | 一个色妞综合视频在线观看| 亚洲免费看黄网站| 亚洲第一成人在线| 紧缚捆绑精品一区二区| 成人丝袜高跟foot| 日韩三级中文字幕| 亚洲一区二区三区四区的| 日韩av不卡一区二区| 国内精品久久久久影院薰衣草| 欧美三级视频在线观看| 91精品啪在线观看国产60岁| 日韩成人一级片| 99在线精品一区二区三区| 精品久久久久久最新网址| 亚洲国产精品一区二区久久恐怖片| www.日韩在线| 国产欧美一区二区在线观看| 韩国一区二区视频| 欧美一区二区三区免费视频| 亚洲国产毛片aaaaa无费看 | 国产精品福利av| 亚洲视频电影在线| 成人爽a毛片一区二区免费| 久久综合视频网| 国产乱人伦偷精品视频不卡| 亚洲国产精品嫩草影院| 色综合咪咪久久| 欧美艳星brazzers| 亚洲手机成人高清视频| av午夜一区麻豆| 国产精品免费免费| 成人免费毛片片v| 国产欧美日韩另类一区| 国产aⅴ综合色| 欧美国产一区二区| 调教+趴+乳夹+国产+精品| 91激情五月电影| 丁香六月综合激情| 7777精品伊人久久久大香线蕉| 亚洲一二三四区| 欧美性欧美巨大黑白大战| 一区二区三区在线播放| 欧美性大战xxxxx久久久| 亚洲国产欧美日韩另类综合| 欧美日韩中文另类| 日韩高清欧美激情| 欧美大片顶级少妇| 亚洲精品美国一| 国产精品综合久久| 久久夜色精品国产噜噜av| 懂色av一区二区在线播放| 中文字幕一区二区三区在线不卡| 99久久综合色| 一区二区三区小说| 欧美剧情电影在线观看完整版免费励志电影| 久久精品网站免费观看| 不卡av免费在线观看| 亚洲精品免费一二三区| 欧美高清视频不卡网| 麻豆91免费看| 亚洲国产电影在线观看| 色哟哟国产精品| 日韩va欧美va亚洲va久久| 久久夜色精品一区| 91在线播放网址| 国产色产综合色产在线视频| 亚洲免费观看高清完整| 日本久久精品电影| 一区二区三区精品在线观看| 欧美日韩午夜影院| 久久成人免费电影| 99久久伊人网影院| 亚洲午夜免费福利视频| 日韩免费视频一区| av资源网一区| 日韩高清不卡在线| 国产午夜精品理论片a级大结局| 99麻豆久久久国产精品免费| 午夜欧美大尺度福利影院在线看| 精品国产一二三| 肉色丝袜一区二区| 久久久久久综合| 日本韩国一区二区| 麻豆91精品视频| 亚洲欧洲日韩综合一区二区| 欧美日韩国产小视频在线观看| 亚洲视频一区二区在线| 在线观看91av| 成人一区在线看| 日本91福利区| 精品欧美一区二区在线观看 | 欧美一区二区三区免费| 成人午夜视频在线观看| 免费成人av资源网| 国产麻豆精品95视频| 亚洲乱码中文字幕综合| 欧美日韩国产在线观看| 成人免费视频视频| 日韩avvvv在线播放| 综合中文字幕亚洲| 精品日韩欧美在线| 欧美三片在线视频观看| 懂色av中文一区二区三区| 喷水一区二区三区| 一区二区三区四区高清精品免费观看 | 亚洲一区二区三区在线播放| 色婷婷香蕉在线一区二区| 国产一区在线观看视频| 亚洲午夜精品网| 国产精品国产馆在线真实露脸 | 亚洲18色成人| ...xxx性欧美| 久久久久久久电影| 日韩欧美亚洲一区二区| 欧美综合一区二区三区| 高清不卡在线观看av| 精品一区二区三区在线播放视频| 亚洲网友自拍偷拍| 成人欧美一区二区三区白人| 久久久亚洲精品一区二区三区| 在线电影欧美成精品| 色婷婷综合激情| 不卡一区二区在线| 国产精品1区2区3区在线观看| 日本在线播放一区二区三区| 亚洲综合清纯丝袜自拍| 1000精品久久久久久久久| 国产欧美日韩一区二区三区在线观看| 制服丝袜在线91| 欧美影院一区二区三区| 一本色道a无线码一区v| 成人福利在线看| 国产成a人亚洲精品| 国产福利一区二区三区在线视频| 蜜臀99久久精品久久久久久软件| 日韩电影一区二区三区| 天堂va蜜桃一区二区三区| 亚洲成人av一区二区| 亚洲国产日韩a在线播放性色| 亚洲综合视频在线观看| 亚洲一区二区三区美女| 亚洲自拍偷拍图区| 亚洲一区二区在线免费观看视频| 一区二区三区高清不卡| 亚洲精品久久嫩草网站秘色| 亚洲女同ⅹxx女同tv| 中文字幕亚洲欧美在线不卡| 国产精品全国免费观看高清| 国产视频一区二区在线| 国产亚洲va综合人人澡精品| 日韩一区二区三区电影| 91精品国产入口| 欧美一卡2卡三卡4卡5免费| 制服丝袜激情欧洲亚洲| 日韩一区二区在线观看视频| 日韩欧美一区二区久久婷婷| 精品捆绑美女sm三区| 精品av综合导航| 久久精品人人做| 中国av一区二区三区| 一区二区中文视频| 艳妇臀荡乳欲伦亚洲一区| 亚洲国产视频一区二区| 丝袜美腿亚洲一区二区图片| 老司机午夜精品99久久| 国产精品主播直播| 99久久婷婷国产综合精品| 色狠狠色狠狠综合| 欧美丰满一区二区免费视频|