Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add um::d2d1_1 / rep um::wincodec, more #409

Merged
merged 24 commits into from
Mar 26, 2017
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 17 additions & 33 deletions src/um/d2d1_1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -836,36 +836,20 @@ interface ID2D1Multithread(ID2D1MultithreadVtbl): IUnknown(IUnknownVtbl) {
fn Leave() -> c_void
});

EXTERN!{stdcall fn D2D1CreateDevice(
dxgiDevice: *const IDXGIDevice,
creationProperties: *const D2D1_CREATION_PROPERTIES,
d2dDevice: *mut *mut ID2D1Device
) -> HRESULT}

EXTERN!{stdcall fn D2D1CreateDeviceContext(
dxgiSurface: *const IDXGISurface,
creationProperties: *const D2D1_CREATION_PROPERTIES,
d2dDeviceContext: *mut *mut ID2D1DeviceContext
) -> HRESULT}

EXTERN!{stdcall fn D2D1ConvertColorSpace(
sourceColorSpace: D2D1_COLOR_SPACE,
destinationColorSpace: D2D1_COLOR_SPACE,
color: *const D2D1_COLOR_F
) -> D2D1_COLOR_F}

EXTERN!{stdcall fn D2D1SinCos(
angle: FLOAT,
s: *mut FLOAT,
c: *mut FLOAT
) -> c_void}

EXTERN!{stdcall fn D2D1Tan(
angle: FLOAT
) -> FLOAT}

EXTERN!{stdcall fn D2D1Vec3Length(
x: FLOAT,
y: FLOAT,
z: FLOAT
) -> FLOAT}
extern "system" {
pub fn D2D1CreateDevice(dxgiDevice: *const IDXGIDevice,
creationProperties: *const D2D1_CREATION_PROPERTIES,
d2dDevice: *mut *mut ID2D1Device)
-> HRESULT;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Block indentation please!

pub fn D2D1CreateDeviceContext(dxgiSurface: *const IDXGISurface,
creationProperties: *const D2D1_CREATION_PROPERTIES,
d2dDeviceContext: *mut *mut ID2D1DeviceContext)
-> HRESULT;
pub fn D2D1ConvertColorSpace(sourceColorSpace: D2D1_COLOR_SPACE,
destinationColorSpace: D2D1_COLOR_SPACE,
color: *const D2D1_COLOR_F)
-> D2D1_COLOR_F;
pub fn D2D1SinCos(angle: FLOAT, s: *mut FLOAT, c: *mut FLOAT) -> c_void;
pub fn D2D1Tan(angle: FLOAT) -> FLOAT;
pub fn D2D1Vec3Length(x: FLOAT, y: FLOAT, z: FLOAT) -> FLOAT;
}
81 changes: 35 additions & 46 deletions src/um/wincodec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1514,52 +1514,41 @@ interface IWICImagingFactory2(IWICImagingFactory2Vtbl) : IWICImagingFactory(IWIC
) -> HRESULT
});

EXTERN!{stdcall fn WICConvertBitmapSource(
dstFormat: REFWICPixelFormatGUID,
pISrc: *const IWICBitmapSource,
ppIDst: *mut *mut IWICBitmapSource
) -> HRESULT}

EXTERN!{stdcall fn WICCreateBitmapFromSection(
width: UINT,
height: UINT,
pixelFormat: REFWICPixelFormatGUID,
hSection: HANDLE,
stride: UINT,
offset: UINT,
ppIBitmap: *mut *mut IWICBitmap
) -> HRESULT}

EXTERN!{stdcall fn WICCreateBitmapFromSectionEx(
width: UINT,
height: UINT,
pixelFormat: REFWICPixelFormatGUID,
hSection: HANDLE,
stride: UINT,
offset: UINT,
desiredAccessLevel: WICSectionAccessLevel,
ppIBitmap: *mut *mut IWICBitmap
) -> HRESULT}

EXTERN!{stdcall fn WICMapGuidToShortName(
guid: REFGUID,
cchName: UINT,
wzName: *mut WCHAR,
pcchActual: *mut UINT
) -> HRESULT}

EXTERN!{stdcall fn WICMapShortNameToGuid(
wzName: PCWSTR,
pguid: *mut GUID
) -> HRESULT}

EXTERN!{stdcall fn WICMapSchemaToName(
guidMetadataFormat: REFGUID,
pwzSchema: LPWSTR,
cchName: UINT,
wzName: *mut WCHAR,
pcchActual: *mut UINT
) -> HRESULT}
extern "system" {
pub fn WICConvertBitmapSource(dstFormat: REFWICPixelFormatGUID,
pISrc: *const IWICBitmapSource,
ppIDst: *mut *mut IWICBitmapSource)
-> HRESULT;
pub fn WICCreateBitmapFromSection(width: UINT,
height: UINT,
pixelFormat: REFWICPixelFormatGUID,
hSection: HANDLE,
stride: UINT,
offset: UINT,
ppIBitmap: *mut *mut IWICBitmap)
-> HRESULT;
pub fn WICCreateBitmapFromSectionEx(width: UINT,
height: UINT,
pixelFormat: REFWICPixelFormatGUID,
hSection: HANDLE,
stride: UINT,
offset: UINT,
desiredAccessLevel: WICSectionAccessLevel,
ppIBitmap: *mut *mut IWICBitmap)
-> HRESULT;
pub fn WICMapGuidToShortName(guid: REFGUID,
cchName: UINT,
wzName: *mut WCHAR,
pcchActual: *mut UINT)
-> HRESULT;
pub fn WICMapShortNameToGuid(wzName: PCWSTR, pguid: *mut GUID) -> HRESULT;
pub fn WICMapSchemaToName(guidMetadataFormat: REFGUID,
pwzSchema: LPWSTR,
cchName: UINT,
wzName: *mut WCHAR,
pcchActual: *mut UINT)
-> HRESULT;
}

pub const FACILITY_WINCODEC_ERR: HRESULT = 0x898;
pub const WINCODEC_ERR_BASE: HRESULT = 0x2000;
Expand Down