Blender  V3.3
blendthumb.hh
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2008-2021 Blender Foundation. All rights reserved. */
3 
12 #pragma once
13 
14 #include <optional>
15 
16 #include "BLI_array.hh"
17 #include "BLI_vector.hh"
18 
19 struct FileReader;
20 
21 struct Thumbnail {
23  int width;
24  int height;
25 };
26 
28  BT_OK = 0,
35  BT_ERROR = 9
36 };
37 
38 std::optional<blender::Vector<uint8_t>> blendthumb_create_png_data_from_thumb(
39  const Thumbnail *thumb);
45 
46 /* INTEGER CODES */
47 #ifdef __BIG_ENDIAN__
48 /* Big Endian */
49 # define MAKE_ID(a, b, c, d) ((int)(a) << 24 | (int)(b) << 16 | (c) << 8 | (d))
50 #else
51 /* Little Endian */
52 # define MAKE_ID(a, b, c, d) ((int)(d) << 24 | (int)(c) << 16 | (b) << 8 | (a))
53 #endif
eThumbStatus
Definition: blendthumb.hh:27
@ BT_COMPRES_ERR
Definition: blendthumb.hh:30
@ BT_EARLY_VERSION
Definition: blendthumb.hh:33
@ BT_INVALID_FILE
Definition: blendthumb.hh:32
@ BT_ERROR
Definition: blendthumb.hh:35
@ BT_FILE_ERR
Definition: blendthumb.hh:29
@ BT_INVALID_THUMB
Definition: blendthumb.hh:34
@ BT_DECOMPRESS_ERR
Definition: blendthumb.hh:31
@ BT_OK
Definition: blendthumb.hh:28
std::optional< blender::Vector< uint8_t > > blendthumb_create_png_data_from_thumb(const Thumbnail *thumb)
eThumbStatus blendthumb_create_thumb_from_file(struct FileReader *rawfile, Thumbnail *thumb)
blender::Array< uint8_t > data
Definition: blendthumb.hh:22
int height
Definition: blendthumb.hh:24