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

C++ TRgb类代码示例

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

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



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

示例1: SetPenColor

//Ensure the pen colour is set in the bitmap with the correct alpha blending level
void CTransGc::SetPenColor(const TRgb &aColor)
	{
	TRgb Color = aColor;
	Color.SetAlpha(iAlpha);
	iFbsBitGc.SetPenColor(Color);
	
	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:8,代码来源:TTransGc.cpp


示例2: TRgb

EXPORT_C TRgb ColorUtils::ColorAdjust(TRgb aColor,TInt aPercentage)
/** Brightens or darkens a 24-bit colour by a percentage. 

If the percentage given is less than 100%, a darker colour will be returned. 
The algorithm brightens or darkens each of the R, G and B channels equally.

@param aColor Input colour. 
@param aPercentage Percentage by which to adjust the input colour. 
@return The adjusted colour. */
	{
	// Poor algorithm for the moment, but it can improve and all apps that
	// use this will benefit. (I don't think the accuracy for a 16/256 color system
	// is really relevant anyway)
	TInt red=aColor.Red();
	TInt green=aColor.Green();
	TInt blue=aColor.Blue();
	TInt alpha=aColor.Alpha();
	if (aPercentage<=100)
		{
		red=(red * aPercentage)/100;
		green=(green * aPercentage)/100;
		blue=(blue * aPercentage)/100;
		}
	else
		{
		red = 255 - (((255 - red) * 100) / aPercentage);
		green = 255 - (((255 - green) * 100) / aPercentage);
		blue = 255 - (((255 - blue) * 100) / aPercentage);
		}
	return TRgb(red,green,blue,alpha);
	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:31,代码来源:GULUTIL.CPP


示例3: pixelPosition

unsigned char CameraImage::getPixel(int x, int y) const
{
	TPoint pixelPosition(x,y);
	TRgb color;
    image->GetPixel(color, pixelPosition); 
    return ((color.Red() + color.Green() + color.Blue()) / 3);
}
开发者ID:Androideity,项目名称:Tutorial_ZXingConAndroid,代码行数:7,代码来源:CameraImage.cpp


示例4: Blit

// -----------------------------------------------------------------------------
// Blit
//
// Blits given image to gc.
//
// -----------------------------------------------------------------------------
//
inline static TBool Blit(
    MAknsSkinInstance* aSkin, CBitmapContext& aGc, const TRect& aTrgRect,
    CAknsImageItemData* aImgData, const TAknsItemID& aIID,
    const TAknsBackground* aLayout, const TPoint& aPADelta,
    const TInt aDrawParam )
    {
    CAknsAppSkinInstance* appInstance = 
        static_cast<CAknsAppSkinInstance*>(aSkin);
        
    if ( IsBackgroundItem( aIID,appInstance ) && 
            appInstance && appInstance->AnimBackgroundState() )
        {
        if( (aDrawParam&KAknsDrawParamPrepareOnly) )
            {
            return ETrue;
            }        
        
        TRgb color = KRgbWhite;
        color.SetAlpha(0x00);
        aGc.SetPenColor(color);
        aGc.SetBrushColor(color);
        aGc.SetPenStyle(CGraphicsContext::ESolidPen);
        aGc.SetBrushStyle(CGraphicsContext::ESolidBrush);
        aGc.SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
        TRect layoutRect( aTrgRect );
        if( aLayout )
            {
            layoutRect = aLayout->iRect;
            }
        layoutRect.Move( -aPADelta );

        TRect drawRect = aTrgRect;
        drawRect.Intersection( layoutRect );

        aGc.Clear(drawRect);
        return ETrue;
        }

    TRect layoutRect( aTrgRect );

    const TAknsImageAttributeData* attr = NULL;

    if( aLayout )
        {
        layoutRect = aLayout->iRect;

        if( aLayout->iAttr.iAttributes != EAknsImageAttributeNone )
            {
            attr = &(aLayout->iAttr);
            }
        }

    layoutRect.Move( -aPADelta );

    TRect drawRect(aTrgRect);
    drawRect.Intersection( layoutRect );

    return DrawPartialCachedImage( aSkin, aGc, layoutRect, drawRect,
        aImgData, aIID, attr, aDrawParam );
    }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:67,代码来源:AknsDrawUtils.cpp


示例5: CreateSurface

void CGameImageLoader::CreateSurface()
{
   TSize imagesize = iBitmap->SizeInPixels();

   if (iPixelFormat)
   {
	// the image must be converted to the requested pixel format
	int x, y;
	TRgb pixel;
	TPoint point;

	TRAPD(error, iSurface = new Game::Surface(iPixelFormat, imagesize.iWidth, imagesize.iHeight));

	if( error != KErrNone )
	{
		iErrorCode = error;
		return;
	}

	if (!iSurface)
	{
		iErrorCode = KErrNoMemory;
		return;
	}

	for(y=0; y<imagesize.iHeight; y++)
	for(x=0; x<imagesize.iWidth; x++)
	{
		point.iX = x;
		point.iY = y;
		iBitmap->GetPixel(pixel, point);
		iSurface->setPixel(x, y, iPixelFormat->makePixel(pixel.Red(), pixel.Green(), pixel.Blue()));
	}
   }
   else
   {
	// no pixel conversion required
	Game::PixelFormat bitmapPixelFormat(12);
    Game::Surface tmpSurface(&bitmapPixelFormat, (Game::Pixel*)iBitmap->DataAddress(), imagesize.iWidth, imagesize.iHeight);
	
//	TRAPD(error, iSurface = new Game::Surface(&bitmapPixelFormat, (Game::Pixel*)iBitmap->DataAddress(), imagesize.iWidth, imagesize.iHeight));
	TRAPD(error, iSurface = new Game::Surface(&bitmapPixelFormat, &tmpSurface));

	if( error != KErrNone )
	{
        delete iSurface;
        iSurface = NULL;
		iErrorCode = error;
		return;
	}

	if (!iSurface)
	{
		iErrorCode = KErrNoMemory;
		return;
	}
   }
}
开发者ID:skyostil,项目名称:nspeed,代码行数:58,代码来源:gameimageloader.cpp


示例6: SetTransparentBackground

void CButton::SetTransparentBackground(TBool aState)
	{
	TInt alpha;
	if (aState){alpha=0;}
	else {alpha=255;}
	TRgb backgroundColour = KRgbWhite; // for example
	if(KErrNone == iButton->Window().SetTransparencyAlphaChannel())
		{backgroundColour.SetAlpha(alpha);}
	iButton->Window().SetBackgroundColor(backgroundColour);
	}
开发者ID:kolayuk,项目名称:Tap2Screen,代码行数:10,代码来源:Button.cpp


示例7: RWindowGroup

void CWindowMover::ConstructL(MWindowMover* m,QmlApplicationViewer* v,RWsSession* aWs)
    {

    iWinGroup=new (ELeave) RWindowGroup(*aWs);
    iWinGroup->Construct((TUint32)&iWinGroup, EFalse);
    iWinGroup->EnableReceiptOfFocus(EFalse); // Don't capture any key events.
    iWinGroup->SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront+KAddPriority+1);

    CApaWindowGroupName* wn=CApaWindowGroupName::NewL(*aWs);
    wn->SetHidden(ETrue);
    wn->SetSystem(ETrue);
    wn->SetWindowGroupName(*iWinGroup);
    delete wn;

    iCallBack=m;
    viewer=v;
    iDragged=EFalse;
    CreateWindowL(iWinGroup);
    SetPointerCapture(ETrue);
    EnableDragEvents();
    // for transparency
    TRgb backgroundColour = KRgbWhite; // for example
//#ifndef _DEBUG
    if(KErrNone == Window().SetTransparencyAlphaChannel())
        {backgroundColour.SetAlpha(0);}
//#endif
    Window().SetBackgroundColor(backgroundColour);
    //SetSize(TSize(1,1));
    MakeVisible(EFalse);
    SetExtentToWholeScreen();

    settings=new QSettings(KConfigFile,QSettings::IniFormat);

    xAnim=new MyAnimation();
    yAnim=new MyAnimation();
    //QEasingCurve curve=new QEasingCurve(QEasingCurve::OutQuad);
    xAnim->setEasingCurve(QEasingCurve::OutQuad);
    yAnim->setEasingCurve(QEasingCurve::OutQuad);
    xAnim->setDuration(200);
    yAnim->setDuration(200);
    connect(xAnim,SIGNAL(valueChanged(QVariant)),this,SLOT(xAnimChanged(QVariant)));
    connect(yAnim,SIGNAL(valueChanged(QVariant)),this,SLOT(yAnimChanged(QVariant)));
    connect(yAnim,SIGNAL(finished()),this,SLOT(finished()));
    connect(xAnim,SIGNAL(finished()),this,SLOT(finished()));
    iTimer=new QTimer();
    iTimer->setInterval(400);
    iTimer->setSingleShot(false);
    connect(iTimer,SIGNAL(timeout()),this,SLOT(checkLaunchArea()));
    ActivateL();
    int gest=settings->value("settings/gesture").toInt();
    if (gest==0) axisSet=false;
    else if (gest==1) {axisX=1;axisY=0; axisSet=true;}
    else if (gest==2) {axisX=0;axisY=1; axisSet=true;}
    }
开发者ID:kolayuk,项目名称:SwipeUnlock,代码行数:54,代码来源:windowmover.cpp


示例8: RgbToHsl

/**
   Auxilliary function for TestCaseID tbrdrcol-DrawColorCubeBackgroundNow
  
   This method converts a TRgb colour HSL format.
  
 */
THsl ColorConverter::RgbToHsl(TRgb aRgb)
	{
	const TInt r = aRgb.Red();
	const TInt g = aRgb.Green();
	const TInt b = aRgb.Blue();
	
	const TInt cmax = Max(r, Max(g,b));
	const TInt cmin = Min(r, Min(g,b));
	
	TInt h = 0;
	TInt l = (cmax + cmin) >> 1; // Divided with 2
	TInt s = 0;
	
	if (cmax==cmin) 
		{
		s = 0;
		h = 0; // it's really undefined
		} 
	else 
		{
		if ( l < (255/2) )
			{
			s = ((cmax-cmin)*255)/(cmax+cmin);
			}
		else
			{
			s = ((cmax-cmin)*255)/((2*255)-cmax-cmin);
			}
		
		TInt delta = cmax - cmin;
		
		if (r==cmax)
			{
			h = ((g-b)*255) / delta;
			}
		else if (g==cmax)
			{
			h = 2*255 + ((b-r)*255) / delta;
			}
		else
			{
			h = 4*255 + ((r-g)*255) / delta;
			}
		
		h /= 6;
		
		if (h<0)
			{
			h += (1*255);
			}
		}
	
	return THsl(h, s, l);
	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:60,代码来源:tbrdrcol.CPP


示例9: defined

void tst_NativeImageHandleProvider::bitmap()
{
#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_OPENVG)
    QPixmap tmp(10, 20);
    if (tmp.pixmapData()->classId() == QPixmapData::OpenVGClass) {
        BitmapProvider prov;

        // This should fail because of null ptr.
        QPixmap pm = pixmapFromNativeImageHandleProvider(&prov);
        QVERIFY(pm.isNull());
        pm = QPixmap();
        QCOMPARE(prov.refCount, 0);

        prov.bmp = new CFbsBitmap;
        QCOMPARE(prov.bmp->Create(TSize(prov.w, prov.h), EColor16MAP), KErrNone);
        CFbsBitmapDevice *bitmapDevice = CFbsBitmapDevice::NewL(prov.bmp);
        CBitmapContext *bitmapContext = 0;
        QCOMPARE(bitmapDevice->CreateBitmapContext(bitmapContext), KErrNone);
        TRgb symbianColor = TRgb(255, 200, 100);
        bitmapContext->SetBrushColor(symbianColor);
        bitmapContext->Clear();
        delete bitmapContext;
        delete bitmapDevice;

        pm = pixmapFromNativeImageHandleProvider(&prov);
        QVERIFY(!pm.isNull());
        QCOMPARE(pm.width(), prov.w);
        QCOMPARE(pm.height(), prov.h);
        QVERIFY(prov.refCount == 1);
        QImage img = pm.toImage();
        QVERIFY(prov.refCount == 1);
        QRgb pix = img.pixel(QPoint(1, 2));
        QCOMPARE(qRed(pix), symbianColor.Red());
        QCOMPARE(qGreen(pix), symbianColor.Green());
        QCOMPARE(qBlue(pix), symbianColor.Blue());

        pm = QPixmap(); // should result in calling release
        QCOMPARE(prov.refCount, 0);
        delete prov.bmp;
    } else {
         QSKIP("Not openvg", SkipSingle);
    }
#else
    QSKIP("Not applicable", SkipSingle);
#endif
}
开发者ID:RS102839,项目名称:qt,代码行数:46,代码来源:tst_nativeimagehandleprovider.cpp


示例10: UpdateColor

EXPORT_C TInt CWsContainGraphicBitmap::UpdateColor(TRgb aColor)
	{
	if (!iIsReady)
		return KErrNotReady;
	// Send the color the server side
	TBuf8<3> cmd;
	TInt red = aColor.Red();
	TInt green = aColor.Green();
	TInt blue = aColor.Blue();
    //Append the color
	cmd.Append(red);
	cmd.Append(green);
	cmd.Append(blue);
	
	SendMessage(cmd);
	return Flush();
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:17,代码来源:wscontaindrawer.cpp


示例11: new

/**
Compare the window with the bitmap.
@param aScreen The screen device object
@param aBitmap The bitmap object for comparison
@return ETrue if the window and the bitmap is identified. Otherwise return EFalse.
*/
TBool CT_WServGenericpluginStepLoad::CompareDisplayL(CWsScreenDevice* aScreen, CFbsBitmap* aBitmap)
	{
	// Capture window display to bitmap
	CFbsBitmap* screenBitmap = new(ELeave) CFbsBitmap();
	CleanupStack::PushL(screenBitmap);
	User::LeaveIfError(screenBitmap->Create(KWinRect.Size(), iDisplayMode));
	User::LeaveIfError(aScreen->CopyScreenToBitmap(screenBitmap, KWinRect));	
	
	//Compare the window bitmap with the bitmap pass in for comparison
	TBool ret = ETrue;
	
	const TReal KErrorLimit = 0.05;
	
	TInt mismatchedPixels = 0;
	TRgb testWinPix = TRgb(0,0,0,0);
	TRgb checkWinPix = TRgb(0,0,0,0);
	for (TInt x = 0; x < KWinRect.Width(); x++)
		{
		for (TInt y = 0; y < KWinRect.Height(); y++)
			{
			screenBitmap->GetPixel(testWinPix, TPoint(x,y));
			aBitmap->GetPixel(checkWinPix, TPoint(x,y));
			
			//check if there are differeces between test Window colors and check Window colors
			if(((TReal)abs(testWinPix.Red() - checkWinPix.Red())/255) > KErrorLimit || 
					((TReal)abs(testWinPix.Blue() - checkWinPix.Blue())/255) > KErrorLimit || 
					((TReal)abs(testWinPix.Green() - checkWinPix.Green())/255) > KErrorLimit || 
					((TReal)abs(testWinPix.Alpha() - checkWinPix.Alpha())/255) > KErrorLimit)
				{
				mismatchedPixels++;  // -- Useful for debugging
				ret = EFalse;
				break;
				}
			}
		}
	
	/* INFO_PRINTF2(_L("Number of different pixels: %i"), mismatchedPixels); */ // -- Useful for debugging
	

	CleanupStack::PopAndDestroy(screenBitmap);	
	
	
	
	return ret;
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:51,代码来源:t_wservgenericpluginstepload.cpp


示例12: TRgb

/**
Interpolates between the two TRgb values aHi and aLo including alpha channel, with the value aX and the denoinator aN
*/	
TRgb CTe_graphicsperformanceSuiteStepBase::InterpolateColour(TRgb aLo, TRgb aHi, TInt aX, TInt aN)
	{
	TInt y = aN - aX;

	TUint8 a = (TUint8)( (aHi.Alpha()*aX + aLo.Alpha()*y)/aN );
	TUint8 r = (TUint8)( (aHi.Red()*aX + aLo.Red()*y)/aN );
	TUint8 g = (TUint8)( (aHi.Green()*aX + aLo.Green()*y)/aN );
	TUint8 b = (TUint8)( (aHi.Blue()*aX + aLo.Blue()*y)/aN );
	
	return TRgb(r, g, b, a);
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:14,代码来源:te_graphicsperformanceSuiteStepBase.cpp


示例13: minor2Pot

CGameSpriteFrame::CGameSpriteFrame(const TFileName& filename, TUint32 id, const CGameRect& r, CFbsBitmap* loader){

	loader->Load(filename, id, 0);
	
	TInt i,j;
	TInt h = loader->SizeInPixels().iHeight;
	TInt w = loader->SizeInPixels().iWidth;
	
	h = (h<r.h)?h:r.h;
	w = (w<r.w)?w:r.w;
	
	TInt H = minor2Pot(h);
	TInt W = minor2Pot(w);
	
	if(H>W)W=H;
	else H=W;
	
	this->texDim = H;
			 	    	    
	TRgb color;
	TPoint point;
	
	this->pixels = new TUint32[W*H];
		    	    
	for(i=0;i<w;i++){
		for(j=0;j<h;j++){
			point.SetXY(i,j);
			loader->GetPixel(color,point);
			this->pixels[i+j*W] = color.Value();
		}
	}
	
	glGenTextures(1, &(this->texId)); 

	glBindTexture(GL_TEXTURE_2D, this->texId);

	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);

	GLint format = GL_RGBA;

	glTexImage2D(GL_TEXTURE_2D, 0, format, W, H, 0,
	format, GL_UNSIGNED_BYTE, this->pixels);
	
}
开发者ID:Juanma-lach,项目名称:battletamagotchi,代码行数:44,代码来源:CGameSprite.cpp


示例14: BaseConstructL

/**
 * @brief Completes the second phase of Symbian object construction. 
 * Put initialization code that could leave here. 
 */ 
void CTap2CloseAppUi::ConstructL()
	{
	// [[[ begin generated region: do not modify [Generated Contents]
	
	BaseConstructL( EAknEnableSkin  | 
					 EAknEnableMSK ); 
	InitializeContainersL();
	// ]]] end generated region [Generated Contents]
	//CCoeControl
	
	iWinGroup=new (ELeave) RWindowGroup(CEikonEnv::Static()->WsSession());
	iWinGroup->Construct((TUint32)&iWinGroup, EFalse);
	iWinGroup->EnableReceiptOfFocus(EFalse); // Don't capture any key events.
	iWinGroup->SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront);
	
	CApaWindowGroupName* wn=CApaWindowGroupName::NewL(CEikonEnv::Static()->WsSession());
	wn->SetHidden(ETrue);
	wn->SetSystem(ETrue);
	wn->SetWindowGroupName(*iWinGroup);
	delete wn;
	iButton = CAknButton::NewL();
	iButton->ConstructFromResourceL(R_CLOSE_BUTTON);
	iButton->CreateWindowL(iWinGroup);

	TInt scrX=CEikonEnv::Static()->ScreenDevice()->SizeInPixels().iWidth;
	
	TRgb backgroundColour = KRgbWhite; // for example
	if(KErrNone == iButton->Window().SetTransparencyAlphaChannel())
		{backgroundColour.SetAlpha(0);}
	iButton->Window().SetBackgroundColor(backgroundColour);
	
	iButton->SetIconSize(KSize);
	TRect r;
	AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EBatteryPane,r);
	iButton->SetRect(TRect ( TPoint(scrX-KSize.iWidth-r.Width()-5,0),KSize));
	iButton->SetObserver(this);
	iButton->MakeVisible(ETrue);
	iButton->ActivateL();
	
	CEikonEnv::Static()->RootWin().SetOrdinalPosition(-4);
	HideApplicationFromFSW(ETrue);
	
	iObserver=CGroupListObserver::NewL(this);
	}
开发者ID:kolayuk,项目名称:Tap2Close,代码行数:48,代码来源:Tap2CloseAppUi.cpp


示例15: Min

/**
   Auxiliary function for all Test Cases
  
   This method returns a TRgb colour which is a lighter tone of colour aColor.
   
 */
TRgb CSimpleControl::LightRgb(TRgb aColor) const
	{
	TInt value = aColor.Value();

	TInt r = Min(255,((value & 0x000000ff)  ) + 30);
	TInt g = Min(255,((value & 0x0000ff00)  >> 8) + 30);
	TInt b = Min(255,((value & 0x00ff0000)  >> 16) + 30);

	return TRgb(r,g,b);
	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:16,代码来源:tbrdrcol.CPP


示例16: Max

/**
   Auxiliary function for all Test Cases
  
   This method returns a TRgb colour which is a darker tone of colour aColor.
   
 */
TRgb CSimpleControl::DarkRgb(TRgb aColor) const
	{
	TInt value = aColor.Value();

	TInt r = Max(0,((value & 0x000000ff)  ) - 85);
	TInt g = Max(0,((value & 0x0000ff00)  >> 8) - 85);
	TInt b = Max(0,((value & 0x00ff0000)  >> 16) - 85);

	return TRgb(r,g,b);
	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:16,代码来源:tbrdrcol.CPP


示例17: img

void tst_QVolatileImage::fill()
{
    QVolatileImage img(100, 100, QImage::Format_ARGB32_Premultiplied);
    QColor col = QColor(10, 20, 30);
    img.fill(col.rgba());
    QVERIFY(img.imageRef().pixel(1, 1) == col.rgba());
    QVERIFY(img.toImage().pixel(1, 1) == col.rgba());

#ifdef Q_OS_SYMBIAN
    CFbsBitmap *bmp = static_cast<CFbsBitmap *>(img.duplicateNativeImage());
    QVERIFY(bmp);
    TRgb pix;
    bmp->GetPixel(pix, TPoint(1, 1));
    QCOMPARE(pix.Red(), col.red());
    QCOMPARE(pix.Green(), col.green());
    QCOMPARE(pix.Blue(), col.blue());
    delete bmp;
#endif
}
开发者ID:maxxant,项目名称:qt,代码行数:19,代码来源:tst_qvolatileimage.cpp


示例18: mode

EXPORT_C TRgb ColorUtils::RgbDarkerColor(TRgb aRgb, TDisplayMode aMode)
/** Creates a darker color.

@param aRgb The RGB color.
@param aMode The display mode, which indicates the screen output of the colour 
e.g. 256 colour display mode (8 bpp).
@return The darker colour. */
	{
	switch (aMode)
		{
	case EColor256:
		return TRgb::Color256(color256darklutab[aRgb.Color256()]);
	default:
		TInt value = aRgb.Internal();
		TInt b = Max( 0, ((value & 0x000000ff)  ) - KDarkRgbSubtractor );
		TInt g = Max( 0, ((value & 0x0000ff00)  >> 8) - KDarkRgbSubtractor );
		TInt r = Max( 0, ((value & 0x00ff0000)  >> 16) - KDarkRgbSubtractor );
		return TRgb(r,g,b,aRgb.Alpha());
		}
	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:20,代码来源:GULUTIL.CPP


示例19: GetRgbFromConfig

TBool CDataWrapperBase::GetRgbFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TRgb& aResult)
	{
	TBuf<KMaxTestExecuteCommandLength>	tempStore;

	TInt	red;
	tempStore.Format(KFormatEntryField, &aKeyName, &KTagRgbRed);
	TBool	ret=GetIntFromConfig(aSectName, tempStore, red);

	TInt	green;
	tempStore.Format(KFormatEntryField, &aKeyName, &KTagRgbGreen);
	if ( !GetIntFromConfig(aSectName, tempStore, green) )
		{
		ret=EFalse;
		}

	TInt	blue;
	tempStore.Format(KFormatEntryField, &aKeyName, &KTagRgbBlue);
	if ( !GetIntFromConfig(aSectName, tempStore, blue) )
		{
		ret=EFalse;
		}

	if ( ret )
		{
		aResult.SetRed(red);
		aResult.SetGreen(green);
		aResult.SetBlue(blue);

		TInt	alpha;
		tempStore.Format(KFormatEntryField, &aKeyName, &KTagRgbAlpha);
		if ( GetIntFromConfig(aSectName, tempStore, alpha) )
			{
			aResult.SetAlpha(alpha);
			}
		}

	return ret;
	}
开发者ID:fedor4ever,项目名称:default,代码行数:38,代码来源:DataWrapperBase.cpp


示例20: DrawColor

/** If the display mode of iBitmapInfo is not expected, return EFalse
 * or render to the back buffer and returns ETrue
*/
TBool CCommonInterfaces::DrawColor(const TRect& aRect,const TRgb& aColour)
	{
	TRect local = TRect(aRect.iTl-iRect.iTl, aRect.Size());
	TUint16* pBuffer16;
	TUint32* pBuffer32;

	if (iBitmapInfo.iDisplayMode != iDispMode)
		{
		return EFalse;
		}
	for (TInt y = local.iTl.iY; y < local.iBr.iY; y++)
		{
		for (TInt x = local.iTl.iX; x < local.iBr.iX; x++)
			{
			switch (iDispMode)
				{
				case EColor64K:
					pBuffer16 = (TUint16*)iBitmapInfo.iAddress;
					pBuffer16[y*iBitmapInfo.iLinePitch/2+x] = aColour._Color64K();
					break;
				case EColor16M:
					pBuffer16 = (TUint16*)iBitmapInfo.iAddress;
					pBuffer16[y*iBitmapInfo.iLinePitch/2+x] = aColour._Color64K();
					break;
				case EColor16MU:
					pBuffer32 = (TUint32*)iBitmapInfo.iAddress;
					pBuffer32[y*iBitmapInfo.iLinePitch/4+x] = aColour._Color16MU();
					break;
				case EColor16MA:
					pBuffer32 = (TUint32*)iBitmapInfo.iAddress;
					pBuffer32[y*iBitmapInfo.iLinePitch/4+x] = aColour._Color16MA();
					break;
				case EColor4K:
					pBuffer16 = (TUint16*)iBitmapInfo.iAddress;
					pBuffer16[y*iBitmapInfo.iLinePitch/2+x] = aColour._Color4K();
					break;
				case EColor16MAP:
					pBuffer32 = (TUint32*)iBitmapInfo.iAddress;
					pBuffer32[y*iBitmapInfo.iLinePitch/4+x] = aColour._Color16MAP();
					break;
				default:
					break;
				}
			}
		}
	return ETrue;
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:50,代码来源:TDirectScreenBitmap.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ TRnd类代码示例发布时间:2022-05-31
下一篇:
C++ TResourceReader类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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