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

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

?? amvideo.cpp

?? 用DirectX制作高級動畫-[Advanced.Animation.with.DirectX]
?? CPP
字號:
//------------------------------------------------------------------------------
// File: AMVideo.cpp
//
// Desc: DirectShow base classes - implements helper functions for
//       bitmap formats.
//
// Copyright (c) 1992-2002 Microsoft Corporation.  All rights reserved.
//------------------------------------------------------------------------------


#include <streams.h>
#include <limits.h>

// These are bit field masks for true colour devices

const DWORD bits555[] = {0x007C00,0x0003E0,0x00001F};
const DWORD bits565[] = {0x00F800,0x0007E0,0x00001F};
const DWORD bits888[] = {0xFF0000,0x00FF00,0x0000FF};

// This maps bitmap subtypes into a bits per pixel value and also a
// name. unicode and ansi versions are stored because we have to
// return a pointer to a static string.
const struct {
    const GUID *pSubtype;
    WORD BitCount;
    CHAR *pName;
    WCHAR *wszName;
} BitCountMap[] =  { &MEDIASUBTYPE_RGB1,        1,   "RGB Monochrome",     L"RGB Monochrome",   
                     &MEDIASUBTYPE_RGB4,        4,   "RGB VGA",            L"RGB VGA",          
                     &MEDIASUBTYPE_RGB8,        8,   "RGB 8",              L"RGB 8",            
                     &MEDIASUBTYPE_RGB565,      16,  "RGB 565 (16 bit)",   L"RGB 565 (16 bit)", 
                     &MEDIASUBTYPE_RGB555,      16,  "RGB 555 (16 bit)",   L"RGB 555 (16 bit)", 
                     &MEDIASUBTYPE_RGB24,       24,  "RGB 24",             L"RGB 24",           
                     &MEDIASUBTYPE_RGB32,       32,  "RGB 32",             L"RGB 32",
                     &MEDIASUBTYPE_ARGB32,    32,  "ARGB 32",             L"ARGB 32",
                     &MEDIASUBTYPE_Overlay,     0,   "Overlay",            L"Overlay",          
                     &GUID_NULL,                0,   "UNKNOWN",            L"UNKNOWN"           
};

// Return the size of the bitmap as defined by this header

STDAPI_(DWORD) GetBitmapSize(const BITMAPINFOHEADER *pHeader)
{
    return DIBSIZE(*pHeader);
}


// This is called if the header has a 16 bit colour depth and needs to work
// out the detailed type from the bit fields (either RGB 565 or RGB 555)

STDAPI_(const GUID) GetTrueColorType(const BITMAPINFOHEADER *pbmiHeader)
{
    BITMAPINFO *pbmInfo = (BITMAPINFO *) pbmiHeader;
    ASSERT(pbmiHeader->biBitCount == 16);

    // If its BI_RGB then it's RGB 555 by default

    if (pbmiHeader->biCompression == BI_RGB) {
        return MEDIASUBTYPE_RGB555;
    }

    // Compare the bit fields with RGB 555

    DWORD *pMask = (DWORD *) pbmInfo->bmiColors;
    if (pMask[0] == bits555[0]) {
        if (pMask[1] == bits555[1]) {
            if (pMask[2] == bits555[2]) {
                return MEDIASUBTYPE_RGB555;
            }
        }
    }

    // Compare the bit fields with RGB 565

    pMask = (DWORD *) pbmInfo->bmiColors;
    if (pMask[0] == bits565[0]) {
        if (pMask[1] == bits565[1]) {
            if (pMask[2] == bits565[2]) {
                return MEDIASUBTYPE_RGB565;
            }
        }
    }
    return GUID_NULL;
}


// Given a BITMAPINFOHEADER structure this returns the GUID sub type that is
// used to describe it in format negotiations. For example a video codec fills
// in the format block with a VIDEOINFO structure, it also fills in the major
// type with MEDIATYPE_VIDEO and the subtype with a GUID that matches the bit
// count, for example if it is an eight bit image then MEDIASUBTYPE_RGB8

STDAPI_(const GUID) GetBitmapSubtype(const BITMAPINFOHEADER *pbmiHeader)
{
    ASSERT(pbmiHeader);

    // If it's not RGB then create a GUID from the compression type

    if (pbmiHeader->biCompression != BI_RGB) {
        if (pbmiHeader->biCompression != BI_BITFIELDS) {
            FOURCCMap FourCCMap(pbmiHeader->biCompression);
            return (const GUID) FourCCMap;
        }
    }

    // Map the RGB DIB bit depth to a image GUID

    switch(pbmiHeader->biBitCount) {
        case 1    :   return MEDIASUBTYPE_RGB1;
        case 4    :   return MEDIASUBTYPE_RGB4;
        case 8    :   return MEDIASUBTYPE_RGB8;
        case 16   :   return GetTrueColorType(pbmiHeader);
        case 24   :   return MEDIASUBTYPE_RGB24;
        case 32   :   return MEDIASUBTYPE_RGB32;
    }
    return GUID_NULL;
}


// Given a video bitmap subtype we return the number of bits per pixel it uses
// We return a WORD bit count as thats what the BITMAPINFOHEADER uses. If the
// GUID subtype is not found in the table we return an invalid USHRT_MAX

STDAPI_(WORD) GetBitCount(const GUID *pSubtype)
{
    ASSERT(pSubtype);
    const GUID *pMediaSubtype;
    INT iPosition = 0;

    // Scan the mapping list seeing if the source GUID matches any known
    // bitmap subtypes, the list is terminated by a GUID_NULL entry

    while (TRUE) {
        pMediaSubtype = BitCountMap[iPosition].pSubtype;
        if (IsEqualGUID(*pMediaSubtype,GUID_NULL)) {
            return USHRT_MAX;
        }
        if (IsEqualGUID(*pMediaSubtype,*pSubtype)) {
            return BitCountMap[iPosition].BitCount;
        }
        iPosition++;
    }
}


// Given a bitmap subtype we return a description name that can be used for
// debug purposes. In a retail build this function still returns the names
// If the subtype isn't found in the lookup table we return string UNKNOWN

int LocateSubtype(const GUID *pSubtype)
{
    ASSERT(pSubtype);
    const GUID *pMediaSubtype;
    INT iPosition = 0;

    // Scan the mapping list seeing if the source GUID matches any known
    // bitmap subtypes, the list is terminated by a GUID_NULL entry

    while (TRUE) {
        pMediaSubtype = BitCountMap[iPosition].pSubtype;
        if (IsEqualGUID(*pMediaSubtype,*pSubtype) ||
            IsEqualGUID(*pMediaSubtype,GUID_NULL)
            )
        {
            break;
        }
        
        iPosition++;
    }

    return iPosition;
}



STDAPI_(WCHAR *) GetSubtypeNameW(const GUID *pSubtype)
{
    return BitCountMap[LocateSubtype(pSubtype)].wszName;
}

STDAPI_(CHAR *) GetSubtypeNameA(const GUID *pSubtype)
{
    return BitCountMap[LocateSubtype(pSubtype)].pName;
}

#ifndef GetSubtypeName
#error wxutil.h should have defined GetSubtypeName
#endif
#undef GetSubtypeName

// this is here for people that linked to it directly; most people
// would use the header file that picks the A or W version.
STDAPI_(CHAR *) GetSubtypeName(const GUID *pSubtype)
{
    return GetSubtypeNameA(pSubtype);
}


// The mechanism for describing a bitmap format is with the BITMAPINFOHEADER
// This is really messy to deal with because it invariably has fields that
// follow it holding bit fields, palettes and the rest. This function gives
// the number of bytes required to hold a VIDEOINFO that represents it. This
// count includes the prefix information (like the rcSource rectangle) the
// BITMAPINFOHEADER field, and any other colour information on the end.
//
// WARNING If you want to copy a BITMAPINFOHEADER into a VIDEOINFO always make
// sure that you use the HEADER macro because the BITMAPINFOHEADER field isn't
// right at the start of the VIDEOINFO (there are a number of other fields),
//
//     CopyMemory(HEADER(pVideoInfo),pbmi,sizeof(BITMAPINFOHEADER));
//

STDAPI_(LONG) GetBitmapFormatSize(const BITMAPINFOHEADER *pHeader)
{
    // Everyone has this to start with this  
    LONG Size = SIZE_PREHEADER + pHeader->biSize;

    ASSERT(pHeader->biSize >= sizeof(BITMAPINFOHEADER));
    
    // Does this format use a palette, if the number of colours actually used
    // is zero then it is set to the maximum that are allowed for that colour
    // depth (an example is 256 for eight bits). Truecolour formats may also
    // pass a palette with them in which case the used count is non zero

    // This would scare me.
    ASSERT(pHeader->biBitCount <= iPALETTE || pHeader->biClrUsed == 0);

    if (pHeader->biBitCount <= iPALETTE || pHeader->biClrUsed) {
        LONG Entries = (DWORD) 1 << pHeader->biBitCount;
        if (pHeader->biClrUsed) {
            Entries = pHeader->biClrUsed;
        }
        Size += Entries * sizeof(RGBQUAD);
    }

    // Truecolour formats may have a BI_BITFIELDS specifier for compression
    // type which means that room for three DWORDs should be allocated that
    // specify where in each pixel the RGB colour components may be found

    if (pHeader->biCompression == BI_BITFIELDS) {
        Size += SIZE_MASKS;
    }

    // A BITMAPINFO for a palettised image may also contain a palette map that
    // provides the information to map from a source palette to a destination
    // palette during a BitBlt for example, because this information is only
    // ever processed during drawing you don't normally store the palette map
    // nor have any way of knowing if it is present in the data structure

    return Size;
}


// Returns TRUE if the VIDEOINFO contains a palette

STDAPI_(BOOL) ContainsPalette(const VIDEOINFOHEADER *pVideoInfo)
{
    if (PALETTISED(pVideoInfo) == FALSE) {
        if (pVideoInfo->bmiHeader.biClrUsed == 0) {
            return FALSE;
        }
    }
    return TRUE;
}


// Return a pointer to the first entry in a palette

STDAPI_(const RGBQUAD *) GetBitmapPalette(const VIDEOINFOHEADER *pVideoInfo)
{
    if (pVideoInfo->bmiHeader.biCompression == BI_BITFIELDS) {
        return TRUECOLOR(pVideoInfo)->bmiColors;
    }
    return COLORS(pVideoInfo);
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品三级日韩久久| 国产一区二区免费视频| 色域天天综合网| 成人免费视频在线观看| 97精品国产露脸对白| 亚洲三级电影网站| 欧美日韩一区三区四区| 日韩精品视频网| 精品国产一区二区三区忘忧草| 极品尤物av久久免费看| 亚洲精品一区二区三区蜜桃下载 | 国产精品网站在线| 不卡av免费在线观看| 亚洲精品中文在线影院| 欧美日韩国产精品自在自线| 精品亚洲porn| 亚洲婷婷在线视频| 91精品国产欧美一区二区18 | 久草在线在线精品观看| 国产欧美一区二区精品忘忧草| proumb性欧美在线观看| 亚洲18色成人| 久久久国产精品午夜一区ai换脸| 北条麻妃国产九九精品视频| 亚洲自拍偷拍av| 亚洲精品在线观看视频| 一本高清dvd不卡在线观看| 日本不卡不码高清免费观看| 欧美国产激情一区二区三区蜜月| 色婷婷综合五月| 激情五月婷婷综合| 一区二区三区av电影| 精品成人一区二区三区| 色综合久久天天| 国产乱子伦视频一区二区三区| 一区二区三区四区国产精品| 久久综合九色综合97婷婷女人| 一本大道av一区二区在线播放| 精品一区二区三区免费| 亚洲综合丁香婷婷六月香| 国产日韩精品一区| 91精品午夜视频| 色猫猫国产区一区二在线视频| 激情综合色播激情啊| 天堂精品中文字幕在线| 亚洲欧洲av一区二区三区久久| 欧美成人免费网站| 欧美日韩国产成人在线免费| av男人天堂一区| 激情丁香综合五月| 日本一不卡视频| 亚洲综合色网站| 亚洲女爱视频在线| 日本一区二区三区在线观看| 欧美本精品男人aⅴ天堂| 精品国产成人系列| 欧美性欧美巨大黑白大战| 成人精品国产福利| 国产一区二区免费看| 久久av资源网| 免费视频最近日韩| 日本vs亚洲vs韩国一区三区二区 | 91啪亚洲精品| 粉嫩av一区二区三区粉嫩| 久久aⅴ国产欧美74aaa| 日本午夜精品视频在线观看| 亚洲一区成人在线| 一个色在线综合| 亚洲日穴在线视频| 亚洲欧美一区二区三区久本道91| 欧美激情在线一区二区三区| 久久久久9999亚洲精品| 久久久噜噜噜久噜久久综合| 欧美精品一区二区三区四区| 日韩色视频在线观看| 日韩三区在线观看| 精品欧美一区二区久久| 欧美va天堂va视频va在线| 日韩欧美黄色影院| 精品久久久久久久一区二区蜜臀| 日韩视频一区二区三区在线播放 | 91在线免费视频观看| 99re在线视频这里只有精品| 成人sese在线| 色综合久久66| 7777女厕盗摄久久久| 91精品国产综合久久小美女| 亚洲免费观看在线观看| 亚洲欧美综合另类在线卡通| |精品福利一区二区三区| 日韩美女啊v在线免费观看| 一区二区三区成人| 日韩精品免费专区| 黑人巨大精品欧美黑白配亚洲 | 国产大片一区二区| 成人免费毛片a| 99精品国产一区二区三区不卡| 91在线丨porny丨国产| 欧美三级视频在线播放| 日韩欧美国产综合| 国产精品网曝门| 亚洲高清在线精品| 91蜜桃在线免费视频| 日本高清不卡视频| 884aa四虎影成人精品一区| 日韩美女天天操| 国产午夜精品在线观看| 亚洲女人****多毛耸耸8| 亚洲18影院在线观看| 国产精品影视网| 色视频一区二区| 91精品婷婷国产综合久久竹菊| 久久综合久久综合久久综合| 国产精品久久三| 日韩精品福利网| 国产麻豆精品久久一二三| 色狠狠色狠狠综合| 日韩精品一区二区在线| 亚洲图片另类小说| 久久国产福利国产秒拍| 99精品久久免费看蜜臀剧情介绍| 在线成人高清不卡| 国产精品久久久久久久久果冻传媒| 亚洲伦理在线免费看| 久久97超碰国产精品超碰| 色婷婷香蕉在线一区二区| 精品久久久久久综合日本欧美| 亚洲免费成人av| 国产河南妇女毛片精品久久久 | 国产一区 二区 三区一级| 日本电影欧美片| 亚洲精品一区二区三区四区高清| 亚洲乱码中文字幕| 国产精品66部| 欧美一区二区三区系列电影| 中文字幕一区三区| 国产一区不卡精品| 欧美一级专区免费大片| 一区二区在线电影| 成人一区在线观看| 欧美成人vps| 午夜av电影一区| 色狠狠一区二区三区香蕉| 国产欧美日韩中文久久| 久久精品国产一区二区三| 欧美亚洲综合另类| 亚洲人成网站色在线观看| 粉嫩久久99精品久久久久久夜 | 色狠狠桃花综合| 中文字幕中文在线不卡住| 激情五月播播久久久精品| 欧美一级片免费看| 午夜激情综合网| 欧美亚洲禁片免费| 亚洲欧美日韩人成在线播放| 成人小视频在线| 国产精品区一区二区三区 | 国产高清久久久久| 精品少妇一区二区三区日产乱码| 视频一区国产视频| 欧美日韩久久久一区| 亚洲一区二区三区在线播放| 91日韩一区二区三区| 亚洲精品亚洲人成人网在线播放| av在线不卡观看免费观看| 中文字幕色av一区二区三区| 国产91高潮流白浆在线麻豆 | 欧美亚洲动漫精品| 一区二区三区在线观看网站| 色婷婷综合激情| 丰满少妇久久久久久久| 久久先锋影音av鲁色资源| 国产乱码精品1区2区3区| 亚洲国产精品二十页| 成人手机在线视频| 国产精品短视频| 色呦呦国产精品| 午夜精品成人在线视频| 5566中文字幕一区二区电影| 蜜桃在线一区二区三区| 欧美变态tickle挠乳网站| 国产一区三区三区| 国产精品美女久久久久aⅴ国产馆| heyzo一本久久综合| 亚洲女与黑人做爰| 精品视频1区2区3区| 麻豆91在线看| 中文字幕二三区不卡| 色视频成人在线观看免| 全国精品久久少妇| 久久免费电影网| 91浏览器在线视频| 三级成人在线视频| 国产日韩欧美精品综合| 色哟哟一区二区| 久久精品国产一区二区三区免费看| 久久久久久久综合色一本| 91网站在线观看视频| 日日夜夜一区二区| 欧美国产激情二区三区|