-
-
Notifications
You must be signed in to change notification settings - Fork 492
/
Copy pathPixelBuffer.h
52 lines (40 loc) · 1.24 KB
/
PixelBuffer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#pragma once
#include "PixelBuffer.g.h"
#include <winrt/Windows.UI.Xaml.Media.Imaging.h>
using namespace winrt::Windows::UI::Xaml::Media::Imaging;
using namespace winrt::Windows::Storage::Streams;
namespace winrt::Telegram::Native::implementation
{
#ifndef IBufferByteAccess_H
#define IBufferByteAccess_H
struct __declspec(uuid("905a0fef-bc53-11df-8c49-001e4fc686da")) IBufferByteAccess : ::IUnknown
{
virtual HRESULT __stdcall Buffer(uint8_t** value) = 0;
};
#endif
struct PixelBuffer : PixelBufferT<PixelBuffer, IBufferByteAccess>
{
PixelBuffer(WriteableBitmap bitmap);
~PixelBuffer();
uint32_t Capacity();
uint32_t Length();
void Length(uint32_t value);
HRESULT __stdcall Buffer(uint8_t** value);
int32_t PixelWidth() noexcept;
int32_t PixelHeight() noexcept;
WriteableBitmap Source() noexcept;
private:
WriteableBitmap m_bitmap;
uint8_t* m_pixels;
int32_t m_bitmapWidth;
int32_t m_bitmapHeight;
uint32_t m_capacity;
uint32_t m_length;
};
}
namespace winrt::Telegram::Native::factory_implementation
{
struct PixelBuffer : PixelBufferT<PixelBuffer, implementation::PixelBuffer>
{
};
}