本文整理汇总了C++中IDirectFBSurface::StretchBlit方法的典型用法代码示例。如果您正苦于以下问题:C++ IDirectFBSurface::StretchBlit方法的具体用法?C++ IDirectFBSurface::StretchBlit怎么用?C++ IDirectFBSurface::StretchBlit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDirectFBSurface
的用法示例。
在下文中一共展示了IDirectFBSurface::StretchBlit方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateTitle
status_t ServerWindow::UpdateTitle (char *title){
DFBFontDescription font_dsc;
IDirectFBSurface *wsurface = NULL;
int wdth;
int ht;
int width1, width2, width3;
int height1, height2, height3;
DFBCHECK(window->GetSurface(window, &wsurface));
DFBCHECK(window->GetSize(window, &wdth, &ht));
if (fType==B_FLOATING_WINDOW){
DFBCHECK (shead->GetSize(shead, &width1, &height1));
DFBCHECK (sok_button->GetSize(sok_button, &width2, &height2));
DFBCHECK (sclose_button->GetSize(sclose_button, &width3, &height3));
DFBRectangle rect;
rect.x = 0; rect.y = 0; rect.h = height1; rect.w = wdth-width2-width3;
DFBCHECK (wsurface->StretchBlit (wsurface, shead, NULL, &rect));
DFBCHECK (wsurface->Blit (wsurface, sok_button, NULL, rect.w, 0));
DFBCHECK (wsurface->Blit (wsurface, sclose_button, NULL, rect.w+width2, 0));
// Draw the window title
font_dsc.flags = DFDESC_HEIGHT;
font_dsc.height = 10;
font_dsc.width = 10;
DFBCHECK (app_server->dfb->CreateFont (app_server->dfb, "./decker.ttf", &font_dsc, &font));
DFBCHECK (wsurface->SetFont (wsurface, font));
DFBCHECK (wsurface->SetColor (wsurface, 0xff, 0x0, 0x0, 0xFF));
DFBCHECK (wsurface->DrawString (wsurface, title, -1, 5, 2*height1/3, DSTF_LEFT));
}
else if (fType==B_TITLED_WINDOW){
DFBCHECK (head->GetSize(head, &width1, &height1));
DFBCHECK (ok_button->GetSize(ok_button, &width2, &height2));
DFBCHECK (close_button->GetSize(close_button, &width3, &height3));
DFBRectangle rect;
rect.x = 0; rect.y = 0; rect.h = height1; rect.w = wdth-width2-width3;
DFBCHECK (wsurface->StretchBlit (wsurface, head, NULL, &rect));
DFBCHECK (wsurface->Blit (wsurface, ok_button, NULL, rect.w, 0));
DFBCHECK (wsurface->Blit (wsurface, close_button, NULL, rect.w+width2, 0));
// Draw the window title
font_dsc.flags = DFDESC_HEIGHT;
font_dsc.height = 15;
font_dsc.width = 15;
DFBCHECK (app_server->dfb->CreateFont (app_server->dfb, "./decker.ttf", &font_dsc, &font));
DFBCHECK (wsurface->SetFont (wsurface, font));
DFBCHECK (wsurface->SetColor (wsurface, 0x0, 0x10, 0xfa, 0xFF));
DFBCHECK (wsurface->DrawString (wsurface, title, -1, 6, 2*height1/3, DSTF_LEFT));
}
}
示例2: surface_stretch_blit
static mrb_value surface_stretch_blit(mrb_state *mrb, mrb_value self)
{
IDirectFBSurface* surface = mrb_directfb_surface(mrb, self);
DFBResult ret = -1;
if (surface != NULL) {
mrb_value src_object;
mrb_value src_rect_object;
mrb_value dst_rect_object;
mrb_get_args(mrb, "ooo", &src_object, &src_rect_object, &dst_rect_object);
{
IDirectFBSurface* src = mrb_directfb_surface(mrb, src_object);
DFBRectangle* src_rect = mrb_directfb_rectangle(mrb, src_rect_object);
DFBRectangle* dst_rect = mrb_directfb_rectangle(mrb, dst_rect_object);
ret = surface->StretchBlit(surface, src, src_rect, dst_rect);
}
}
return mrb_fixnum_value(ret);
}
示例3: transformed
QPixmap QDirectFBPixmapData::transformed(const QTransform &transform,
Qt::TransformationMode mode) const
{
if (!surface || transform.type() != QTransform::TxScale
|| mode != Qt::FastTransformation)
{
QDirectFBPixmapData *that = const_cast<QDirectFBPixmapData*>(this);
const QImage *image = that->buffer();
if (image) { // avoid deep copy
const QImage transformed = image->transformed(transform, mode);
that->unlockDirectFB();
QDirectFBPixmapData *data = new QDirectFBPixmapData(pixelType());
data->fromImage(transformed, Qt::AutoColor);
return QPixmap(data);
}
return QPixmapData::transformed(transform, mode);
}
int w, h;
surface->GetSize(surface, &w, &h);
const QSize size = transform.mapRect(QRect(0, 0, w, h)).size();
if (size.isEmpty())
return QPixmap();
QDirectFBPixmapData *data = new QDirectFBPixmapData(pixelType());
data->resize(size.width(), size.height());
IDirectFBSurface *dest = data->surface;
dest->SetBlittingFlags(dest, DSBLIT_NOFX);
const DFBRectangle srcRect = { 0, 0, w, h };
const DFBRectangle destRect = { 0, 0, size.width(), size.height() };
dest->StretchBlit(dest, surface, &srcRect, &destRect);
return QPixmap(data);
}
示例4: SDLtoDFBRect
//.........这里部分代码省略.........
destsurf->GetClip(destsurf, &clip_region);
dr.x += clip_region.x1;
dr.y += clip_region.y1;
if (texturedata->display) {
int px, py;
SDL_Window *window = renderer->window;
IDirectFBWindow *dfbwin = get_dfb_window(window);
SDL_DFB_WINDOWDATA(window);
SDL_VideoDisplay *display = texturedata->display;
DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata;
SDL_DFB_CHECKERR(dispdata->
vidlayer->SetSourceRectangle(dispdata->vidlayer,
sr.x, sr.y, sr.w, sr.h));
dfbwin->GetPosition(dfbwin, &px, &py);
px += windata->client.x;
py += windata->client.y;
SDL_DFB_CHECKERR(dispdata->
vidlayer->SetScreenRectangle(dispdata->vidlayer,
px + dr.x,
py + dr.y,
dr.w,
dr.h));
} else {
DFBSurfaceBlittingFlags flags = 0;
#if 0
if (texturedata->dirty.list) {
SDL_DirtyRect *dirty;
void *pixels;
int bpp = DFB_BYTES_PER_PIXEL(DirectFB_SDLToDFBPixelFormat(texture->format));
int pitch = texturedata->pitch;
for (dirty = texturedata->dirty.list; dirty; dirty = dirty->next) {
SDL_Rect *rect = &dirty->rect;
pixels =
(void *) ((Uint8 *) texturedata->pixels +
rect->y * pitch + rect->x * bpp);
DirectFB_UpdateTexture(renderer, texture, rect,
pixels,
texturedata->pitch);
}
SDL_ClearDirtyRects(&texturedata->dirty);
}
#endif
if (texturedata->isDirty)
{
SDL_Rect rect;
rect.x = 0;
rect.y = 0;
rect.w = texture->w;
rect.h = texture->h;
DirectFB_UpdateTexture(renderer, texture, &rect, texturedata->pixels, texturedata->pitch);
}
alpha = r = g = b = 0xff;
if (texture->modMode & SDL_TEXTUREMODULATE_ALPHA){
alpha = texture->a;
flags |= DSBLIT_BLEND_COLORALPHA;
}
if (texture->modMode & SDL_TEXTUREMODULATE_COLOR) {
r = texture->r;
g = texture->g;
b = texture->b;
flags |= DSBLIT_COLORIZE;
}
SDL_DFB_CHECKERR(destsurf->
SetColor(destsurf, r, g, b, alpha));
/* ???? flags |= DSBLIT_SRC_PREMULTCOLOR; */
SetBlendMode(data, texture->blendMode, texturedata);
SDL_DFB_CHECKERR(destsurf->SetBlittingFlags(destsurf,
data->blitFlags | flags));
#if (DFB_VERSION_ATLEAST(1,2,0))
SDL_DFB_CHECKERR(destsurf->SetRenderOptions(destsurf,
texturedata->
render_options));
#endif
if (srcrect->w == dstrect->w && srcrect->h == dstrect->h) {
SDL_DFB_CHECKERR(destsurf->Blit(destsurf,
texturedata->surface,
&sr, dr.x, dr.y));
} else {
SDL_DFB_CHECKERR(destsurf->StretchBlit(destsurf,
texturedata->surface,
&sr, &dr));
}
}
return 0;
error:
return -1;
}
示例5: LoadFont
void
DirectFB_WM_RedrawLayout(_THIS, SDL_Window * window)
{
SDL_DFB_WINDOWDATA(window);
IDirectFBSurface *s = windata->window_surface;
DFB_Theme *t = &windata->theme;
int i;
int d = (t->caption_size - t->font_size) / 2;
int x, y, w;
if (!windata->is_managed || (window->flags & SDL_WINDOW_FULLSCREEN))
return;
SDL_DFB_CHECK(s->SetSrcBlendFunction(s, DSBF_ONE));
SDL_DFB_CHECK(s->SetDstBlendFunction(s, DSBF_ZERO));
SDL_DFB_CHECK(s->SetDrawingFlags(s, DSDRAW_NOFX));
SDL_DFB_CHECK(s->SetBlittingFlags(s, DSBLIT_NOFX));
LoadFont(_this, window);
/* s->SetDrawingFlags(s, DSDRAW_BLEND); */
s->SetColor(s, COLOR_EXPAND(t->frame_color));
/* top */
for (i = 0; i < t->top_size; i++)
s->DrawLine(s, 0, i, windata->size.w, i);
/* bottom */
for (i = windata->size.h - t->bottom_size; i < windata->size.h; i++)
s->DrawLine(s, 0, i, windata->size.w, i);
/* left */
for (i = 0; i < t->left_size; i++)
s->DrawLine(s, i, 0, i, windata->size.h);
/* right */
for (i = windata->size.w - t->right_size; i < windata->size.w; i++)
s->DrawLine(s, i, 0, i, windata->size.h);
/* Caption */
s->SetColor(s, COLOR_EXPAND(t->caption_color));
s->FillRectangle(s, t->left_size, t->top_size, windata->client.w,
t->caption_size);
/* Close Button */
w = t->caption_size;
x = windata->size.w - t->right_size - w + d;
y = t->top_size + d;
s->SetColor(s, COLOR_EXPAND(t->close_color));
DrawTriangle(s, 1, x, y, w - 2 * d);
/* Max Button */
s->SetColor(s, COLOR_EXPAND(t->max_color));
DrawTriangle(s, window->flags & SDL_WINDOW_MAXIMIZED ? 1 : 0, x - w,
y, w - 2 * d);
/* Caption */
if (*window->title) {
s->SetColor(s, COLOR_EXPAND(t->font_color));
DrawCraption(_this, s, (x - w) / 2, t->top_size + d, window->title);
}
/* Icon */
if (windata->icon) {
DFBRectangle dr;
dr.x = t->left_size + d;
dr.y = t->top_size + d;
dr.w = w - 2 * d;
dr.h = w - 2 * d;
s->SetBlittingFlags(s, DSBLIT_BLEND_ALPHACHANNEL);
s->StretchBlit(s, windata->icon, NULL, &dr);
}
windata->wm_needs_redraw = 0;
}
示例6: show_usage
int
main( int argc, char *argv[] )
{
int i;
DFBResult ret;
DFBSurfaceDescription desc;
IDirectFB *dfb;
IDirectFBImageProvider *provider = NULL;
IDirectFBSurface *source = NULL;
IDirectFBSurface *dest = NULL;
const char *url = NULL;
/* Parse arguments. */
for (i=1; i<argc; i++) {
if (!strcmp( argv[i], "-h" ))
return show_usage( argv[0] );
else if (!url)
url = argv[i];
else
return show_usage( argv[0] );
}
/* Check if we got an URL. */
if (!url)
return show_usage( argv[0] );
/* Initialize DirectFB. */
ret = DirectFBInit( &argc, &argv );
if (ret) {
D_DERROR( ret, "DFBTest/Scale: DirectFBInit() failed!\n" );
return ret;
}
/* Create super interface. */
ret = DirectFBCreate( &dfb );
if (ret) {
D_DERROR( ret, "DFBTest/Scale: DirectFBCreate() failed!\n" );
return ret;
}
/* Create an image provider for the image to be loaded. */
ret = dfb->CreateImageProvider( dfb, url, &provider );
if (ret) {
D_DERROR( ret, "DFBTest/Scale: IDirectFB::CreateImageProvider( '%s' ) failed!\n", url );
goto out;
}
/* Get the surface description. */
ret = provider->GetSurfaceDescription( provider, &desc );
if (ret) {
D_DERROR( ret, "DFBTest/Scale: IDirectFBImageProvider::GetSurfaceDescription() failed!\n" );
goto out;
}
desc.pixelformat = DSPF_LUT8;
D_INFO( "DFBTest/Scale: Source is %dx%d using %s\n",
desc.width, desc.height, dfb_pixelformat_name(desc.pixelformat) );
/* Create a surface for the image. */
ret = dfb->CreateSurface( dfb, &desc, &source );
if (ret) {
D_DERROR( ret, "DFBTest/Scale: IDirectFB::CreateSurface() failed!\n" );
goto out;
}
ret = provider->RenderTo( provider, source, NULL );
if (ret) {
D_DERROR( ret, "DFBTest/Scale: IDirectFBImageProvider::RenderTo() failed!\n" );
goto out;
}
desc.width = desc.width * 3 / 4;
desc.height = desc.height * 3 / 4;
if (DFB_PIXELFORMAT_IS_INDEXED( desc.pixelformat ))
desc.pixelformat = DSPF_ARGB;
D_INFO( "DFBTest/Scale: Destination is %dx%d using %s\n",
desc.width, desc.height, dfb_pixelformat_name(desc.pixelformat) );
/* Create a surface for the image. */
ret = dfb->CreateSurface( dfb, &desc, &dest );
if (ret) {
D_DERROR( ret, "DFBTest/Scale: IDirectFB::CreateSurface() failed!\n" );
goto out;
}
dest->SetBlittingFlags( dest, DSBLIT_SRC_PREMULTIPLY );
dest->StretchBlit( dest, source, NULL, NULL );
dest->Dump( dest, "dfbtest_scale", NULL );
out:
if (dest)
dest->Release( dest );
if (source)
source->Release( source );
//.........这里部分代码省略.........
示例7: CreateWindow
//---------------------------------------------------------------------------------
//--------------------------wael work----------------------
//---------------------------------------------------------------------------------
status_t ServerWindow::CreateWindow (IDirectFBDisplayLayer *layer){
DFBFontDescription font_dsc;
DFBWindowDescription wdsc;
IDirectFBSurface *wsurface = NULL;
DFBSurfaceDescription dsc;
// char *title;TODO: I need to convert the fTitle from BString to char *
char title[fTitle.CountChars()+1];
fTitle.CopyInto(title, 0, fTitle.CountChars());
DFBRectangle frame;
frame.x=(int)fFrame.LeftTop().x;
frame.y=(int)fFrame.LeftTop().y;
frame.w=(int)fFrame.IntegerWidth();
frame.h=(int)fFrame.IntegerHeight();
int width1, width2, width3;
int height1, height2, height3;
//create window inside the primary layer
wdsc.flags = (DFBWindowDescriptionFlags)(DWDESC_CAPS | DWDESC_WIDTH | DWDESC_HEIGHT | DWDESC_POSX | DWDESC_POSY | DWDESC_SURFACE_CAPS);
wdsc.caps = DWCAPS_ALPHACHANNEL;
wdsc.width = frame.w;
wdsc.height = frame.h;
wdsc.posx = frame.x;
wdsc.posy = frame.y;
wdsc.surface_caps = DSCAPS_FLIPPING;
DFBCHECK(layer->CreateWindow(layer, &wdsc, &window));
//Get the window surface and clear it
DFBCHECK(window->GetSurface(window, &wsurface));
DFBCHECK(wsurface->Clear (wsurface, 0x00, 0x00, 0x00, 0x00));
DFBCHECK(window->SetOpaqueRegion (window, 0, 0, frame.h, frame.w));
//Set the window options to be transparent
DFBWindowOptions options;
window->GetOptions (window, &options);
options = (DFBWindowOptions) ( options | DWOP_SHAPED );
DFBCHECK(window->SetOptions (window, options));
wsurface->SetSrcColorKey(wsurface, R, G, B);
wsurface->SetBlittingFlags(wsurface, DSBLIT_SRC_COLORKEY);
if (fType==B_FLOATING_WINDOW){
DFBCHECK (shead->GetSize(shead, &width1, &height1));
DFBCHECK (sok_button->GetSize(sok_button, &width2, &height2));
DFBCHECK (sclose_button->GetSize(sclose_button, &width3, &height3));
DFBRectangle rect;
rect.x = 0;
rect.y = 0;
rect.h = height1;
rect.w = frame.w-width2-width3;
DFBCHECK (wsurface->StretchBlit (wsurface, shead, NULL, &rect));
DFBCHECK (wsurface->Blit (wsurface, sok_button, NULL, rect.w, 0));
DFBCHECK (wsurface->Blit (wsurface, sclose_button, NULL, rect.w+width2, 0));
// Draw the window title
font_dsc.flags = DFDESC_HEIGHT;
font_dsc.height = 10;
font_dsc.width = 10;
DFBCHECK (app_server->dfb->CreateFont (app_server->dfb, "./decker.ttf", &font_dsc, &font));
DFBCHECK (wsurface->SetFont (wsurface, font));
DFBCHECK (wsurface->SetColor (wsurface, 0xff, 0x0, 0x0, 0xFF));
int size = 0;
DFBRectangle rect1;
DFBCHECK (font->GetStringExtents (font, title, -1, NULL, &rect1));
if (rect1.w > rect.w){
do{
size++;
DFBCHECK (font->GetStringExtents (font, title, size, NULL, &rect1));
}while (rect1.w < rect.w);
size--;
}
DFBCHECK (wsurface->DrawString (wsurface, title, size-1, 5, 2*height1/3, DSTF_LEFT));
rect.x = 0;
rect.y = height1;
rect.w = frame.w;
rect.h = frame.h-height1;
DFBCHECK (wsurface->StretchBlit (wsurface, body, NULL, &rect));
}
else if (fType==B_TITLED_WINDOW){
DFBCHECK (head->GetSize(head, &width1, &height1));
DFBCHECK (ok_button->GetSize(ok_button, &width2, &height2));
DFBCHECK (close_button->GetSize(close_button, &width3, &height3));
DFBRectangle rect;
rect.x = 0;
rect.y = 0;
rect.h = height1;
rect.w = frame.w-width2-width3;
DFBCHECK (wsurface->StretchBlit (wsurface, head, NULL, &rect));
DFBCHECK (wsurface->Blit (wsurface, ok_button, NULL, rect.w, 0));
DFBCHECK (wsurface->Blit (wsurface, close_button, NULL, rect.w+width2, 0));
// Draw the window title
//.........这里部分代码省略.........
示例8: print_usage
//.........这里部分代码省略.........
ret = provider->GetSurfaceDescription( provider, &desc );
if (ret) {
D_DERROR( ret, "DFBTest/Blit: IDirectFBImageProvider::GetSurfaceDescription() failed!\n" );
goto out;
}
if (source_format != DSPF_UNKNOWN)
desc.pixelformat = source_format;
D_INFO( "DFBTest/Blit: Source is %dx%d using %s\n",
desc.width, desc.height, dfb_pixelformat_name(desc.pixelformat) );
/* Create a surface for the image. */
ret = dfb->CreateSurface( dfb, &desc, &source );
if (ret) {
D_DERROR( ret, "DFBTest/Blit: IDirectFB::CreateSurface() failed!\n" );
goto out;
}
ret = provider->RenderTo( provider, source, NULL );
if (ret) {
D_DERROR( ret, "DFBTest/Blit: IDirectFBImageProvider::RenderTo() failed!\n" );
goto out;
}
/* Fill description for a primary surface. */
desc.flags = DSDESC_CAPS;
desc.caps = DSCAPS_PRIMARY | DSCAPS_FLIPPING;
if (dest_format != DSPF_UNKNOWN) {
desc.flags |= DSDESC_PIXELFORMAT;
desc.pixelformat = dest_format;
}
if (dest_resize)
desc.flags |= DSDESC_WIDTH | DSDESC_HEIGHT;
dfb->SetCooperativeLevel( dfb, DFSCL_FULLSCREEN );
/* Create a primary surface. */
ret = dfb->CreateSurface( dfb, &desc, &dest );
if (ret) {
D_DERROR( ret, "DFBTest/Blit: IDirectFB::CreateSurface() failed!\n" );
goto out;
}
dest->GetSize( dest, &desc.width, &desc.height );
dest->GetPixelFormat( dest, &desc.pixelformat );
D_INFO( "DFBTest/Blit: Destination is %dx%d using %s\n",
desc.width, desc.height, dfb_pixelformat_name(desc.pixelformat) );
for (i=0; i<100000; i++) {
int j,n = rand()%100;
for (j=0; j<n; j++) {
switch (rand()%3) {
case 0:
dest->SetDrawingFlags( dest, rand() & (DSDRAW_BLEND) );
dest->FillRectangle( dest, rand()%100, rand()%100, rand()%100, rand()%100 );
break;
case 1:
dest->SetBlittingFlags( dest, rand() & (DSBLIT_BLEND_ALPHACHANNEL |
DSBLIT_BLEND_COLORALPHA |
DSBLIT_COLORIZE |
DSBLIT_ROTATE90) );
dest->Blit( dest, source, NULL, rand()%100, rand()%100 );
break;
case 2:
dest->SetBlittingFlags( dest, rand() & (DSBLIT_BLEND_ALPHACHANNEL |
DSBLIT_BLEND_COLORALPHA |
DSBLIT_COLORIZE |
DSBLIT_ROTATE90) );
dest->StretchBlit( dest, source, NULL, NULL );
break;
}
}
dfb->WaitIdle( dfb );
dest->Flip( dest, NULL, DSFLIP_NONE );
}
out:
if (dest)
dest->Release( dest );
if (source)
source->Release( source );
if (provider)
provider->Release( provider );
/* Shutdown DirectFB. */
dfb->Release( dfb );
return ret;
}
示例9: show_usage
//.........这里部分代码省略.........
}
/* Create an image provider for the image to be loaded. */
ret = dfb->CreateImageProvider( dfb, url, &provider );
if (ret) {
D_DERROR( ret, "DFBTest/Scale: IDirectFB::CreateImageProvider( '%s' ) failed!\n", url );
goto out;
}
/* Get the surface description. */
ret = provider->GetSurfaceDescription( provider, &desc );
if (ret) {
D_DERROR( ret, "DFBTest/Scale: IDirectFBImageProvider::GetSurfaceDescription() failed!\n" );
goto out;
}
desc.pixelformat = DSPF_NV21;
D_INFO( "DFBTest/Scale: Source is %dx%d using %s\n",
desc.width, desc.height, dfb_pixelformat_name(desc.pixelformat) );
/* Create a surface for the image. */
ret = dfb->CreateSurface( dfb, &desc, &source );
if (ret) {
D_DERROR( ret, "DFBTest/Scale: IDirectFB::CreateSurface() failed!\n" );
goto out;
}
ret = provider->RenderTo( provider, source, NULL );
if (ret) {
D_DERROR( ret, "DFBTest/Scale: IDirectFBImageProvider::RenderTo() failed!\n" );
goto out;
}
desc.width = desc.width * 3 / 4;
desc.height = desc.height * 3 / 4;
D_INFO( "DFBTest/Scale: Destination is %dx%d using %s\n",
desc.width, desc.height, dfb_pixelformat_name(desc.pixelformat) );
/* Create a surface for the image. */
ret = dfb->CreateSurface( dfb, &desc, &dest );
if (ret) {
D_DERROR( ret, "DFBTest/Scale: IDirectFB::CreateSurface() failed!\n" );
goto out;
}
DFBRectangle srect = {
10, 10, 200, 200
};
DFBRectangle drect = {
10, 10, 300, 300
};
DFBRegion clip = {
40, 40, 199, 199
};
dest->Clear( dest, 0xff, 0xff, 0xff, 0xff );
dest->SetClip( dest, &clip );
dest->StretchBlit( dest, source, &srect, &drect );
desc.pixelformat = DSPF_ARGB;
D_INFO( "DFBTest/Scale: Destination2 is %dx%d using %s\n",
desc.width, desc.height, dfb_pixelformat_name(desc.pixelformat) );
/* Create a surface for the image. */
ret = dfb->CreateSurface( dfb, &desc, &dest2 );
if (ret) {
D_DERROR( ret, "DFBTest/Scale: IDirectFB::CreateSurface() failed!\n" );
goto out;
}
dest2->Blit( dest2, dest, NULL, 0, 0 );
dest2->Dump( dest2, "dfbtest_scale_nv21", NULL );
out:
if (dest2)
dest2->Release( dest2 );
if (dest)
dest->Release( dest );
if (source)
source->Release( source );
if (provider)
provider->Release( provider );
/* Shutdown DirectFB. */
dfb->Release( dfb );
return ret;
}