blob: 487525bded76d0c61a497e19b732f112d522dc7d [file] [log] [blame]
José Fonsecac8695f72013-03-06 12:12:04 +00001/**************************************************************************
2 *
3 * Copyright 2013 VMware, Inc.
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE.
23 *
24 **************************************************************************/
25
Jose Fonseca9653f952015-05-19 16:32:43 +010026#pragma once
José Fonsecac8695f72013-03-06 12:12:04 +000027
28
29#include <windows.h>
30
Jose Fonseca71a85c92016-02-25 21:37:42 +000031#include "winsdk_compat.h"
José Fonsecac8695f72013-03-06 12:12:04 +000032
33#include <dxgi.h>
34
35
José Fonseca283551a2013-07-03 15:48:30 +010036#ifndef ARRAYSIZE
37#define ARRAYSIZE(_x) (sizeof(_x)/sizeof((_x)[0]))
38#endif
39
40
José Fonsecabbb9eb32013-04-16 19:38:00 +010041namespace image {
42 class Image;
43}
44
45
José Fonsecac8695f72013-03-06 12:12:04 +000046namespace d3dstate {
47
48
49HRESULT
50ConvertFormat(DXGI_FORMAT SrcFormat,
51 void *SrcData,
52 UINT SrcPitch,
53 DXGI_FORMAT DstFormat,
54 void *DstData,
55 UINT DstPitch,
56 UINT Width, UINT Height);
57
José Fonsecabbb9eb32013-04-16 19:38:00 +010058image::Image *
59ConvertImage(DXGI_FORMAT SrcFormat,
60 void *SrcData,
61 UINT SrcPitch,
Zack Rusin4a7a0612018-07-03 20:34:36 -040062 UINT Width, UINT Height,
Jose Fonseca9383c672018-07-04 16:32:50 +010063 bool isDepthStencil);
José Fonsecabbb9eb32013-04-16 19:38:00 +010064
José Fonsecac8695f72013-03-06 12:12:04 +000065
José Fonseca29d4bda2014-02-28 17:50:24 +000066image::Image *
67getRenderTargetImage(IDXGISwapChain *pSwapChain);
68
Zack Rusin86bd4992015-03-03 21:50:43 -050069std::string
70getDXGIFormatName(DXGI_FORMAT format);
71
José Fonseca29d4bda2014-02-28 17:50:24 +000072
José Fonsecac8695f72013-03-06 12:12:04 +000073} /* namespace d3dstate */
74
75