您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ BLUE函数代码示例

51自学网 2021-06-01 19:51:25
  C++
这篇教程C++ BLUE函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中BLUE函数的典型用法代码示例。如果您正苦于以下问题:C++ BLUE函数的具体用法?C++ BLUE怎么用?C++ BLUE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了BLUE函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: compose_over

pixel_t compose_over(pixel_t fg, pixel_t bg){	double mul;	double mul_cmp;	double res_a;	double res_r;	double res_g;	double res_b;	if (ALPHA(bg) == 255) {		res_a = 1;		mul = ((double) ALPHA(fg)) / 255.0;		mul_cmp = 1 - mul;	} else {		double fg_a = ((double) ALPHA(fg)) / 255.0;		double bg_a = ((double) ALPHA(bg)) / 255.0;		res_a = 1 - (1 - fg_a) * (1 - bg_a);		mul = fg_a / res_a;		mul_cmp = 1 - mul;	}	res_r = mul * ((double) RED(fg)) + mul_cmp * ((double) RED(bg));	res_g = mul * ((double) GREEN(fg)) + mul_cmp * ((double) GREEN(bg));	res_b = mul * ((double) BLUE(fg)) + mul_cmp * ((double) BLUE(bg));	return PIXEL((unsigned) (res_a * 255),	    (unsigned) res_r, (unsigned) res_g, (unsigned) res_b);}
开发者ID:jvesely,项目名称:helenos,代码行数:30,


示例2: glEnable

void PointSet::Draw ( float* view_mat, float rad ){	char* dat;	Point* p;	glEnable ( GL_NORMALIZE );		if ( m_Param[PNT_DRAWMODE] == 0 ) {		glLoadMatrixf ( view_mat );		dat = mBuf[0].data;			for (int n = 0; n < NumPoints(); n++) {			p = (Point*) dat;			glPushMatrix ();			glTranslatef ( p->pos.x, p->pos.y, p->pos.z );					glScalef ( 0.2, 0.2, 0.2 );				if(p->type == 0)			glColor4f ( 0.1,0.3,1.0,1.0 );//glColor4f ( RED(p->clr), GRN(p->clr), BLUE(p->clr), ALPH(p->clr) );			else            glColor4f ( RED(p->clr), GRN(p->clr), BLUE(p->clr), 0.0 );			drawSphere ();			glPopMatrix ();					dat += mBuf[0].stride;		}		} else if ( m_Param[PNT_DRAWMODE] == 1 ) {		glLoadMatrixf ( view_mat );		dat = mBuf[0].data;		glBegin ( GL_POINTS );		for (int n=0; n < NumPoints(); n++) {			p = (Point*) dat;			glColor3f ( RED(p->clr), GRN(p->clr), BLUE(p->clr) );						glVertex3f ( p->pos.x, p->pos.y, p->pos.z );						dat += mBuf[0].stride;		}		glEnd ();	}}
开发者ID:lakshmiboorgu,项目名称:SPH_Simulation,代码行数:35,


示例3: rain_init

static intrain_init(video_adapter_t *adp){	video_info_t info;	int i;		if (!vidd_get_info(adp, M_VGA_CG320, &info)) {		scrmode = M_VGA_CG320;	} else if (!vidd_get_info(adp, M_PC98_PEGC640x480, &info)) {		scrmode = M_PC98_PEGC640x480;	} else if (!vidd_get_info(adp, M_PC98_PEGC640x400, &info)) {		scrmode = M_PC98_PEGC640x400;	} else {		log(LOG_NOTICE,		    "%s: the console does not support M_VGA_CG320/n",		    SAVER_NAME);		return (ENODEV);	}		scrw = info.vi_width;	scrh = info.vi_height;	/* intialize the palette */	for (i = 1; i < MAX; i++)		rain_pal[BLUE(i)] = rain_pal[BLUE(i - 1)] + INCREMENT;		return (0);}
开发者ID:coyizumi,项目名称:cs111,代码行数:28,


示例4: ALPHA

ColorARGB GifTranscoder::computeAverage(ColorARGB c1, ColorARGB c2, ColorARGB c3, ColorARGB c4) {    char avgAlpha = (char)(((int) ALPHA(c1) + (int) ALPHA(c2) +                            (int) ALPHA(c3) + (int) ALPHA(c4)) / 4);    char avgRed =   (char)(((int) RED(c1) + (int) RED(c2) +                            (int) RED(c3) + (int) RED(c4)) / 4);    char avgGreen = (char)(((int) GREEN(c1) + (int) GREEN(c2) +                            (int) GREEN(c3) + (int) GREEN(c4)) / 4);    char avgBlue =  (char)(((int) BLUE(c1) + (int) BLUE(c2) +                            (int) BLUE(c3) + (int) BLUE(c4)) / 4);    return MAKE_COLOR_ARGB(avgAlpha, avgRed, avgGreen, avgBlue);}
开发者ID:b-project,项目名称:Messaging,代码行数:11,


示例5: rain_update

static voidrain_update(video_adapter_t *adp){	int i, t;	t = rain_pal[BLUE(MAX)];	for (i = MAX; i > 1; i--)		rain_pal[BLUE(i)] = rain_pal[BLUE(i - 1)];	rain_pal[BLUE(1)] = t;	vidd_load_palette(adp, rain_pal);}
开发者ID:coyizumi,项目名称:cs111,代码行数:11,


示例6: PT_CopyBlend

internal voidPT_CopyBlend(u32 *destPixels, PT_Rect *destRect, u32 destPixelsPerRow,             u32 *srcPixels, PT_Rect *srcRect, u32 srcPixelsPerRow,             u32 *newColor){    // If src and dest rects are not the same size ==> bad things    assert(destRect->w == srcRect->w && destRect->h == srcRect->h);    // For each pixel in the destination rect, alpha blend to it the     // corresponding pixel in the source rect.    // ref: https://en.wikipedia.org/wiki/Alpha_compositing    u32 stopX = destRect->x + destRect->w;    u32 stopY = destRect->y + destRect->h;    for (u32 dstY = destRect->y, srcY = srcRect->y;          dstY < stopY;          dstY++, srcY++) {        for (u32 dstX = destRect->x, srcX = srcRect->x;              dstX < stopX;              dstX++, srcX++) {            u32 srcColor = srcPixels[(srcY * srcPixelsPerRow) + srcX];            u32 *destPixel = &destPixels[(dstY * destPixelsPerRow) + dstX];            u32 destColor = *destPixel;            // Colorize our source pixel before we blend it            srcColor = PT_ColorizePixel(srcColor, *newColor);            if (ALPHA(srcColor) == 0) {                // Source is transparent - so do nothing                continue;            } else if (ALPHA(srcColor) == 255) {                // Just copy the color, no blending necessary                *destPixel = srcColor;            } else {                // Do alpha blending                float srcA = ALPHA(srcColor) / 255.0;                float invSrcA = (1.0 - srcA);                float destA = ALPHA(destColor) / 255.0;                float outAlpha = srcA + (destA * invSrcA);                u8 fRed = ((RED(srcColor) * srcA) + (RED(destColor) * destA * invSrcA)) / outAlpha;                u8 fGreen = ((GREEN(srcColor) * srcA) + (GREEN(destColor) * destA * invSrcA)) / outAlpha;                u8 fBlue = ((BLUE(srcColor) * srcA) + (BLUE(destColor) * destA * invSrcA)) / outAlpha;                u8 fAlpha = outAlpha * 255;                *destPixel = COLOR_FROM_RGBA(fRed, fGreen, fBlue, fAlpha);            }        }    }}
开发者ID:pdetagyos,项目名称:RoguelikeTutorial,代码行数:52,


示例7: hippo_cairo_set_source_rgba32

voidhippo_cairo_set_source_rgba32(cairo_t *cr,                              guint32  color){    /* trying to avoid alpha 255 becoming a double alpha that isn't quite opaque ?     * not sure this is needed.     */    if ((color & 0xff) == 0xff) {        cairo_set_source_rgb(cr, RED(color), GREEN(color), BLUE(color));    } else {        cairo_set_source_rgba(cr, RED(color), GREEN(color), BLUE(color), ALPHA(color));    }}
开发者ID:manoj-makkuboy,项目名称:magnetism,代码行数:13,


示例8: getBilinearInterpolatedPixel

uint32_t getBilinearInterpolatedPixel(const void *pixels, int width, int height, int stride, float x, float y) {	int x1 = (int) x;	int x2 = x1+1;	int y1 = (int) y;	int y2 = y1+1;		uint32_t pixel1 = getPixelRGBA(pixels, stride, x1%width, y1%height);	uint32_t pixel2 = getPixelRGBA(pixels, stride, x2%width, y1%height);	uint32_t pixel3 = getPixelRGBA(pixels, stride ,x1%width, y2%height);	uint32_t pixel4 = getPixelRGBA(pixels, stride, x2%width, y2%height);		int red1 = RED(pixel1);	int green1 = GREEN(pixel1);	int blue1 = BLUE(pixel1);		int red2 = RED(pixel2);	int green2 = GREEN(pixel2);	int blue2 = BLUE(pixel2);		int red3 = RED(pixel3);	int green3 = GREEN(pixel3);	int blue3 = BLUE(pixel3);		int red4 = RED(pixel4);	int green4 = GREEN(pixel4);	int blue4 = BLUE(pixel4);		float w1 = x2-x;	float w2 = x-x1; 		float red1_2 = w1*red1 + w2*red2;	float red2_3 = w1*red3 + w2*red4;		float green1_2 = w1*green1 + w2*green2;	float green2_3 = w1*green3 + w2*green4;		float blue1_2 = w1*blue1 + w2*blue2;	float blue2_3 = w1*blue3 + w2*blue4;		w1 = y2-y;	w2 = y-y1;		int red = (int) (w1*red1_2 + w2*red2_3 + 0.5);	int green = (int) (w1*green1_2 + w2*green2_3 + 0.5);	int blue = (int) (w1*blue1_2 + w2*blue2_3 + 0.5);	return createRGBAPixel(red, green, blue, 0);}
开发者ID:Joisar,项目名称:OpenPanodroid,代码行数:48,


示例9: sprintf

void TermCMD::help(cTerm & t,int argc,char *argv[]){	t<<(GREEN("TermCMD commands:/n"));	cmd_table_t* t_ptr = NULL;	char txt[16];	int k = 0;	do	{		t_ptr = &mCmdTable[k++];		if(!t_ptr->cmd)			break;		if(t_ptr->f)		{			sprintf(txt,"%s %s", t_ptr->cmd, t_ptr->argDesc);			t<<"  "<<t.format("%-10s - ",txt)<<t.format("%s/n",t_ptr->desc);		}		else		{			//this is a caption			t<<t.format(BLUE("%s/n"), t_ptr->cmd);		}	}while(t_ptr->cmd);}
开发者ID:JanusErasmus,项目名称:pump-input-logger,代码行数:27,


示例10: draw2DBox

/*void draw2DBox(int top, int left, int right, int bottom, DWORD colour[4]){	CONTROLVERTEX Vertices[4] =	{		// x, y, z, rhw, colour, tu,tv		{	left,	bottom,		0.0f,	1.0f,	colour[0],	0.0f,	1.0f },		// BL		{	right,	bottom, 0.0f,	1.0f,	colour[2],	1.0f,	1.0f },		// BR		{	left,	top,			0.0f,	1.0f,	colour[1],	0.0f,	0.0f },		// TL		{	right,	top,		0.0f,	1.0f,	colour[3],	1.0f,	0.0f },		// TR	};                                                          		glBegin(GL_TRIANGLE_STRIP);	for (int i = 0; i < 4; )	{			DWORD &c = Vertices[i].diffuse;			float c1[4] ={				((float)RED(c)) / 255.0,			  ((float)GREEN(c)) / 255.0,			  ((float)BLUE(c)) / 255.0,			  ((float)ALPHA(c)) / 255.0			};						glColor4fv(c1);  			glTexCoord2d(Vertices[i].tu0,Vertices[i].tv0);			glVertex3f(Vertices[i].x, Vertices[i].y, Vertices[i].z); 			i++;	}		glEnd();}*/void draw2DBox(float top, float left, float right, float bottom, DWORD colour[4]){	CONTROLVERTEX Vertices[4] =	{		// x, y, z, rhw, colour, tu,tv		{	left,	bottom,		0.0f,	1.0f,	colour[0],	0.0f,	1.0f },		// BL		{	right,	bottom, 0.0f,	1.0f,	colour[2],	1.0f,	1.0f },		// BR		{	left,	top,			0.0f,	1.0f,	colour[1],	0.0f,	0.0f },		// TL		{	right,	top,		0.0f,	1.0f,	colour[3],	1.0f,	0.0f },		// TR	};                                                          		glBegin(GL_TRIANGLE_STRIP);	for (int i = 0; i < 4; )	{			DWORD &c = Vertices[i].diffuse;			float c1[4] ={				((float)RED(c)) / 255.0f,			  ((float)GREEN(c)) / 255.0f,			  ((float)BLUE(c)) / 255.0f,			  ((float)ALPHA(c)) / 255.0f			};						glColor4fv(c1);  			glTexCoord2d(Vertices[i].tu0,Vertices[i].tv0);			glVertex3f(Vertices[i].x, Vertices[i].y, Vertices[i].z); 			i++;	}		glEnd();}
开发者ID:glenritchie,项目名称:assignment,代码行数:58,


示例11: malloc

char *region_of_interest (NEURON_LAYER *nl_input, int x_center, int y_center, int width, int height){	int xi, yi, wi, hi, xo, yo, wo, ho;	NEURON_OUTPUT value;		char * output = malloc(width * height * 3 * sizeof(char));		wi = nl_input->dimentions.x;	hi = nl_input->dimentions.y;		wo = width;	ho = height;		for (yo = 0; yo < ho; yo++)	{		for (xo = 0; xo < wo; xo++)		{						xi = (int) ((double) xo + .5) + x_center - wo/2;			yi = (int) ((double) yo + .5) + y_center - ho/2;						if (xi >= 0 && xi < wi && yi >= 0 && yi < hi)				value = nl_input->neuron_vector[xi + wi * yi].output;			else				value.ival = 0;						output[3 * (yo * wo + xo) + 0] = RED(value.ival);			output[3 * (yo * wo + xo) + 1] = GREEN(value.ival);			output[3 * (yo * wo + xo) + 2] = BLUE(value.ival);		}	}		return output;}
开发者ID:LCAD-UFES,项目名称:MAE,代码行数:33,


示例12: RGB

	bool RGBLinearQuantizationFilter::Apply(til::Image &image) const	{		if (image.GetBitDepth() != til::Image::BPP_32B_R8G8B8) return false;		til::uint32 *image_pixels = reinterpret_cast<til::uint32*>(image.GetPixels());		std::vector<til::byte> palette[3] = { 			std::vector<til::byte>(max(((til::byte)(_palette_quants)),       1), 0x00),			std::vector<til::byte>(max(((til::byte)(_palette_quants >>  8)), 1), 0x00),			std::vector<til::byte>(max(((til::byte)(_palette_quants >> 16)), 1), 0x00)		};		til::byte index[] = { 			static_cast<til::byte>(0x100 / palette[0].size()) + (palette[0].size() % 2 * static_cast<til::byte>(palette[0].size() > 1)), 			static_cast<til::byte>(0x100 / palette[1].size()) + (palette[1].size() % 2 * static_cast<til::byte>(palette[1].size() > 1)), 			static_cast<til::byte>(0x100 / palette[2].size()) + (palette[2].size() % 2 * static_cast<til::byte>(palette[2].size() > 1)) 		};		for(std::vector<til::byte>::size_type i = 0, max = palette[0].size(); i < max; ++i) palette[0][i] = static_cast<til::byte>(i * index[0]);		for(std::vector<til::byte>::size_type i = 0, max = palette[1].size(); i < max; ++i) palette[1][i] = static_cast<til::byte>(i * index[1]);		for(std::vector<til::byte>::size_type i = 0, max = palette[2].size(); i < max; ++i) palette[2][i] = static_cast<til::byte>(i * index[2]);		for (til::uint64 i = 0, max = image.GetWidth() * image.GetHeight(); i < max; ++i)		{			image_pixels[i] = RGB(					palette[0][index[0] == 0x00 ? 0 : RED(image_pixels[i])   / index[0]],					palette[1][index[1] == 0x00 ? 0 : GREEN(image_pixels[i]) / index[1]],					palette[2][index[2] == 0x00 ? 0 : BLUE(image_pixels[i])  / index[2]]				);		}		return true;	}
开发者ID:vrishe,项目名称:image-filtering-dither,代码行数:33,


示例13: draw3DLine

void draw3DLine(float sx, float sy, float sz, float ex, float ey, float ez, DWORD colour){	glLoadIdentity();	/*D3DXMATRIX mat;	D3DXMatrixIdentity(&mat);	g_pd3dDevice->SetTransform( D3DTS_WORLD, &mat );	// Move object*/			DWORD &c = colour;			float c1[4] ={				((float)RED(c)) / 255.0f,			  ((float)GREEN(c)) / 255.0f,			  ((float)BLUE(c)) / 255.0f,			  ((float)ALPHA(c)) / 255.0f			};						glColor4fv(c1);  			glBegin(GL_LINES);//		glColor4f(RED(colour), GREEN(colour), BLUE(colour), ALPHA(colour));  		glVertex3f(sx, sy, sz);		glVertex3f(ex, ey, ez);	glEnd();		/*	#define D3DFVF_LVERTEX (D3DFVF_XYZ|D3DFVF_DIFFUSE)	struct LVERTEX { float x, y, z; DWORD diffuse; };	LVERTEX line[2] = {		{ sx,	sy,	sz,	colour	}, 		{ ex,	ey, ez,	colour	}	};				SetVertexShader( D3DFVF_LVERTEX );	g_pd3dDevice->DrawPrimitiveUP(D3DPT_LINELIST, 2, line, sizeof(LVERTEX));*/}
开发者ID:glenritchie,项目名称:assignment,代码行数:33,


示例14: glBegin

void GEQuad::drawVisual(vector_t unit_size){  float hx, hy, hz;  hx = (this->dimensions.x * unit_size.x) / 2;  hy = (this->dimensions.y * unit_size.y) / 2;  hz = (this->dimensions.z * unit_size.z) / 2;  glBegin(GL_QUADS);  glColor3ub(RED(bg_color), GREEN(bg_color), BLUE(bg_color));  glVertex3f( hx, hy,-hz);  glVertex3f(-hx, hy,-hz);  glVertex3f(-hx, hy, hz);  glVertex3f( hx, hy, hz);  glVertex3f( hx,-hy, hz);  glVertex3f(-hx,-hy, hz);  glVertex3f(-hx,-hy,-hz);  glVertex3f( hx,-hy,-hz);  glVertex3f( hx, hy, hz);  glVertex3f(-hx, hy, hz);  glVertex3f(-hx,-hy, hz);  glVertex3f( hx,-hy, hz);  glVertex3f( hx,-hy,-hz);  glVertex3f(-hx,-hy,-hz);  glVertex3f(-hx, hy,-hz);  glVertex3f( hx, hy,-hz);  glEnd();}
开发者ID:mpato,项目名称:gelfar,代码行数:26,


示例15: compute_gray

/* * Enforces all pixels to grayscale. */void compute_gray(struct jpeg_data *jpeg){        if (jpeg == NULL || jpeg->raw_data == NULL)                return;        uint32_t nb_pixels, pixel;        uint32_t *image = jpeg->raw_data;        uint32_t R, G, B, gray;        /* Compute the buffer size */        if (jpeg->is_plain_image)                nb_pixels = jpeg->width * jpeg->height;        else                nb_pixels = jpeg->mcu.size * jpeg->mcu.nb;        /* Convert each pixel */        for (uint32_t i = 0; i < nb_pixels; i++) {                pixel = image[i];                R = RED(pixel);                G = GREEN(pixel);                B = BLUE(pixel);                gray = (R + G + B) / 3;                image[i] = gray << 16 | gray << 8 | gray;        }}
开发者ID:nejmd,项目名称:JPEG,代码行数:36,


示例16: InitPixelShade

/* * InitPixelShade: *      Fills the PixelShade array with precomputed shades of every possible pixel (32 shades) */void InitPixelShade(void){    int i, j;    int r, g, b;    int dr, dg, db;    const double alpha[32] = { 0.0, 0.03, 0.06, 0.09,                               0.13, 0.17, 0.21, 0.24,                               0.27, 0.31, 0.34, 0.37,                               0.41, 0.44, 0.47, 0.49,                               0.51, 0.53, 0.56, 0.59,                               0.63, 0.66, 0.69, 0.73,                               0.76, 0.79, 0.83, 0.87,                               0.91, 0.94, 0.97, 1.0                             };                                 for (i = 0; i < 32; i++) {        for (j = 0; j < 65536; j++) {            r = RED(j);            g = GREEN(j);            b = BLUE(j);            dr = (int)(r * alpha[i]);            dg = (int)(g * alpha[i]);            db = (int)(b * alpha[i]);            PixelShade[i][j] = RGB16(dr, dg, db);        }    }}
开发者ID:mreiferson,项目名称:hajiworld,代码行数:31,


示例17: omb_draw_rect

void omb_draw_rect(int x, int y, int width, int height, int color){	int i, j;	long int location = 0;	unsigned char alpha = ALPHA(color);	unsigned char red = RED(color);	unsigned char green = GREEN(color);	unsigned char blue = BLUE(color);		for (i = y; i < y + height; i++) {		for (j = x; j < x + width; j++) {						if (i < 0 || j < 0 || i > omb_var_screen_info.yres || j > omb_var_screen_info.xres)				continue;			location = ((j + omb_var_screen_info.xoffset) * (omb_var_screen_info.bits_per_pixel / 8)) +				((i + omb_var_screen_info.yoffset) * omb_fix_screen_info.line_length);			*(omb_fb_map + location) = blue;			*(omb_fb_map + location + 1) = green;			*(omb_fb_map + location + 2) = red;			*(omb_fb_map + location + 3) = alpha;		}	}}
开发者ID:athoik,项目名称:openmultiboot,代码行数:25,


示例18: RED

void ColorQuantizer::shrink(cube_t *cube){    byte    r, g, b;    word    i,color;    cube->rmin = 255;    cube->rmax = 0;    cube->gmin = 255;    cube->gmax = 0;    cube->bmin = 255;    cube->bmax = 0;    for (i = cube->lower; i <= cube->upper; i++)    {        color = histPtr[i];        r = RED(color);        if (r > cube->rmax) cube->rmax = r;        if (r < cube->rmin) cube->rmin = r;        g = GREEN(color);        if (g > cube->gmax) cube->gmax = g;        if (g < cube->gmin) cube->gmin = g;        b = BLUE(color);        if (b > cube->bmax) cube->bmax = b;        if (b < cube->bmin) cube->bmin = b;    }}
开发者ID:abellgithub,项目名称:PRC,代码行数:25,


示例19: BndStrg_SetInfFlags

INT BndStrg_SetInfFlags(PRTMP_ADAPTER pAd, PBND_STRG_CLI_TABLE table, BOOLEAN bInfReady){	INT ret_val = BND_STRG_SUCCESS;	BNDSTRG_MSG msg;	if (WMODE_CAP_5G(pAd->CommonCfg.PhyMode) &&		(table->b5GInfReady ^ bInfReady))	{		table->b5GInfReady = bInfReady;		msg.Action = INF_STATUS_RSP_5G;		msg.b5GInfReady = table->b5GInfReady;		RtmpOSWrielessEventSend(			pAd->net_dev,			RT_WLAN_EVENT_CUSTOM,			OID_BNDSTRG_MSG,			NULL,			(UCHAR *)&msg,			sizeof(msg));		BND_STRG_DBGPRINT(RT_DEBUG_OFF,					(BLUE("%s(): BSS (%02x:%02x:%02x:%02x:%02x:%02x)")					 BLUE(" set 5G Inf %s./n")					 , __FUNCTION__, PRINT_MAC(pAd->ApCfg.MBSSID[0].wdev.bssid),					 bInfReady ? "ready" : "not ready"));	}	else if (table->b2GInfReady ^ bInfReady)	{		table->b2GInfReady = bInfReady;		msg.Action = INF_STATUS_RSP_2G;		msg.b2GInfReady = table->b2GInfReady;		RtmpOSWrielessEventSend(			pAd->net_dev,			RT_WLAN_EVENT_CUSTOM,			OID_BNDSTRG_MSG,			NULL,			(UCHAR *)&msg,			sizeof(msg));		BND_STRG_DBGPRINT(RT_DEBUG_OFF,					(BLUE("%s(): BSS (%02x:%02x:%02x:%02x:%02x:%02x)")					 BLUE(" set 2G Inf %s./n")					 , __FUNCTION__, PRINT_MAC(pAd->ApCfg.MBSSID[0].wdev.bssid),					 bInfReady ? "ready" : "not ready"));	}		return ret_val;}
开发者ID:23171580,项目名称:ralink,代码行数:46,


示例20: print_to_file

    void print_to_file(const char * userfile, int lineno, T obj, ADDON addon =                           ADDON()) {        tagset.insert("notag");        (*OS) << DIV("notag") << br << BLUE( obj) << NBSP << CALLINFO << NBSP              << BROWN(addon.getString()) << NBSP << EDIV;        (*OS).flush();    }
开发者ID:rata,项目名称:DLOG,代码行数:8,


示例21: hsv_v_filter

void hsv_v_filter(FILTER_DESC *filter_desc){	// http://en.wikipedia.org/wiki/HSL_and_HSV	// http://cs.haifa.ac.il/hagit/courses/ist/Lectures/Demos/ColorApplet2/t_convert.html		PARAM_LIST *p_list = NULL;	NEURON_LAYER_LIST *n_list = NULL;	NEURON_LAYER *nl_output = NULL, *nl_input = NULL;	int nl_number, p_number;	int xo, yo, wi, hi, wo, ho;	int r, g, b;	// Checks the Neuron Layers Number	for (nl_number = 0, n_list = filter_desc->neuron_layer_list; n_list != NULL; n_list = n_list->next, nl_number++)            	;	// Checks the Parameters Number	for (p_number = 0, p_list = filter_desc->filter_params; p_list != NULL; p_list = p_list->next, p_number++)            	;	if (p_number != 1)	{		Erro ("Error: Wrong number of parameters. The blue_mask_filter must have no parameters.", "", "");		return;	}	// Gets the Input Neuron Layer	nl_input = filter_desc->neuron_layer_list->neuron_layer;	// Gets the Filter Output 	nl_output = filter_desc->output;		// Input-Output width	wi = nl_input->dimentions.x;	hi = nl_input->dimentions.y;	wo = nl_output->dimentions.x;	ho = nl_output->dimentions.y;		if (wi != wo || hi != ho)	{		Erro ("Error: Input and output layers on blue_channel_mask filter must have the same 2D size.", "", "");		return;	}		for (yo = 0; yo < ho; yo++)	{		for (xo = 0; xo < wo; xo++)		{			r = RED(nl_input->neuron_vector[xo + yo * wo].output.ival);			g = GREEN(nl_input->neuron_vector[xo + yo * wo].output.ival);			b = BLUE(nl_input->neuron_vector[xo + yo * wo].output.ival);						nl_output->neuron_vector[xo + yo * wo].output.ival = max_value(r, g, b);		}	}}
开发者ID:ulyssesrr,项目名称:carmen_lcad,代码行数:58,


示例22: sample_rgb

static rgb_color sample_rgb(uint16_t x, uint16_t y) {  RGBQUAD quad;  rgb_color ret;  FreeImage_GetPixelColor(dib,x,y,&quad);  ret.r = RED(&quad);  ret.g = GREEN(&quad);  ret.b = BLUE(&quad);  return ret;}
开发者ID:bpabel,项目名称:knittington,代码行数:9,


示例23: Cr_filter

void Cr_filter(FILTER_DESC *filter_desc){	// http://www.equasys.de/colorconversion.html		PARAM_LIST *p_list = NULL;	NEURON_LAYER_LIST *n_list = NULL;	NEURON_LAYER *nl_output = NULL, *nl_input = NULL;	int nl_number, p_number;	int xo, yo, wi, hi, wo, ho;	double r, g, b;	// Checks the Neuron Layers Number	for (nl_number = 0, n_list = filter_desc->neuron_layer_list; n_list != NULL; n_list = n_list->next, nl_number++)            	;	// Checks the Parameters Number	for (p_number = 0, p_list = filter_desc->filter_params; p_list != NULL; p_list = p_list->next, p_number++)            	;	if (p_number != 1)	{		Erro ("Error: Wrong number of parameters. The blue_mask_filter must have no parameters.", "", "");		return;	}	// Gets the Input Neuron Layer	nl_input = filter_desc->neuron_layer_list->neuron_layer;	// Gets the Filter Output 	nl_output = filter_desc->output;		// Input-Output width	wi = nl_input->dimentions.x;	hi = nl_input->dimentions.y;	wo = nl_output->dimentions.x;	ho = nl_output->dimentions.y;		if (wi != wo || hi != ho)	{		Erro ("Error: Input and output layers on blue_channel_mask filter must have the same 2D size.", "", "");		return;	}		for (yo = 0; yo < ho; yo++)	{		for (xo = 0; xo < wo; xo++)		{			r = (double) RED(nl_input->neuron_vector[xo + yo * wo].output.ival);			g = (double) GREEN(nl_input->neuron_vector[xo + yo * wo].output.ival);			b = (double) BLUE(nl_input->neuron_vector[xo + yo * wo].output.ival);			nl_output->neuron_vector[xo + yo * wo].output.ival = (int) (0.500 * r - 0.419 * g - 0.081 * b + 128.0);		}	}}
开发者ID:ulyssesrr,项目名称:carmen_lcad,代码行数:56,


示例24: rgb565_to_rgb32

uint32 rgb565_to_rgb32(uint16 rgb565){    uint8 r, g, b;    uint32 rgb;    r = (uint8)RED(rgb565);    g = (uint8)GREEN(rgb565);    b = (uint8)BLUE(rgb565);    rgb = (((r << 8) + g) << 8) + b;    return rgb;}
开发者ID:craig-unilectric,项目名称:pdp,代码行数:10,


示例25: scale_area_avg

//scale using area averagingvoid scale_area_avg(struct image* src, struct image* dest){	int m, n, i, j;		for (i = 0; i < dest->height; i++){		for (j = 0; j < dest->width; j++){			int rval = 0, gval = 0, bval = 0;			for (m = i * SCALE_FACTOR; m < (i + 1) * SCALE_FACTOR; m++){				for (n = j * SCALE_FACTOR; n < (j + 1) * SCALE_FACTOR; n++){					rval += RED(src, m, n);					gval += GREEN(src, m, n);					bval += BLUE(src, m, n);				}			}			RED(dest, i, j) = rval / SCALE_FACTOR / SCALE_FACTOR;			GREEN(dest, i, j) = gval / SCALE_FACTOR / SCALE_FACTOR;			BLUE(dest, i, j) = bval / SCALE_FACTOR / SCALE_FACTOR;		}	}}
开发者ID:LaitaStefan,项目名称:labs-2014,代码行数:20,


示例26: omb_draw_rounded_rect

void omb_draw_rounded_rect(int x, int y, int width, int height, int color, int radius){	int i, j;	long int location = 0;	unsigned char alpha = ALPHA(color);	unsigned char red = RED(color);	unsigned char green = GREEN(color);	unsigned char blue = BLUE(color);		for (i = y; i < y + height; i++) {		for (j = x; j < x + width; j++) {			if (i < 0 || j < 0 || i > omb_var_screen_info.yres || j > omb_var_screen_info.xres)				continue;						int relative_x = j - x;			int relative_y = i - y;						// top left corner			if (relative_y < radius && relative_x < radius) {				if (!omb_is_point_inside_circle(relative_x, relative_y, radius)) {					continue;				}			}						// top right corner			else if (relative_y < radius && width - relative_x < radius) {				if (!omb_is_point_inside_circle(width - relative_x, relative_y, radius)) {					continue;				}			}						// bottom left corner			else if (height - relative_y < radius && relative_x < radius) {				if (!omb_is_point_inside_circle(relative_x, height - relative_y, radius)) {					continue;				}			}			// bottom right corner			else if (height - relative_y < radius && width - relative_x < radius) {				if (!omb_is_point_inside_circle(width - relative_x, height - relative_y, radius)) {					continue;				}			}			location = ((j + omb_var_screen_info.xoffset) * (omb_var_screen_info.bits_per_pixel / 8)) +				((i + omb_var_screen_info.yoffset) * omb_fix_screen_info.line_length);			*(omb_fb_map + location) = blue;			*(omb_fb_map + location + 1) = green;			*(omb_fb_map + location + 2) = red;			*(omb_fb_map + location + 3) = alpha;		}	}}
开发者ID:athoik,项目名称:openmultiboot,代码行数:55,


示例27: PT_FillBlend

internal voidPT_FillBlend(u32 *pixels, u32 pixelsPerRow, PT_Rect *destRect, u32 color){    // For each pixel in the destination rect, alpha blend the     // bgColor to the existing color.    // ref: https://en.wikipedia.org/wiki/Alpha_compositing    u32 stopX = destRect->x + destRect->w;    u32 stopY = destRect->y + destRect->h;    // If the color we're trying to blend is transparent, then bail    if (ALPHA(color) == 0) return;    float srcA = ALPHA(color) / 255.0;    float invSrcA = 1.0 - srcA;    // Otherwise, blend each pixel in the dest rect    for (u32 dstY = destRect->y; dstY < stopY; dstY++) {        for (u32 dstX = destRect->x; dstX < stopX; dstX++) {            u32 *pixel = &pixels[(dstY * pixelsPerRow) + dstX];            if (ALPHA(color) == 255) {                // Just copy the color, no blending necessary                *pixel = color;            } else {                // Do alpha blending                u32 pixelColor = *pixel;                float destA = ALPHA(pixelColor) / 255.0;                float outAlpha = srcA + (destA * invSrcA);                u8 fRed = ((RED(color) * srcA) + (RED(pixelColor) * destA * invSrcA)) / outAlpha;                u8 fGreen = ((GREEN(color) * srcA) + (GREEN(pixelColor) * destA * invSrcA)) / outAlpha;                u8 fBlue = ((BLUE(color) * srcA) + (BLUE(pixelColor) * destA * invSrcA)) / outAlpha;                u8 fAlpha = outAlpha * 255;                *pixel = COLOR_FROM_RGBA(fRed, fGreen, fBlue, fAlpha);            }        }    }}
开发者ID:pdetagyos,项目名称:RoguelikeTutorial,代码行数:41,


示例28: switch

int ColorQuantizer::compare(const void *a1, const void *a2){    word color1, color2;    byte c_1, c_2;    color1 = (word)*(word *)a1;    color2 = (word)*(word *)a2;    switch (longdim)    {        case 0:            c_1 = RED(color1), c_2 = RED(color2);            break;        case 1:            c_1 = GREEN(color1), c_2 = GREEN(color2);            break;        case 2:            c_1 = BLUE(color1), c_2 = BLUE(color2);            break;    }    return ((int)(c_1 - c_2));}
开发者ID:abellgithub,项目名称:PRC,代码行数:21,



注:本文中的BLUE函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ BL_ASSERT函数代码示例
C++ BLOCK_START函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。