UI: SVG Thumbnails #109567
|
@ -18,6 +18,7 @@ endif()
|
|||
|
||||
|
||||
add_subdirectory(rangetree)
|
||||
add_subdirectory(nanosvg)
|
||||
add_subdirectory(wcwidth)
|
||||
|
||||
if(WITH_BULLET)
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
# SPDX-FileCopyrightText: 2002-2022 Blender Foundation
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
set(INC
|
||||
PUBLIC .
|
||||
../../source/blender/blenlib
|
||||
)
|
||||
|
||||
set(SRC
|
||||
nanosvg.h
|
||||
nanosvgrast.h
|
||||
blender_nanosvg.c
|
||||
blender_raster.c
|
||||
)
|
||||
|
||||
set(LIB
|
||||
)
|
||||
|
||||
blender_add_lib(extern_nanosvg "${SRC}" "${INC}" "" "${LIB}")
|
||||
add_library(bf::extern::nanosvg ALIAS extern_nanosvg)
|
|
@ -0,0 +1,10 @@
|
|||
/* SPDX-FileCopyrightText: 2023 Blender Foundation
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#define NANOSVG_IMPLEMENTATION
|
||||
#define NANOSVG_ALL_COLOR_KEYWORDS
|
||||
|
||||
#include <stdio.h>
|
||||
#include "BLI_utildefines.h"
|
||||
#include "nanosvg.h"
|
|
@ -0,0 +1,6 @@
|
|||
/* SPDX-FileCopyrightText: 2023 Blender Foundation
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#define NANOSVGRAST_IMPLEMENTATION
|
||||
#include "nanosvgrast.h"
|
|
@ -84,6 +84,7 @@ set(LIB
|
|||
bf_intern_guardedalloc
|
||||
bf_intern_memutil
|
||||
bf_intern_opencolorio
|
||||
PRIVATE bf::extern::nanosvg
|
||||
|
||||
${JPEG_LIBRARIES}
|
||||
)
|
||||
|
|
|
@ -14,13 +14,8 @@
|
|||
#include "IMB_colormanagement.h"
|
||||
#include "IMB_filetype.h"
|
||||
#include "IMB_imbuf_types.h"
|
||||
Harley marked this conversation as resolved
|
||||
|
||||
/* Custom flags for NanoSVG. */
|
||||
#define NANOSVG_ALL_COLOR_KEYWORDS
|
||||
#define NANOSVG_IMPLEMENTATION
|
||||
#define NANOSVGRAST_IMPLEMENTATION
|
||||
|
||||
#include "../../../extern/nanosvg/nanosvgrast.h"
|
||||
#include "nanosvg.h"
|
||||
#include "nanosvgrast.h"
|
||||
Harley marked this conversation as resolved
Outdated
Campbell Barton
commented
Also note here, that only thumbnails are supported and why. Also note here, that only thumbnails are supported and why.
Campbell Barton
commented
It's not so obvious where this kind of info should be included, I'd prefer the file header, as this comment isn't a doc-string for the function, e.g.
It's not so obvious where this kind of info should be included, I'd prefer the file header, as this comment isn't a doc-string for the function, e.g.
```
/* SPDX-FileCopyrightText: 2023 Blender Foundation
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup imbuf
*
* SVG vector graphics format support for the purpose of thumbnail-display.
* While loading these as an #ImBuf is trivial to support, it would expose
* limitations of NANOSVG and users may end up needing more advanced options
* spesific to loading vector graphics (such as resolution control), see #109567 for details.
*/
```
|
||||
|
||||
ImBuf *imb_load_filepath_thumbnail_svg(const char *filepath,
|
||||
const int /* flags */,
|
||||
|
|
|
@ -16,8 +16,7 @@ set(INC
|
|||
../../windowmanager
|
||||
../../../../intern/clog
|
||||
../../../../intern/guardedalloc
|
||||
../../../../intern/utfconv
|
||||
../../../../extern/nanosvg
|
||||
../../../../intern/utfconv
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
|
@ -34,15 +33,13 @@ set(SRC
|
|||
intern/gpencil_io_export_base.hh
|
||||
intern/gpencil_io_import_base.hh
|
||||
intern/gpencil_io_import_svg.hh
|
||||
|
||||
# Only so this file is known by CMake.
|
||||
../../../../extern/nanosvg/nanosvg.h
|
||||
)
|
||||
|
||||
set(LIB
|
||||
bf_blenkernel
|
||||
bf_blenlib
|
||||
bf_io_common
|
||||
PRIVATE bf::extern::nanosvg
|
||||
)
|
||||
|
||||
if(WITH_PUGIXML)
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
|
||||
/* Custom flags for NanoSVG. */
|
||||
#define NANOSVG_ALL_COLOR_KEYWORDS
|
||||
#define NANOSVG_IMPLEMENTATION
|
||||
|
||||
#include "nanosvg.h"
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Could the C-only function call a static local function? (to avoid
extern "C"
the whole file).