17#include "nanosvgrast.h"
23 const size_t max_thumb_size,
28 NSVGimage *
image = nsvgParseFromFile(filepath,
"px", 96.0f);
30 if (
image ==
nullptr) {
40 int h = int(
image->height);
44 *r_height = size_t(h);
46 NSVGrasterizer *rast = nsvgCreateRasterizer();
47 if (rast ==
nullptr) {
52 const float scale =
float(max_thumb_size) / std::max(
w, h);
53 const int dest_w = std::max(
int(
w *
scale), 1);
54 const int dest_h = std::max(
int(h *
scale), 1);
57 if (ibuf !=
nullptr) {
63 nsvgDeleteRasterizer(rast);
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
float3x3 scale(float3x3 mat, float2 scale)
void IMB_flipy(ImBuf *ibuf)
ImBuf * IMB_allocImBuf(unsigned int x, unsigned int y, ImBufFlags flags)
ImBuf * imb_load_filepath_thumbnail_svg(const char *filepath, const ImBufFlags, const size_t max_thumb_size, ImFileColorSpace &, size_t *r_width, size_t *r_height)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
uint8_t * byte_data_for_write()