-
Notifications
You must be signed in to change notification settings - Fork 90
/
clip_win_wic.h
76 lines (53 loc) · 2.02 KB
/
clip_win_wic.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// Clip Library
// Copyright (c) 2020-2024 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
#ifndef CLIP_WIN_WIC_H_INCLUDED
#define CLIP_WIN_WIC_H_INCLUDED
#pragma once
#if !CLIP_ENABLE_IMAGE
#error This file can be include only when CLIP_ENABLE_IMAGE is defined
#endif
#include <cstdint>
#include <windows.h>
namespace clip {
class image;
struct image_spec;
namespace win {
typedef bool (*ReadWicImageFormatFunc)(const uint8_t*,
const UINT,
clip::image*,
clip::image_spec*);
ReadWicImageFormatFunc wic_image_format_available(UINT* output_cbformat);
//////////////////////////////////////////////////////////////////////
// Encode the image as PNG format
bool write_png_on_stream(const image& image, IStream* stream);
HGLOBAL write_png(const image& image);
//////////////////////////////////////////////////////////////////////
// Decode the clipboard data from PNG format
bool read_png(const uint8_t* buf,
const UINT len,
image* output_image,
image_spec* output_spec);
//////////////////////////////////////////////////////////////////////
// Decode the clipboard data from JPEG format
bool read_jpg(const uint8_t* buf,
const UINT len,
image* output_image,
image_spec* output_spec);
//////////////////////////////////////////////////////////////////////
// Decode the clipboard data from GIF format
bool read_gif(const uint8_t* buf,
const UINT len,
image* output_image,
image_spec* output_spec);
//////////////////////////////////////////////////////////////////////
// Decode the clipboard data from BMP format
bool read_bmp(const uint8_t* buf,
const UINT len,
image* output_image,
image_spec* output_spec);
} // namespace win
} // namespace clip
#endif // CLIP_WIN_WIC_H_INCLUDED