亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? winutil.cpp

?? 用DirectX制作高級動畫-[Advanced.Animation.with.DirectX]
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
    }
    ASSERT(!m_bRealizing);

    // Should we realise our palette again

    if ((Message == WM_QUERYNEWPALETTE || hwnd != m_hwnd)) {
        //  It seems that even if we're invisible that we can get asked
        //  to realize our palette and this can cause really ugly side-effects
        //  Seems like there's another bug but this masks it a least for the
        //  shutting down case.
        if (!IsWindowVisible(m_hwnd)) {
            DbgLog((LOG_TRACE, 1, TEXT("Realizing when invisible!")));
            return (LRESULT) 0;
        }

        // Avoid recursion with multiple graphs in the same app
#ifdef DEBUG
        m_bRealizing = TRUE;
#endif
        DoRealisePalette(Message != WM_QUERYNEWPALETTE);
#ifdef DEBUG
        m_bRealizing = FALSE;
#endif

        // Should we redraw the window with the new palette
        if (Message == WM_PALETTECHANGED) {
            InvalidateRect(m_hwnd,NULL,FALSE);
        }
    }

    return (LRESULT) 1;
}


// Determine if the window exists.

bool CBaseWindow::WindowExists()
{
    return !!IsWindow(m_hwnd);
}


// Return the default window rectangle

RECT CBaseWindow::GetDefaultRect()
{
    RECT DefaultRect = {0,0,DEFWIDTH,DEFHEIGHT};
    ASSERT(m_hwnd);
    // ASSERT(m_hdc);
    return DefaultRect;
}


// Return the current window width

LONG CBaseWindow::GetWindowWidth()
{
    ASSERT(m_hwnd);
    // ASSERT(m_hdc);
    return m_Width;
}


// Return the current window height

LONG CBaseWindow::GetWindowHeight()
{
    ASSERT(m_hwnd);
    // ASSERT(m_hdc);
    return m_Height;
}


// Return the window handle

HWND CBaseWindow::GetWindowHWND()
{
    ASSERT(m_hwnd);
    // ASSERT(m_hdc);
    return m_hwnd;
}


// Return the window drawing device context

HDC CBaseWindow::GetWindowHDC()
{
    ASSERT(m_hwnd);
    ASSERT(m_hdc);
    return m_hdc;
}


// Return the offscreen window drawing device context

HDC CBaseWindow::GetMemoryHDC()
{
    ASSERT(m_hwnd);
    ASSERT(m_MemoryDC);
    return m_MemoryDC;
}


#ifdef DEBUG
HPALETTE CBaseWindow::GetPalette()
{
    // The palette lock should always be held when accessing
    // m_hPalette.
    ASSERT(CritCheckIn(&m_PaletteLock));
    return m_hPalette;
}
#endif // DEBUG


// This is available to clients who want to change the window visiblity. It's
// little more than an indirection to the Win32 ShowWindow although these is
// some benefit in going through here as this function may change sometime

HRESULT CBaseWindow::DoShowWindow(LONG ShowCmd)
{
    ShowWindow(m_hwnd,ShowCmd);
    return NOERROR;
}


// Generate a WM_PAINT message for the video window

void CBaseWindow::PaintWindow(BOOL bErase)
{
    InvalidateRect(m_hwnd,NULL,bErase);
}


// Allow an application to have us set the video window in the foreground. We
// have this because it is difficult for one thread to do do this to a window
// owned by another thread. Rather than expose the message we use to execute
// the inter thread send message we provide the interface function. All we do
// is to SendMessage to the video window renderer thread with a WM_SHOWSTAGE

void CBaseWindow::DoSetWindowForeground(BOOL bFocus)
{
    SendMessage(m_hwnd,m_ShowStageMessage,(WPARAM) bFocus,(LPARAM) 0);
}


// Constructor initialises the owning object pointer. Since we are a worker
// class for the main window object we have relatively few state variables to
// look after. We are given device context handles to use later on as well as
// the source and destination rectangles (but reset them here just in case)

CDrawImage::CDrawImage(CBaseWindow *pBaseWindow) :
    m_pBaseWindow(pBaseWindow),
    m_hdc(NULL),
    m_MemoryDC(NULL),
    m_bStretch(FALSE),
    m_pMediaType(NULL),
    m_bUsingImageAllocator(FALSE)
{
    ASSERT(pBaseWindow);
    ResetPaletteVersion();
    SetRectEmpty(&m_TargetRect);
    SetRectEmpty(&m_SourceRect);

    m_perfidRenderTime = MSR_REGISTER(TEXT("Single Blt time"));
}


// Overlay the image time stamps on the picture. Access to this method is
// serialised by the caller. We display the sample start and end times on
// top of the video using TextOut on the device context we are handed. If
// there isn't enough room in the window for the times we don't show them

void CDrawImage::DisplaySampleTimes(IMediaSample *pSample)
{
#ifdef DEBUG
    //
    // Only allow the "annoying" time messages if the users has turned the
    // logging "way up"
    //
    BOOL bAccept = DbgCheckModuleLevel(LOG_TRACE, 5);
    if (bAccept == FALSE) {
        return;
    }
#endif

    TCHAR szTimes[TIMELENGTH];      // Time stamp strings
    ASSERT(pSample);                // Quick sanity check
    RECT ClientRect;                // Client window size
    SIZE Size;                      // Size of text output

    // Get the time stamps and window size

    pSample->GetTime((REFERENCE_TIME*)&m_StartSample, (REFERENCE_TIME*)&m_EndSample);
    HWND hwnd = m_pBaseWindow->GetWindowHWND();
    EXECUTE_ASSERT(GetClientRect(hwnd,&ClientRect));

    // Format the sample time stamps

    wsprintf(szTimes,TEXT("%08d : %08d"),
             m_StartSample.Millisecs(),
             m_EndSample.Millisecs());

    ASSERT(lstrlen(szTimes) < TIMELENGTH);

    // Put the times in the middle at the bottom of the window

    GetTextExtentPoint32(m_hdc,szTimes,lstrlen(szTimes),&Size);
    INT XPos = ((ClientRect.right - ClientRect.left) - Size.cx) / 2;
    INT YPos = ((ClientRect.bottom - ClientRect.top) - Size.cy) * 4 / 5;

    // Check the window is big enough to have sample times displayed

    if ((XPos > 0) && (YPos > 0)) {
        TextOut(m_hdc,XPos,YPos,szTimes,lstrlen(szTimes));
    }
}


// This is called when the drawing code sees that the image has a down level
// palette cookie. We simply call the SetDIBColorTable Windows API with the
// palette that is found after the BITMAPINFOHEADER - we return no errors

void CDrawImage::UpdateColourTable(HDC hdc,BITMAPINFOHEADER *pbmi)
{
    ASSERT(pbmi->biClrUsed);
    RGBQUAD *pColourTable = (RGBQUAD *)(pbmi+1);

    // Set the new palette in the device context

    UINT uiReturn = SetDIBColorTable(hdc,(UINT) 0,
                                     pbmi->biClrUsed,
                                     pColourTable);

    // Should always succeed but check in debug builds
    ASSERT(uiReturn == pbmi->biClrUsed);
}


// No source rectangle scaling is done by the base class

RECT CDrawImage::ScaleSourceRect(const RECT *pSource)
{
    ASSERT(pSource);
    return *pSource;
}


// This is called when the funky output pin uses our allocator. The samples we
// allocate are special because the memory is shared between us and GDI thus
// removing one copy when we ask for the image to be rendered. The source type
// information is in the main renderer m_mtIn field which is initialised when
// the media type is agreed in SetMediaType, the media type may be changed on
// the fly if, for example, the source filter needs to change the palette

void CDrawImage::FastRender(IMediaSample *pMediaSample)
{
    BITMAPINFOHEADER *pbmi;     // Image format data
    DIBDATA *pDibData;          // Stores DIB information
    BYTE *pImage;               // Pointer to image data
    HBITMAP hOldBitmap;         // Store the old bitmap
    CImageSample *pSample;      // Pointer to C++ object

    ASSERT(m_pMediaType);

    // From the untyped source format block get the VIDEOINFO and subsequently
    // the BITMAPINFOHEADER structure. We can cast the IMediaSample interface
    // to a CImageSample object so we can retrieve it's DIBSECTION details

    pbmi = HEADER(m_pMediaType->Format());
    pSample = (CImageSample *) pMediaSample;
    pDibData = pSample->GetDIBData();
    hOldBitmap = (HBITMAP) SelectObject(m_MemoryDC,pDibData->hBitmap);

    // Get a pointer to the real image data

    HRESULT hr = pMediaSample->GetPointer(&pImage);
    if (FAILED(hr)) {
        return;
    }

    // Do we need to update the colour table, we increment our palette cookie
    // each time we get a dynamic format change. The sample palette cookie is
    // stored in the DIBDATA structure so we try to keep the fields in sync
    // By the time we get to draw the images the format change will be done
    // so all we do is ask the renderer for what it's palette version is

    if (pDibData->PaletteVersion < GetPaletteVersion()) {
        ASSERT(pbmi->biBitCount <= iPALETTE);
        UpdateColourTable(m_MemoryDC,pbmi);
        pDibData->PaletteVersion = GetPaletteVersion();
    }

    // This allows derived classes to change the source rectangle that we do
    // the drawing with. For example a renderer may ask a codec to stretch
    // the video from 320x240 to 640x480, in which case the source we see in
    // here will still be 320x240, although the source we want to draw with
    // should be scaled up to 640x480. The base class implementation of this
    // method does nothing but return the same rectangle as we are passed in

    RECT SourceRect = ScaleSourceRect(&m_SourceRect);

    // Is the window the same size as the video

    if (m_bStretch == FALSE) {

        // Put the image straight into the window

        BitBlt(
            (HDC) m_hdc,                            // Target device HDC
            m_TargetRect.left,                      // X sink position
            m_TargetRect.top,                       // Y sink position
            m_TargetRect.right - m_TargetRect.left, // Destination width
            m_TargetRect.bottom - m_TargetRect.top, // Destination height
            m_MemoryDC,                             // Source device context
            SourceRect.left,                        // X source position
            SourceRect.top,                         // Y source position
            SRCCOPY);                               // Simple copy

    } else {

        // Stretch the image when copying to the window

        StretchBlt(
            (HDC) m_hdc,                            // Target device HDC
            m_TargetRect.left,                      // X sink position
            m_TargetRect.top,                       // Y sink position
            m_TargetRect.right - m_TargetRect.left, // Destination width
            m_TargetRect.bottom - m_TargetRect.top, // Destination height
            m_MemoryDC,                             // Source device HDC
            SourceRect.left,                        // X source position
            SourceRect.top,                         // Y source position
            SourceRect.right - SourceRect.left,     // Source width
            SourceRect.bottom - SourceRect.top,     // Source height
            SRCCOPY);                               // Simple copy
    }

    // This displays the sample times over the top of the image. This used to
    // draw the times into the offscreen device context however that actually
    // writes the text into the image data buffer which may not be writable

    #ifdef DEBUG
    DisplaySampleTimes(pMediaSample);
    #endif

    // Put the old bitmap back into the device context so we don't leak
    SelectObject(m_MemoryDC,hOldBitmap);
}


// This is called when there is a sample ready to be drawn, unfortunately the
// output pin was being rotten and didn't choose our super excellent shared
// memory DIB allocator so we have to do this slow render using boring old GDI
// SetDIBitsToDevice and StretchDIBits. The down side of using these GDI
// functions is that the image data has to be copied across from our address
// space into theirs before going to the screen (although in reality the cost
// is small because all they do is to map the buffer into their address space)

void CDrawImage::SlowRender(IMediaSample *pMediaSample)
{
    // Get the BITMAPINFOHEADER for the connection

    ASSERT(m_pMediaType);
    BITMAPINFOHEADER *pbmi = HEADER(m_pMediaType->Format());
    BYTE *pImage;

    // Get the image data buffer

    HRESULT hr = pMediaSample->GetPointer(&pImage);
    if (FAILED(hr)) {
        return;
    }

    // This allows derived classes to change the source rectangle that we do
    // the drawing with. For example a renderer may ask a codec to stretch
    // the video from 320x240 to 640x480, in which case the source we see in
    // here will still be 320x240, although the source we want to draw with
    // should be scaled up to 640x480. The base class implementation of this

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产午夜亚洲精品理论片色戒| 在线观看免费成人| 波多野结衣亚洲| 26uuu国产在线精品一区二区| 午夜视黄欧洲亚洲| 成人免费一区二区三区在线观看| 成人毛片在线观看| 亚洲精品写真福利| 欧美欧美欧美欧美首页| 日本不卡中文字幕| 国产日韩影视精品| 色综合久久66| 日一区二区三区| 亚洲视频免费看| 欧美一区二区福利在线| 国产乱妇无码大片在线观看| 亚洲女同ⅹxx女同tv| 久久精品一区二区三区四区| 国产精品系列在线| 精品日韩在线观看| 91福利视频网站| 成人免费毛片高清视频| 91亚洲精华国产精华精华液| 狠狠色丁香婷婷综合久久片| 亚洲精品国产品国语在线app| 亚洲在线中文字幕| 国产女主播一区| 一区二区在线观看免费视频播放| 奇米综合一区二区三区精品视频| 亚洲色图在线看| 日韩中文欧美在线| 成人sese在线| 国产99久久久久久免费看农村| 七七婷婷婷婷精品国产| 国产成人精品一区二区三区四区| 老司机精品视频导航| 三级一区在线视频先锋| 丁香网亚洲国际| 7777精品伊人久久久大香线蕉完整版 | 日韩欧美一区二区久久婷婷| 久久综合五月天婷婷伊人| 欧美激情艳妇裸体舞| 欧美videofree性高清杂交| 国产精品久久久久久久久免费相片 | 亚洲素人一区二区| 久久99最新地址| 欧美性欧美巨大黑白大战| 色琪琪一区二区三区亚洲区| 精品少妇一区二区三区| 亚洲午夜免费电影| 三级不卡在线观看| 一本大道av一区二区在线播放| wwwwww.欧美系列| 日本欧美一区二区三区| 色综合久久综合网欧美综合网| 91精品国产高清一区二区三区蜜臀| 国产精品妹子av| 久久国产欧美日韩精品| 欧美精品色综合| 欧美不卡123| 石原莉奈一区二区三区在线观看 | 欧美色区777第一页| 日韩一卡二卡三卡| 久久久亚洲国产美女国产盗摄| 久久久天堂av| 精品一区二区三区视频在线观看| 国产成人精品亚洲777人妖| 日韩三级伦理片妻子的秘密按摩| 亚洲国产视频一区| 色94色欧美sute亚洲线路二| 自拍偷拍国产精品| 成人美女在线观看| 国产精品久久久久aaaa| 国产成人综合在线观看| 亚洲国产精品精华液ab| 国产成人亚洲综合a∨婷婷| 久久无码av三级| 国产一区二区主播在线| 色婷婷精品久久二区二区蜜臀av| 国产精品每日更新| 91在线观看视频| 亚洲黄色片在线观看| 欧美在线|欧美| 亚洲成a人v欧美综合天堂下载| 国产综合色在线| 亚洲国产精品99久久久久久久久| 国产成人综合亚洲91猫咪| 国产欧美精品一区二区三区四区 | 在线不卡的av| 捆绑调教一区二区三区| 国产欧美一区二区三区在线老狼| 国产米奇在线777精品观看| 国产精品乱码久久久久久| caoporm超碰国产精品| 亚洲自拍偷拍九九九| 91精品国产综合久久精品麻豆| 免费观看成人av| 亚洲国产高清不卡| 欧美吻胸吃奶大尺度电影| 日精品一区二区三区| 久久久综合网站| 91丨porny丨蝌蚪视频| 亚洲一卡二卡三卡四卡五卡| 欧美日韩视频在线第一区| 久久机这里只有精品| 国产精品国产a级| 欧美日本高清视频在线观看| 韩国视频一区二区| 亚洲欧美另类久久久精品| 538在线一区二区精品国产| 国产乱妇无码大片在线观看| 一区二区三区在线免费| 成人一区二区视频| 亚洲高清一区二区三区| 国产午夜精品久久| 欧美高清精品3d| 风间由美性色一区二区三区| 亚洲成人自拍网| 中文字幕色av一区二区三区| 欧美区一区二区三区| av电影天堂一区二区在线 | 精品成人私密视频| 国产一区二区精品久久| 一区二区三区毛片| 国产欧美一区二区三区在线看蜜臀 | 国产精品99久久久久久久vr| 亚洲成人免费在线| 亚洲视频电影在线| 国产人成一区二区三区影院| 欧美色老头old∨ideo| 国产a精品视频| 国产一区二区三区在线观看免费| 亚洲国产精品久久久久婷婷884 | 成人免费的视频| 国产一区二区三区在线观看免费| 午夜精品一区在线观看| 亚洲免费av观看| 中文字幕字幕中文在线中不卡视频| 日韩一级二级三级精品视频| 欧美性高清videossexo| www.久久精品| av电影在线观看一区| 国产精品一区在线观看你懂的| 美女一区二区三区在线观看| 久久尤物电影视频在线观看| 欧美一区二区三区白人| 欧美疯狂做受xxxx富婆| 91福利社在线观看| 欧美色网站导航| 欧美伊人久久久久久久久影院| 91精品91久久久中77777| 91日韩在线专区| 日本韩国欧美在线| 欧美中文一区二区三区| 欧美性三三影院| 这里只有精品免费| 日韩精品一区二区三区视频在线观看 | 99久久国产综合色|国产精品| 亚洲国产日韩a在线播放性色| 亚洲伦理在线精品| 亚洲伊人伊色伊影伊综合网| 亚洲电影激情视频网站| 五月婷婷综合在线| 久久国产精品露脸对白| 国产精品亚洲视频| 91浏览器打开| 欧美日韩dvd在线观看| 91精品欧美综合在线观看最新 | 99re热视频这里只精品| 色噜噜狠狠成人中文综合| 欧美日韩一级视频| 日韩精品专区在线影院重磅| 久久久蜜桃精品| 亚洲人精品午夜| 青草国产精品久久久久久| 国产精品中文字幕欧美| 不卡av免费在线观看| 欧美三级在线视频| 精品国产sm最大网站免费看| 国产精品国产三级国产有无不卡| 亚洲一区在线播放| 国产一区二区三区香蕉| 色哟哟一区二区在线观看| 91精品国产91久久久久久最新毛片| 2020国产精品久久精品美国| 亚洲欧美一区二区三区久本道91| 日韩av在线发布| 不卡的av中国片| 日韩欧美国产综合一区| 综合色中文字幕| 麻豆免费看一区二区三区| 99国产精品视频免费观看| 91精品国产综合久久久久久久久久 | 久久精品国产99国产精品| 国产高清精品网站| 337p亚洲精品色噜噜狠狠| 国产精品美女久久久久av爽李琼 | 国产精品久久久久一区二区三区共| 亚洲一区二区影院| 成人午夜激情在线|