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

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

51自学网 2021-06-03 08:17:02
  C++
这篇教程C++ srcRect函数代码示例写得很实用,希望能帮到您。

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

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

示例1: PLATFORM

void GraphicsContext::drawImage(Image& image, const FloatRect& destination, const ImagePaintingOptions& imagePaintingOptions){#if PLATFORM(IOS)    FloatRect srcRect(FloatPoint(), image.originalSize());#else    FloatRect srcRect(FloatPoint(), image.size());#endif            drawImage(image, destination, srcRect, imagePaintingOptions);}
开发者ID:josedealcala,项目名称:webkit,代码行数:10,


示例2: PLATFORM

void GraphicsContext::drawImage(Image* image, ColorSpace colorSpace, const FloatRect& destination, const ImagePaintingOptions& imagePaintingOptions){    if (!image)        return;    #if PLATFORM(IOS)    FloatRect srcRect(FloatPoint(), image->originalSize());#else    FloatRect srcRect(FloatPoint(), image->size());#endif            drawImage(image, colorSpace, destination, srcRect, imagePaintingOptions);}
开发者ID:chenbk85,项目名称:webkit2-wincairo,代码行数:13,


示例3: srcRect

boolTOSMagnify::CreateImage(BPoint mouseLoc, bool force){	bool created = false;	if (Window() && Window()->Lock()) {		int32 width, height;		fParent->PixelCount(&width, &height);		int32 pixelSize = fParent->PixelSize();		BRect srcRect(0, 0, width - 1, height - 1);		srcRect.OffsetBy(mouseLoc.x - (width / 2),			mouseLoc.y - (height / 2));		if (force || CopyScreenRect(srcRect)) {			srcRect.OffsetTo(BPoint(0, 0));			BRect destRect(Bounds());			DrawBitmap(fBitmap, srcRect, destRect);			DrawGrid(width, height, destRect, pixelSize);			DrawSelection();			Sync();			created = true;		}		Window()->Unlock();	} else		printf("window problem/n");	return created;}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:31,


示例4: srcRect

//===================================================================================================>//bool TiledBackground::draw ( IDXSPRITE spriteobj, const RECT* dstRect ){   //todo sas - not quite right, just yet.  This should NOT stretch to the dstSurface's full size   //           so... if dstRect isn't given... fool it into drawing in same aspect as srcSurface      Rect srcRect( 0, 0, myTiledBgTexture.width(), myTiledBgTexture.height() );   if (dstRect == NULL)       dstRect = &srcRect;   Rect dRect = *dstRect;   //todo: this isn't right.  limit to min's.   dRect.bottom = min( dRect.bottom, srcRect.bottom );   dRect.right  = min( dRect.right, srcRect.right);   //HRESULT hr = myDevice->StretchRect( myTiledBgSurface, NULL, dstSurface, &dRect, D3DTEXF_NONE );   //HRESULT hr = spriteobj->Draw( myTiledBgTexture, NULL, NULL );            //TODO: Need to change locations   D3DXVECTOR3 vPos( 0, 0, 0 );   HRESULT hr = myTiledBgTexture.drawStretch( spriteobj, &srcRect, &dRect );      //drawMySpriteMap( spriteobj );   return SUCCEEDED( hr );  //TODO}
开发者ID:iirlas,项目名称:Game-2332-Repo,代码行数:33,


示例5: srcRect

void BitmapImage::draw(GraphicsContext* context, const FloatRect& dst, const FloatRect& src, CompositeOperator op){    FloatRect srcRect(src);    FloatRect dstRect(dst);    if (dstRect.width() == 0.0f || dstRect.height() == 0.0f ||            srcRect.width() == 0.0f || srcRect.height() == 0.0f)        return;    startAnimation();    cairo_surface_t* image = frameAtIndex(m_currentFrame);    if (!image) // If it's too early we won't have an image yet.        return;    if (mayFillWithSolidColor()) {        fillWithSolidColor(context, dstRect, solidColor(), op);        return;    }    IntSize selfSize = size();    cairo_t* cr = context->platformContext();    cairo_save(cr);    // Set the compositing operation.    if (op == CompositeSourceOver && !frameHasAlphaAtIndex(m_currentFrame))        context->setCompositeOperation(CompositeCopy);    else        context->setCompositeOperation(op);    // If we're drawing a sub portion of the image or scaling then create    // a pattern transformation on the image and draw the transformed pattern.    // Test using example site at http://www.meyerweb.com/eric/css/edge/complexspiral/demo.html    cairo_pattern_t* pattern = cairo_pattern_create_for_surface(image);    // To avoid the unwanted gradient effect (#14017) we use    // CAIRO_FILTER_NEAREST now, but the real fix will be to have    // CAIRO_EXTEND_PAD implemented for surfaces in Cairo allowing us to still    // use bilinear filtering    cairo_pattern_set_filter(pattern, CAIRO_FILTER_NEAREST);    float scaleX = srcRect.width() / dstRect.width();    float scaleY = srcRect.height() / dstRect.height();    cairo_matrix_t matrix = { scaleX, 0, 0, scaleY, srcRect.x(), srcRect.y() };    cairo_pattern_set_matrix(pattern, &matrix);    // Draw the image.    cairo_translate(cr, dstRect.x(), dstRect.y());    cairo_set_source(cr, pattern);    cairo_pattern_destroy(pattern);    cairo_rectangle(cr, 0, 0, dstRect.width(), dstRect.height());    cairo_clip(cr);    cairo_paint_with_alpha(cr, context->getAlpha());    cairo_restore(cr);    if (imageObserver())        imageObserver()->didDraw(this);}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:60,


示例6: savedInfo

void RenderSVGImage::paint(PaintInfo& paintInfo, int, int){    if (paintInfo.context->paintingDisabled() || style()->visibility() == HIDDEN)        return;    paintInfo.context->save();    paintInfo.context->concatCTM(localTransform());    if (paintInfo.phase == PaintPhaseForeground) {        SVGResourceFilter* filter = 0;        PaintInfo savedInfo(paintInfo);        prepareToRenderSVGContent(this, paintInfo, m_localBounds, filter);        FloatRect destRect = m_localBounds;        FloatRect srcRect(0, 0, image()->width(), image()->height());        SVGImageElement* imageElt = static_cast<SVGImageElement*>(node());        if (imageElt->preserveAspectRatio()->align() != SVGPreserveAspectRatio::SVG_PRESERVEASPECTRATIO_NONE)            adjustRectsForAspectRatio(destRect, srcRect, imageElt->preserveAspectRatio());        paintInfo.context->drawImage(image(), destRect, srcRect);        finishRenderSVGContent(this, paintInfo, m_localBounds, filter, savedInfo.context);    }        paintInfo.context->restore();}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:29,


示例7: srcRect

// add the entire signal b to this signal, at the subpixel destination offset. // void MLSignal::add2D(const MLSignal& b, const Vec2& destOffset){	MLSignal& a = *this;			Vec2 iDestOffset, fDestOffset;	destOffset.getIntAndFracParts(iDestOffset, fDestOffset);		int destX = iDestOffset[0];	int destY = iDestOffset[1];		float srcPosFX = fDestOffset[0];	float srcPosFY = fDestOffset[1];		MLRect srcRect(0, 0, b.getWidth() + 1, b.getHeight() + 1); // add (1, 1) for interpolation	MLRect destRect = srcRect.translated(iDestOffset).intersect(getBoundsRect());		for(int j=destRect.top(); j<destRect.bottom(); ++j)	{		for(int i=destRect.left(); i<destRect.right(); ++i)		{			a(i, j) += b.getInterpolatedLinear(i - destX - srcPosFX, j - destY - srcPosFY);		}	}	setConstant(false);}
开发者ID:barnone,项目名称:madronalib,代码行数:27,


示例8: ToOutsideIntRect

voidClientLayerManager::MakeSnapshotIfRequired(){  if (!mShadowTarget) {    return;  }  if (mWidget) {    if (CompositorChild* remoteRenderer = GetRemoteRenderer()) {      nsIntRect bounds = ToOutsideIntRect(mShadowTarget->GetClipExtents());      SurfaceDescriptor inSnapshot;      if (!bounds.IsEmpty() &&          mForwarder->AllocSurfaceDescriptor(bounds.Size().ToIntSize(),                                             gfxContentType::COLOR_ALPHA,                                             &inSnapshot) &&          remoteRenderer->SendMakeSnapshot(inSnapshot, bounds)) {        RefPtr<DataSourceSurface> surf = GetSurfaceForDescriptor(inSnapshot);        DrawTarget* dt = mShadowTarget->GetDrawTarget();        Rect dstRect(bounds.x, bounds.y, bounds.width, bounds.height);        Rect srcRect(0, 0, bounds.width, bounds.height);        dt->DrawSurface(surf, dstRect, srcRect,                        DrawSurfaceOptions(),                        DrawOptions(1.0f, CompositionOp::OP_OVER));      }      mForwarder->DestroySharedSurface(&inSnapshot);    }  }  mShadowTarget = nullptr;}
开发者ID:martasect,项目名称:gecko,代码行数:28,


示例9: drawRect

	void Viewport::_render()	{		april::rendersys->setTextureBlendMode(april::BM_DEFAULT);		grect drawRect(0.0f, 0.0f, (float)this->rect->width, (float)this->rect->height);		grect srcRect(0.0f, 0.0f, 1.0f, 1.0f);		this->_renderTexture(drawRect, srcRect, this->texture, 255);	}
开发者ID:boisei0,项目名称:arcreator,代码行数:7,


示例10: srcRect

void BitmapImage::draw(GraphicsContext* context, const FloatRect& dst, const FloatRect& src, ColorSpace styleColorSpace, CompositeOperator op){    FloatRect srcRect(src);    FloatRect dstRect(dst);    if (dstRect.width() == 0.0f || dstRect.height() == 0.0f ||        srcRect.width() == 0.0f || srcRect.height() == 0.0f)        return;    startAnimation();    cairo_surface_t* image = frameAtIndex(m_currentFrame);    if (!image) // If it's too early we won't have an image yet.        return;    if (mayFillWithSolidColor()) {        fillWithSolidColor(context, dstRect, solidColor(), styleColorSpace, op);        return;    }    context->save();    // Set the compositing operation.    if (op == CompositeSourceOver && !frameHasAlphaAtIndex(m_currentFrame))        context->setCompositeOperation(CompositeCopy);    else        context->setCompositeOperation(op);    context->platformContext()->drawSurfaceToContext(image, dstRect, srcRect, context);    context->restore();    if (imageObserver())        imageObserver()->didDraw(this);}
开发者ID:sanyaade-mobiledev,项目名称:Webkit-Projects,代码行数:34,


示例11: canvas

void MythPainter::DrawTextLayout(const QRect & canvasRect,                                 const LayoutVector & layouts,                                 const FormatVector & formats,                                 const MythFontProperties & font, int alpha,                                 const QRect & destRect){    if (canvasRect.isNull())        return;    QRect      canvas(canvasRect);    QRect      dest(destRect);    MythImage *im = GetImageFromTextLayout(layouts, formats, font,                                           canvas, dest);    if (!im)    {        LOG(VB_GENERAL, LOG_ERR, QString("MythPainter::DrawTextLayout: "                                             "Unable to create image."));        return;    }    if (im->isNull())    {        LOG(VB_GENERAL, LOG_DEBUG, QString("MythPainter::DrawTextLayout: "                                           "Rendered image is null."));        im->DecrRef();        return;    }    QRect srcRect(0, 0, dest.width(), dest.height());    DrawImage(dest, im, srcRect, alpha);    im->DecrRef();}
开发者ID:dhaber,项目名称:mythtv,代码行数:33,


示例12: srcRect

void Scalpel3DOScreen::rawBlitFrom(const Graphics::Surface &src, const Common::Point &pt) {	Common::Rect srcRect(0, 0, src.w, src.h);	Common::Rect destRect(pt.x, pt.y, pt.x + src.w, pt.y + src.h);	addDirtyRect(destRect);	copyRectToSurface(src, destRect.left, destRect.top, srcRect);}
开发者ID:86400,项目名称:scummvm,代码行数:7,


示例13: savedInfo

void RenderSVGImage::paint(PaintInfo& paintInfo, int, int){    if (paintInfo.context->paintingDisabled() || style()->visibility() == HIDDEN)        return;    paintInfo.context->save();    paintInfo.context->concatCTM(localToParentTransform());    if (paintInfo.phase == PaintPhaseForeground) {        SVGResourceFilter* filter = 0;        PaintInfo savedInfo(paintInfo);        if (prepareToRenderSVGContent(this, paintInfo, m_localBounds, filter)) {            FloatRect destRect = m_localBounds;            FloatRect srcRect(0, 0, image()->width(), image()->height());            SVGImageElement* imageElt = static_cast<SVGImageElement*>(node());            if (imageElt->preserveAspectRatio().align() != SVGPreserveAspectRatio::SVG_PRESERVEASPECTRATIO_NONE)                imageElt->preserveAspectRatio().transformRect(destRect, srcRect);            paintInfo.context->drawImage(image(), DeviceColorSpace, destRect, srcRect);        }        finishRenderSVGContent(this, paintInfo, filter, savedInfo.context);    }    if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) && style()->outlineWidth())        paintOutline(paintInfo.context, 0, 0, width(), height(), style());    paintInfo.context->restore();}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:31,


示例14: nativeImageForCurrentFrame

// Drawing Routinesvoid BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& dst,                       const FloatRect& src, CompositeOperator op){    QPixmap* image = nativeImageForCurrentFrame();    if (!image)        return;        if (mayFillWithSolidColor()) {        fillWithSolidColor(ctxt, dst, solidColor(), op);        return;    }    IntSize selfSize = size();    FloatRect srcRect(src);    FloatRect dstRect(dst);    ctxt->save();    // Set the compositing operation.    ctxt->setCompositeOperation(op);    QPainter* painter(ctxt->platformContext());    // Test using example site at    // http://www.meyerweb.com/eric/css/edge/complexspiral/demo.html        painter->drawPixmap(dst, *image, src);    ctxt->restore();    startAnimation();}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:32,


示例15: width

void UBMagnifier::grabPoint(const QPoint &pGrab){    QMatrix transM = UBApplication::boardController->controlView()->matrix();    updPointGrab = pGrab;    QPointF itemPos = gView->mapFromGlobal(pGrab);    qreal zWidth = width() / (params.zoom * transM.m11());    qreal zWidthHalf = zWidth / 2;    qreal zHeight = height() / (params.zoom * transM.m22());    qreal zHeightHalf = zHeight / 2;        QPointF pfScLtF(UBApplication::boardController->controlView()->mapToScene(QPoint(itemPos.x(), itemPos.y())));       float x = pfScLtF.x() - zWidthHalf;    float y = pfScLtF.y() - zHeightHalf;    QPointF leftTop(x,y);    QPointF rightBottom(x + zWidth, y + zHeight);      QRectF srcRect(leftTop, rightBottom);    QPixmap newPixMap(QSize(width(), height()));    QPainter painter(&newPixMap);    UBApplication::boardController->activeScene()->render(&painter, QRectF(0,0,width(),height()), srcRect);       painter.end();       // pMap.fill(Qt::transparent);    pMap = newPixMap;    pMap.setMask(bmpMask);    update();}
开发者ID:199901,项目名称:Sankore-3.1,代码行数:33,


示例16: srcRect

void BitmapImage::draw(GraphicsContext* context, const FloatRect& dst, const FloatRect& src, ColorSpace styleColorSpace, CompositeOperator op){    FloatRect srcRect(src);    FloatRect dstRect(dst);    if (dstRect.width() == 0.0f || dstRect.height() == 0.0f ||        srcRect.width() == 0.0f || srcRect.height() == 0.0f)        return;    startAnimation();    cairo_surface_t* image = frameAtIndex(m_currentFrame);    if (!image) // If it's too early we won't have an image yet.        return;//+EAWebKitChange//5/30/2012#if ENABLE(IMAGE_COMPRESSION)    // Check if this is a compressed surface.     const void* pCompressedSurfaceUserData = cairo_surface_get_user_data (image, (cairo_user_data_key_t*) ImageCompressionGetUserDataKey());#endif//-EAWebKitChange    if (mayFillWithSolidColor()) {        fillWithSolidColor(context, dstRect, solidColor(), styleColorSpace, op);        //+EAWebKitChange//5/30/2012#if ENABLE(IMAGE_COMPRESSION)        if (pCompressedSurfaceUserData)            cairo_surface_destroy(image);#endif//-EAWebKitChange        return;    }    context->save();    // Set the compositing operation.    if (op == CompositeSourceOver && !frameHasAlphaAtIndex(m_currentFrame))        context->setCompositeOperation(CompositeCopy);    else        context->setCompositeOperation(op);    context->platformContext()->drawSurfaceToContext(image, dstRect, srcRect, context);    context->restore();    if (imageObserver())        imageObserver()->didDraw(this);//+EAWebKitChange//5/30/2012#if ENABLE(IMAGE_COMPRESSION)    if (pCompressedSurfaceUserData)        cairo_surface_destroy(image);   #endif//-EAWebKitChange}
开发者ID:emuikernel,项目名称:EAWebKit,代码行数:58,


示例17: ASSERT

void FEImage::determineAbsolutePaintRect(){    ASSERT(m_image);    FloatRect srcRect(FloatPoint(), m_image->size());    FloatRect paintRect(m_absoluteSubregion);    m_preserveAspectRatio.transformRect(paintRect, srcRect);    paintRect.intersect(maxEffectRect());    setAbsolutePaintRect(enclosingIntRect(paintRect));}
开发者ID:sysrqb,项目名称:chromium-src,代码行数:9,


示例18: srcRect

//! [3]void DBScreen::blit(const QImage &image, const QPoint &topLeft, const QRegion &region){    QVector<QRect> rects = region.rects();    for (int i = 0; i < rects.size(); i++) {        QRect destRect = rects.at(i);        QRect srcRect(destRect.x()-topLeft.x(), destRect.y()-topLeft.y(), destRect.width(), destRect.height());        painter->drawImage(destRect.topLeft(), image, srcRect);    }}
开发者ID:bailsoftware,项目名称:qt-embedded,代码行数:10,


示例19: srcRect

void BaseSurface::SHtransBlitFrom(const Graphics::Surface &src, const Common::Point &pt,		bool flipped, int overrideColor, int scaleVal) {	Common::Rect srcRect(0, 0, src.w, src.h);	Common::Rect destRect(pt.x, pt.y, pt.x + src.w * SCALE_THRESHOLD / scaleVal,		pt.y + src.h * SCALE_THRESHOLD / scaleVal);	Graphics::Screen::transBlitFrom(src, srcRect, destRect, TRANSPARENCY,		flipped, overrideColor);}
开发者ID:86400,项目名称:scummvm,代码行数:9,


示例20: GetMainWindow

void PictureTextCBox::Draw(const Point2i &/*mousePosition*/){  Surface & video_window = GetMainWindow();  if (m_value) {    uint enabled_x = GetPositionX() + (GetSizeX() - m_enabled.GetWidth())/2 ;    uint enabled_y = GetPositionY();    uint outside_x = std::max(uint(0), GetPositionX() - enabled_x);    uint outside_y = std::max(uint(0), GetPositionY() - enabled_y);    enabled_x += outside_x;    enabled_y += outside_y;    Rectanglei srcRect(outside_x, outside_y, m_enabled.GetWidth() - outside_x,                       m_enabled.GetHeight() - outside_y);    video_window.Blit(m_enabled, srcRect, Point2i(enabled_x, enabled_y));  } else {    uint disabled_x = GetPositionX() + (GetSizeX() - m_disabled_back.GetWidth())/2 ;    uint disabled_y = GetPositionY();    uint outside_x = std::max(uint(0), GetPositionX() - disabled_x);    uint outside_y = std::max(uint(0), GetPositionY() - disabled_y);    disabled_x += outside_x;    disabled_y += outside_y;    Rectanglei srcRect(outside_x, outside_y, m_disabled_back.GetWidth() - outside_x,                       m_disabled_back.GetHeight() - outside_y);    video_window.Blit(m_disabled_back, srcRect, Point2i(disabled_x, disabled_y));  }  // center the image  uint tmp_x = GetPositionX() + (GetSizeX() - m_image.GetWidth())/2 ;  uint tmp_y = GetPositionY() + (m_enabled.GetHeight() - m_image.GetHeight())/2;  video_window.Blit(m_image, Point2i(tmp_x, tmp_y));  Text::DrawCenterTop(GetPosition() + Point2i(GetSizeX()/2,                      GetSizeY() - Text::GetHeight()));  if (!m_value) {    uint disabled_x = GetPositionX() + (GetSizeX() - m_disabled_front.GetWidth())/2 ;    uint disabled_y = GetPositionY() + (m_enabled.GetHeight() - m_disabled_front.GetHeight())/2;    video_window.Blit(m_disabled_front, Point2i(disabled_x, disabled_y));  }}
开发者ID:fluxer,项目名称:warmux,代码行数:43,


示例21: imageResource

void RenderSVGImage::paintForeground(PaintInfo& paintInfo){    RefPtr<Image> image = imageResource().image();    FloatRect destRect = m_objectBoundingBox;    FloatRect srcRect(0, 0, image->width(), image->height());    imageElement().preserveAspectRatio().transformRect(destRect, srcRect);    paintInfo.context->drawImage(image.get(), ColorSpaceDeviceRGB, destRect, srcRect);}
开发者ID:cheekiatng,项目名称:webkit,代码行数:10,


示例22: ToOutsideIntRect

voidClientLayerManager::MakeSnapshotIfRequired(){  if (!mShadowTarget) {    return;  }  if (mWidget) {    if (CompositorBridgeChild* remoteRenderer = GetRemoteRenderer()) {      // The compositor doesn't draw to a different sized surface      // when there's a rotation. Instead we rotate the result      // when drawing into dt      LayoutDeviceIntRect outerBounds;      mWidget->GetBounds(outerBounds);      IntRect bounds = ToOutsideIntRect(mShadowTarget->GetClipExtents());      if (mTargetRotation) {        bounds =          RotateRect(bounds, outerBounds.ToUnknownRect(), mTargetRotation);      }      SurfaceDescriptor inSnapshot;      if (!bounds.IsEmpty() &&          mForwarder->AllocSurfaceDescriptor(bounds.Size(),                                             gfxContentType::COLOR_ALPHA,                                             &inSnapshot)) {        // Make a copy of |inSnapshot| because the call to send it over IPC        // will call forget() on the Shmem inside, and zero it out.        SurfaceDescriptor outSnapshot = inSnapshot;        if (remoteRenderer->SendMakeSnapshot(inSnapshot, bounds)) {          RefPtr<DataSourceSurface> surf = GetSurfaceForDescriptor(outSnapshot);          DrawTarget* dt = mShadowTarget->GetDrawTarget();          Rect dstRect(bounds.x, bounds.y, bounds.width, bounds.height);          Rect srcRect(0, 0, bounds.width, bounds.height);          gfx::Matrix rotate =            ComputeTransformForUnRotation(outerBounds.ToUnknownRect(),                                          mTargetRotation);          gfx::Matrix oldMatrix = dt->GetTransform();          dt->SetTransform(rotate * oldMatrix);          dt->DrawSurface(surf, dstRect, srcRect,                          DrawSurfaceOptions(),                          DrawOptions(1.0f, CompositionOp::OP_OVER));          dt->SetTransform(oldMatrix);        }        mForwarder->DestroySurfaceDescriptor(&outSnapshot);      }    }  }  mShadowTarget = nullptr;}
开发者ID:carriercomm,项目名称:gecko-dev,代码行数:54,


示例23: size

bool FBORenderStrategy::render(Content* content, Image* renderImage){    if (!renderImage)        return false;    glWidget->makeCurrent();    QSize size(renderImage->width(), renderImage->height());    createFBOs(size);    // Render frame into multisample FBO    QPainter painter(multisampleFBO);    painter.setRenderHints(QPainter::Antialiasing |                           QPainter::TextAntialiasing |                           QPainter::SmoothPixmapTransform, true);    content->paintContent(&painter);    painter.end();    // Blit from multisample to resolve FBO.    // Rects are setup so the image is vertically flipped when blitted    // so when we read the pixels back they are the right way up.    // OpenGL does everything "upside down".    QRect srcRect(0, 0, renderImage->width(), renderImage->height());    QRect dstRect(0, renderImage->height(),                  renderImage->width(), -renderImage->height());    QGLFramebufferObject::blitFramebuffer(resolveFBO, srcRect,                                          multisampleFBO, dstRect);    // Read back the pixels from the resolve FBO    resolveFBO->bind();    glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);    glPixelStorei(GL_PACK_ALIGNMENT, 1);        if (renderImage->hasAlpha()) {        glPixelStorei(GL_UNPACK_ROW_LENGTH,   0);        glPixelStorei(GL_UNPACK_ALIGNMENT,    4);        glReadPixels(0, 0, renderImage->width(), renderImage->height(),                 GL_RGBA, GL_UNSIGNED_BYTE, renderImage->pixels());    }    else {        glPixelStorei(GL_UNPACK_ROW_LENGTH,   0);        glPixelStorei(GL_UNPACK_ALIGNMENT,    3);        glReadPixels(0, 0, renderImage->width(), renderImage->height(),                 GL_RGB, GL_UNSIGNED_BYTE, renderImage->pixels());    }        glPopClientAttrib();    resolveFBO->release();    glWidget->doneCurrent();    return true;}
开发者ID:mltframework,项目名称:webvfx,代码行数:52,


示例24: draw2DRectangle

// TODO ici obtenir qque chose independant de la resolutionvoidCDialogState::Draw(){/*virtual void  draw2DRectangle (SColor color, const core::rect< s32 > &pos, const core::rect< s32 > *clip=0)=0  Draws a 2d rectangle.virtual void  draw2DRectangleOutline (const core::recti &pos, SColor color=SColor(255, 255, 255, 255))=0  Draws the outline of a 2D rectangle.*/    if(_events.empty()){        return;    }    irr::gui::IGUIFont* font = gui()->getFont (_BC_FILE_HUDFONT);//    gui::IGUIFont* font = engine->guienv->getFont("images/fonthaettenschweiler.bmp");    const CSpeech& speech = _events.front();    if(font){        //engine()->smgr->drawAll();        // Creation of displayed text, first add name of the interlocutor        std::wstring text = speech._speaker->_name;        text += L":/n";        // then his/her speech        text += speech._message;        font->draw(            text.c_str(),            core::recti(300,10,500,50),            video::SColor(255,255,255,255)        );    }    irr::video::ITexture* texture = speech._speaker->_texture;    if(texture){        irr::core::recti  srcRect(irr::core::position2di(0,0),texture->getOriginalSize());        engine()->driver->draw2DImage(            texture,            core::position2di(10,10),            srcRect,            0,              // clipRect            video::SColor(255,255,255,255),            true                // useAlphaChannelOfTexture            );    }}
开发者ID:teto,项目名称:bluecosmos,代码行数:53,


示例25: srcRect

void Director::drawRect(const Common::Rect &rect) {	_surface.fillRect(rect, 0);	for (uint i = 0; i < _sprites.size(); ++i) {		const Common::Rect &spriteRect = _sprites[i]->getBounds();		Common::Rect interRect = rect.findIntersectingRect(spriteRect);		if (interRect.isEmpty())			continue;		Common::Rect srcRect(interRect);		srcRect.translate(-spriteRect.left, -spriteRect.top);		_surface.transBlitFrom(*_sprites[i]->getDecoder()->getCurrentFrame(), srcRect, interRect, _sprites[i]->getDecoder()->getTransparentColourIndex());	}}
开发者ID:vladimir-zahradnik,项目名称:scummvm,代码行数:13,


示例26: outRect

QSGNode* QmlVlcVideoSurface::updatePaintNode( QSGNode* oldNode,        UpdatePaintNodeData* /*data*/ ){    SGVlcVideoNode* node = static_cast<SGVlcVideoNode*>( oldNode );    if( !m_frame ) {        delete node;        return 0;    }    if( !node )        node = new SGVlcVideoNode;    QRectF outRect( 0, 0, width(), height() );    QRectF srcRect( 0, 0, 1., 1. );    if( Stretch != fillMode() ) {        const uint16_t fw = m_frame->width;        const uint16_t fh = m_frame->height;        const qreal frameAspect = qreal( fw ) / fh;        const qreal itemAspect = width() / height();        if( PreserveAspectFit == fillMode() ) {            qreal outWidth = width();            qreal outHeight = height();            if( frameAspect > itemAspect )                outHeight = outWidth / frameAspect;            else if( frameAspect < itemAspect )                outWidth = outHeight * frameAspect;            outRect = QRectF( ( width() - outWidth ) / 2, ( height() - outHeight ) / 2,                              outWidth, outHeight );        } else if( PreserveAspectCrop == fillMode() ) {            if( frameAspect > itemAspect ) {                srcRect.setX( ( 1. - itemAspect / frameAspect ) / 2 );                srcRect.setWidth( 1. - srcRect.x() - srcRect.x() );            } else if( frameAspect < itemAspect ) {                srcRect.setY( ( 1. - frameAspect / itemAspect ) / 2 );                srcRect.setHeight( 1. - srcRect.y() - srcRect.y() );            }        }    }    if( m_frameUpdated ) {        node->setFrame( m_frame );        m_frameUpdated = false;    }    node->setRect( outRect, srcRect );    return node;}
开发者ID:RSATom,项目名称:QmlVlc,代码行数:51,



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


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