• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ MAKE_RGB函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: memset

void nubus_procolor816_device::device_reset()
{
	m_count = 0;
	m_clutoffs = 0;
	m_vbl_disable = 1;
	m_mode = 3;
	memset(m_vram, 0, VRAM_SIZE);
	memset(m_palette, 0, sizeof(m_palette));

	m_palette[0] = MAKE_RGB(255, 255, 255);
	m_palette[0x80] = MAKE_RGB(0, 0, 0);
}
开发者ID:AreaScout,项目名称:mame-libretro,代码行数:12,代码来源:pds30_procolor816.c


示例2: palette_set_color

GFXDECODE_END

void lazercmd_state::palette_init()
{
	palette_set_color(machine(), 0, MAKE_RGB(0xb0, 0xb0, 0xb0)); /* white */
	palette_set_color(machine(), 1, MAKE_RGB(0x00, 0x00, 0x00)); /* black */

	palette_set_color(machine(), 2, MAKE_RGB(0x00, 0x00, 0x00)); /* black */
	palette_set_color(machine(), 3, MAKE_RGB(0xb0, 0xb0, 0xb0)); /* white */

	palette_set_color(machine(), 4, MAKE_RGB(0xff, 0xff, 0xff)); /* bright white */
}
开发者ID:Ilgrim,项目名称:MAMEHub,代码行数:12,代码来源:lazercmd.c


示例3: memset

void nubus_radiustpd_device::device_reset()
{
	m_count = 0;
	m_clutoffs = 0;
	m_vbl_disable = 1;
	m_mode = 0;
	memset(m_vram, 0, VRAM_SIZE);
	memset(m_palette, 0, sizeof(m_palette));

	m_palette[1] = MAKE_RGB(255, 255, 255);
	m_palette[0] = MAKE_RGB(0, 0, 0);
}
开发者ID:Ilgrim,项目名称:MAMEHub,代码行数:12,代码来源:nubus_radiustpd.c


示例4: PALETTE_INIT

GFXDECODE_END

static PALETTE_INIT( lazercmd )
{
	palette_set_color(machine, 0, MAKE_RGB(0xb0, 0xb0, 0xb0));	/* white */
	palette_set_color(machine, 1, MAKE_RGB(0x00, 0x00, 0x00));	/* black */

	palette_set_color(machine, 2, MAKE_RGB(0x00, 0x00, 0x00));	/* black */
	palette_set_color(machine, 3, MAKE_RGB(0xb0, 0xb0, 0xb0));	/* white */

	palette_set_color(machine, 4, MAKE_RGB(0xff, 0xff, 0xff));	/* bright white */
}
开发者ID:j4y4r,项目名称:j4ymame,代码行数:12,代码来源:lazercmd.c


示例5: AddDebugBone

void AddDebugBone( const Mth::Vector& p1, const Mth::Vector& p2, float red, float green, float blue )
{
#ifdef	__DEBUG_CODE__
	// GJ:  Pretty much the same as AddDebugLine, but with 
	// a more convenient interface for the skeleton code

	Gfx::AddDebugLine( p1, p2,
					   MAKE_RGB( (int)(red * 255), (int)(green * 255), (int)(blue * 255) ),
					   MAKE_RGB( (int)(red * 255), (int)(green * 255), (int)(blue * 255) ),
					   1 );
#endif
}
开发者ID:basecq,项目名称:thug,代码行数:12,代码来源:debuggfx.cpp


示例6: palette_set_color

INPUT_PORTS_END


/***************************************************************************
    PALETTE
***************************************************************************/

void apricot_state::palette_init()
{
	palette_set_color(machine(), 0, MAKE_RGB(0x00, 0x00, 0x00)); /* black */
	palette_set_color(machine(), 1, MAKE_RGB(0x00, 0x7f, 0x00)); /* low intensity */
	palette_set_color(machine(), 2, MAKE_RGB(0x00, 0xff, 0x00)); /* high intensitiy */
}
开发者ID:CJBass,项目名称:mame2013-libretro,代码行数:13,代码来源:apricot.c


示例7: palette_set_color

INPUT_PORTS_END



//**************************************************************************
//  VIDEO
//**************************************************************************

void portfolio_state::palette_init()
{
	palette_set_color(machine(), 0, MAKE_RGB(138, 146, 148));
	palette_set_color(machine(), 1, MAKE_RGB(92, 83, 88));
}
开发者ID:cyberkni,项目名称:276in1JAMMA,代码行数:13,代码来源:portfoli.c


示例8: PALETTE_INIT

INPUT_PORTS_END


/***************************************************************************
    PALETTE
***************************************************************************/

static PALETTE_INIT( apricot )
{
	palette_set_color(machine, 0, MAKE_RGB(0x00, 0x00, 0x00)); /* black */
	palette_set_color(machine, 1, MAKE_RGB(0x00, 0x7f, 0x00)); /* low intensity */
	palette_set_color(machine, 2, MAKE_RGB(0x00, 0xff, 0x00)); /* high intensitiy */
}
开发者ID:rogerjowett,项目名称:ClientServerMAME,代码行数:13,代码来源:apricot.c


示例9: MAKE_RGB

void uv201_device::initialize_palette()
{
	UINT8 offlointensity = 0x00;
	UINT8 offhiintensity = 0xc0;

	UINT8 onlointensity = 0xa0;
	UINT8 onhiintensity = 0xff;

	for (int i = 0; i < 4; i++)
	{
		int offset = i * 8;
		UINT8 onvalue, offvalue;

		if (offset < 16)
		{
			offvalue = offlointensity;
			onvalue = onlointensity;
		}
		else
		{
			offvalue = offhiintensity;
			onvalue = onhiintensity;
		}

		m_palette[offset + 0] = MAKE_RGB(offvalue, offvalue, offvalue); // black
		m_palette[offset + 1] = MAKE_RGB(onvalue, offvalue, offvalue); // red
		m_palette[offset + 2] = MAKE_RGB(offvalue, onvalue, offvalue); // green
		m_palette[offset + 3] = MAKE_RGB(onvalue, onvalue, offvalue); // red-green
		m_palette[offset + 4] = MAKE_RGB(offvalue, offvalue, onvalue); // blue
		m_palette[offset + 5] = MAKE_RGB(onvalue, offvalue, onvalue); // red-blue
		m_palette[offset + 6] = MAKE_RGB(offvalue, onvalue, onvalue); // green-blue
		m_palette[offset + 7] = MAKE_RGB(onvalue, onvalue, onvalue); // white
	}
}
开发者ID:felipesanches,项目名称:ume,代码行数:34,代码来源:uv201.c


示例10: gfxset_draw_item

static void gfxset_draw_item(running_machine &machine, gfx_element *gfx, int index, bitmap_rgb32 &bitmap, int dstx, int dsty, int color, int rotate)
{
	static const pen_t default_palette[] =
	{
		MAKE_RGB(0,0,0), MAKE_RGB(0,0,255), MAKE_RGB(0,255,0), MAKE_RGB(0,255,255),
		MAKE_RGB(255,0,0), MAKE_RGB(255,0,255), MAKE_RGB(255,255,0), MAKE_RGB(255,255,255)
	};
	int width = (rotate & ORIENTATION_SWAP_XY) ? gfx->height() : gfx->width();
	int height = (rotate & ORIENTATION_SWAP_XY) ? gfx->width() : gfx->height();
	const rgb_t *palette = (machine.total_colors() != 0) ? palette_entry_list_raw(machine.palette) : NULL;
	UINT32 palette_mask = ~0;
	int x, y;

	if (palette != NULL)
		palette += gfx->colorbase() + color * gfx->granularity();
	else
	{
		palette = default_palette;
		palette_mask = 7;
	}

	/* loop over rows in the cell */
	for (y = 0; y < height; y++)
	{
		UINT32 *dest = &bitmap.pix32(dsty + y, dstx);
		const UINT8 *src = gfx->get_data(index);

		/* loop over columns in the cell */
		for (x = 0; x < width; x++)
		{
			int effx = x, effy = y;
			const UINT8 *s;

			/* compute effective x,y values after rotation */
			if (!(rotate & ORIENTATION_SWAP_XY))
			{
				if (rotate & ORIENTATION_FLIP_X)
					effx = gfx->width() - 1 - effx;
				if (rotate & ORIENTATION_FLIP_Y)
					effy = gfx->height() - 1 - effy;
			}
			else
			{
				int temp;
				if (rotate & ORIENTATION_FLIP_X)
					effx = gfx->height() - 1 - effx;
				if (rotate & ORIENTATION_FLIP_Y)
					effy = gfx->width() - 1 - effy;
				temp = effx; effx = effy; effy = temp;
			}

			/* get a pointer to the start of this source row */
			s = src + effy * gfx->rowbytes();

			/* extract the pixel */
			*dest++ = 0xff000000 | palette[s[effx] & palette_mask];
		}
	}
}
开发者ID:AreaScout,项目名称:mame-libretro,代码行数:59,代码来源:uigfx.c


示例11: qt_convert_NV21_to_ARGB32

void qt_convert_NV21_to_ARGB32(const uchar *yuv, quint32 *rgb, int width, int height)
{
    const uchar *y0 = yuv;
    const uchar *y1 = yuv + width;
    const uchar *vu = yuv + width * height;

    quint32 *rgb0 = rgb;
    quint32 *rgb1 = rgb + width;

    for (int i = 0; i < height; i += 2) {
        for (int j = 0; j < width; j += 2) {
            int v = *vu++;
            int u = *vu++;

            int ruv = coefficientsRV[v] >> 15;
            int guv = (coefficientsGU[u] + coefficientsGV[v]) >> 15;
            int buv = coefficientsBU[u] >> 15;

            int y = coefficientsY[*y0++] >> 15;
            int r = y + ruv;
            int g = y + guv;
            int b = y + buv;
            *rgb0++ = MAKE_RGB(r, g, b);

            y = coefficientsY[*y0++] >> 15;
            r = y + ruv;
            g = y + guv;
            b = y + buv;
            *rgb0++ = MAKE_RGB(r, g, b);

            y = coefficientsY[*y1++] >> 15;
            r = y + ruv;
            g = y + guv;
            b = y + buv;
            *rgb1++ = MAKE_RGB(r, g, b);

            y = coefficientsY[*y1++] >> 15;
            r = y + ruv;
            g = y + guv;
            b = y + buv;
            *rgb1++ = MAKE_RGB(r, g, b);
        }

        rgb0 += width;
        rgb1 += width;
        y0 += width;
        y1 += width;
    }
}
开发者ID:MarianMMX,项目名称:MarianMMX,代码行数:49,代码来源:qandroidmultimediautils.cpp


示例12: PALETTE_INIT

INPUT_PORTS_END

//**************************************************************************
//  VIDEO
//**************************************************************************

//-------------------------------------------------
//  PALETTE_INIT( portfolio )
//-------------------------------------------------

static PALETTE_INIT( portfolio )
{
	palette_set_color(machine, 0, MAKE_RGB(138, 146, 148));
	palette_set_color(machine, 1, MAKE_RGB(92, 83, 88));
}
开发者ID:poliva,项目名称:mame-rr,代码行数:15,代码来源:portfoli.c


示例13: memregion

void strnskil_state::palette_init()
{
	const UINT8 *color_prom = memregion("proms")->base();
	int i;

	/* allocate the colortable */
	machine().colortable = colortable_alloc(machine(), 0x100);

	/* create a lookup table for the palette */
	for (i = 0; i < 0x100; i++)
	{
		int r = pal4bit(color_prom[i + 0x000]);
		int g = pal4bit(color_prom[i + 0x100]);
		int b = pal4bit(color_prom[i + 0x200]);

		colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
	}

	/* color_prom now points to the beginning of the lookup table */
	color_prom += 0x300;

	/* sprites lookup table */
	for (i = 0; i < 0x400; i++)
	{
		UINT8 ctabentry = color_prom[i];
		colortable_entry_set_value(machine().colortable, i, ctabentry);
	}
}
开发者ID:cyberkni,项目名称:276in1JAMMA,代码行数:28,代码来源:strnskil.c


示例14: get_safe_token

const pen_t *tlc34076_get_pens(device_t *device)
{
	tlc34076_state *state = get_safe_token(device);
	offs_t i;

	for (i = 0; i < 0x100; i++)
	{
		int r, g, b;

		if ((i & state->regs[PIXEL_READ_MASK]) == i)
		{
			r = state->local_paletteram[3 * i + 0];
			g = state->local_paletteram[3 * i + 1];
			b = state->local_paletteram[3 * i + 2];

			if (state->dacbits == 6)
			{
				r = pal6bit(r);
				g = pal6bit(g);
				b = pal6bit(b);
			}
		}
		else
		{
			r = 0;
			g = 0;
			b = 0;
		}

		state->pens[i] = MAKE_RGB(r, g, b);
	}

	return state->pens;
}
开发者ID:LibXenonProject,项目名称:mame-lx,代码行数:34,代码来源:tlc34076.c


示例15: memregion

/***************************************************************************

  Convert the color PROMs into a more useable format.

  Mat Mania is unusual in that it has both PROMs and RAM to control the
  palette. PROMs are used for characters and background tiles, RAM for
  sprites.
  I don't know for sure how the PROMs are connected to the RGB output,
  but it's probably the usual:

  bit 7 -- 220 ohm resistor  -- GREEN
        -- 470 ohm resistor  -- GREEN
        -- 1  kohm resistor  -- GREEN
        -- 2.2kohm resistor  -- GREEN
        -- 220 ohm resistor  -- RED
        -- 470 ohm resistor  -- RED
        -- 1  kohm resistor  -- RED
  bit 0 -- 2.2kohm resistor  -- RED

  bit 3 -- 220 ohm resistor  -- BLUE
        -- 470 ohm resistor  -- BLUE
        -- 1  kohm resistor  -- BLUE
  bit 0 -- 2.2kohm resistor  -- BLUE

***************************************************************************/
void matmania_state::palette_init()
{
	const UINT8 *color_prom = memregion("proms")->base();
	int i;

	for (i = 0; i < 64; i++)
	{
		int bit0, bit1, bit2, bit3, r, g, b;

		bit0 = BIT(color_prom[0], 0);
		bit1 = BIT(color_prom[0], 1);
		bit2 = BIT(color_prom[0], 2);
		bit3 = BIT(color_prom[0], 3);
		r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
		bit0 = BIT(color_prom[0], 4);
		bit1 = BIT(color_prom[0], 5);
		bit2 = BIT(color_prom[0], 6);
		bit3 = BIT(color_prom[0], 7);
		g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
		bit0 = BIT(color_prom[64], 0);
		bit1 = BIT(color_prom[64], 1);
		bit2 = BIT(color_prom[64], 2);
		bit3 = BIT(color_prom[64], 3);
		b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;

		palette_set_color(machine(),i,MAKE_RGB(r,g,b));
		color_prom++;
	}
}
开发者ID:Ilgrim,项目名称:MAMEHub,代码行数:54,代码来源:matmania.c


示例16: pal6bit

const pen_t *tlc34076_device::get_pens()
{
	offs_t i;

	for (i = 0; i < 0x100; i++)
	{
		int r, g, b;

		if ((i & m_regs[PIXEL_READ_MASK]) == i)
		{
			r = m_local_paletteram[3 * i + 0];
			g = m_local_paletteram[3 * i + 1];
			b = m_local_paletteram[3 * i + 2];

			if (m_dacbits == 6)
			{
				r = pal6bit(r);
				g = pal6bit(g);
				b = pal6bit(b);
			}
		}
		else
		{
			r = 0;
			g = 0;
			b = 0;
		}

		m_pens[i] = MAKE_RGB(r, g, b);
	}

	return m_pens;
}
开发者ID:Ilgrim,项目名称:MAMEHub,代码行数:33,代码来源:tlc34076.c


示例17: TS_DrawText

//绘制文字
void TS_DrawText(IDisplay* pIDisplay, AEEFont nFont, AECHAR* pText, AEERect *rect)
{
	RGBVAL oldColor;
	oldColor = IDISPLAY_SetColor(pIDisplay, CLR_USER_TEXT, MAKE_RGB(255, 255, 255));
	IDISPLAY_DrawText(pIDisplay, nFont, pText, -1, rect->x, rect->y, rect, IDF_TEXT_TRANSPARENT);
	IDISPLAY_SetColor(pIDisplay, CLR_USER_TEXT, oldColor);
}
开发者ID:TopSoup,项目名称:navigate,代码行数:8,代码来源:logicmacro.c


示例18: create_palette_lookup

static void create_palette_lookup(running_machine &machine)
{
	williams_state *state = machine.driver_data<williams_state>();
	static const int resistances_rg[3] = { 1200, 560, 330 };
	static const int resistances_b[2]  = { 560, 330 };
	double weights_r[3], weights_g[3], weights_b[2];
	int i;

	/* compute palette information */
	/* note that there really are pullup/pulldown resistors, but this situation is complicated */
	/* by the use of transistors, so we ignore that and just use the relative resistor weights */
	compute_resistor_weights(0, 255, -1.0,
			3, resistances_rg, weights_r, 0, 0,
			3, resistances_rg, weights_g, 0, 0,
			2, resistances_b,  weights_b, 0, 0);

	/* build a palette lookup */
	state->m_palette_lookup = auto_alloc_array(machine, rgb_t, 256);
	for (i = 0; i < 256; i++)
	{
		int r = combine_3_weights(weights_r, BIT(i,0), BIT(i,1), BIT(i,2));
		int g = combine_3_weights(weights_g, BIT(i,3), BIT(i,4), BIT(i,5));
		int b = combine_2_weights(weights_b, BIT(i,6), BIT(i,7));

		state->m_palette_lookup[i] = MAKE_RGB(r, g, b);
	}
}
开发者ID:clobber,项目名称:UME,代码行数:27,代码来源:williams.c


示例19: palette_normalize_range

void palette_normalize_range(palette_t *palette, UINT32 start, UINT32 end, int lum_min, int lum_max)
{
	UINT32 ymin = 1000 * 255, ymax = 0;
	UINT32 tmin, tmax;
	UINT32 index;

	/* clamp within range */
	start = MAX(start, 0);
	end = MIN(end, palette->numcolors - 1);

	/* find the minimum and maximum brightness of all the colors in the range */
	for (index = start; index <= end; index++)
	{
		rgb_t rgb = palette->entry_color[index];
		UINT32 y = 299 * RGB_RED(rgb) + 587 * RGB_GREEN(rgb) + 114 * RGB_BLUE(rgb);
		ymin = MIN(ymin, y);
		ymax = MAX(ymax, y);
	}

	/* determine target minimum/maximum */
	tmin = (lum_min < 0) ? ((ymin + 500) / 1000) : lum_min;
	tmax = (lum_max < 0) ? ((ymax + 500) / 1000) : lum_max;

	/* now normalize the palette */
	for (index = start; index <= end; index++)
	{
		rgb_t rgb = palette->entry_color[index];
		UINT32 y = 299 * RGB_RED(rgb) + 587 * RGB_GREEN(rgb) + 114 * RGB_BLUE(rgb);
		UINT32 target = tmin + ((y - ymin) * (tmax - tmin + 1)) / (ymax - ymin);
		UINT8 r = (y == 0) ? 0 : rgb_clamp(RGB_RED(rgb) * 1000 * target / y);
		UINT8 g = (y == 0) ? 0 : rgb_clamp(RGB_GREEN(rgb) * 1000 * target / y);
		UINT8 b = (y == 0) ? 0 : rgb_clamp(RGB_BLUE(rgb) * 1000 * target / y);
		palette_entry_set_color(palette, index, MAKE_RGB(r, g, b));
	}
}
开发者ID:nitrologic,项目名称:emu,代码行数:35,代码来源:palette.c


示例20: jal_blend_func

/* basically an add/subtract function with clamping */
static rgb_t jal_blend_func(rgb_t dest, rgb_t addMe, UINT8 alpha)
{
	int r  = (float)RGB_RED  (addMe) ;
	int g  = (float)RGB_GREEN(addMe) ;
	int b  = (float)RGB_BLUE (addMe) ;

	int rd = (float)RGB_RED  (dest) ;
	int gd = (float)RGB_GREEN(dest) ;
	int bd = (float)RGB_BLUE (dest) ;

	int finalR, finalG, finalB ;

	int subR = (alpha & 0x04) >> 2 ;
	int subG = (alpha & 0x02) >> 1 ;
	int subB = (alpha & 0x01) ;

	if (subR) finalR = rd - r ;
	else      finalR = rd + r ;
	if (finalR < 0) finalR = 0 ;
	else if (finalR > 255) finalR = 255 ;


	if (subG) finalG = gd - g ;
	else      finalG = gd + g ;
	if (finalG < 0) finalG = 0 ;
	else if (finalG > 255) finalG = 255 ;


	if (subB) finalB = bd - b ;
	else      finalB = bd + b ;
	if (finalB < 0) finalB = 0 ;
	else if (finalB > 255) finalB = 255 ;

	return MAKE_RGB((UINT8)finalR,(UINT8)finalG,(UINT8)finalB) ;
}
开发者ID:CrouchingLlama,项目名称:openlase-mame,代码行数:36,代码来源:jalblend.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ MAKE_SBDFO函数代码示例发布时间:2022-05-30
下一篇:
C++ MAKE_PTR函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap