Blender V5.3
thumbs.cc File Reference
#include <algorithm>
#include <cstdlib>
#include "MEM_guardedalloc.h"
#include "BKE_blendfile.hh"
#include "BLI_fileops.hh"
#include "BLI_ghash.hh"
#include "BLI_hash_md5.hh"
#include "BLI_path_utils.hh"
#include "BLI_string.hh"
#include "BLI_string_utf8.hh"
#include "BLI_string_utils.hh"
#include "BLI_system.hh"
#include "BLI_tempfile.hh"
#include "BLI_threads.hh"
#include "BLI_utildefines.hh"
#include "DNA_space_types.h"
#include "IMB_imbuf.hh"
#include "IMB_imbuf_types.hh"
#include "IMB_metadata.hh"
#include "IMB_thumbs.hh"
#include "MOV_read.hh"
#include <cctype>
#include <cstring>
#include <ctime>
#include <sys/stat.h>
#include <sys/types.h>

Go to the source code of this file.

Classes

struct  blender::IMBThumbLocks

Namespaces

namespace  blender
 BMesh Iterators.

Macros

#define USE_FREEDESKTOP
#define THUMBNAILS   "thumbnails"
#define URI_MAX   (FILE_MAX * 3 + 8)
#define ACCEPTABLE(a)

Functions

static bool blender::get_thumb_dir (char *dir, ThumbSize size)
static bool blender::thumbhash_from_path (const char *, ThumbSource source, char *r_hash)
static bool blender::uri_from_filepath (const char *path, char *uri)
static bool blender::thumbpathname_from_uri (const char *uri, char *r_path, const int path_maxncpy, char *r_name, int name_maxncpy, ThumbSize size)
static void blender::thumbname_from_uri (const char *uri, char *thumb, const int thumb_maxncpy)
static bool blender::thumbpath_from_uri (const char *uri, char *path, const int path_maxncpy, ThumbSize size)
void blender::IMB_thumb_makedirs ()
static bool blender::thumb_cancel_requested (const ThumbCancellationToken *cancel_token)
static ImBuf * blender::thumb_create_ex (const char *file_path, const char *uri, const char *thumb, const bool use_hash, const char *hash, const char *blen_group, const char *blen_id, ThumbSize size, ThumbSource source, ImBuf *img, const ThumbCancellationToken *cancel_token=nullptr)
static ImBuf * blender::thumb_create_or_fail (const char *file_path, const char *uri, const char *thumb, const bool use_hash, const char *hash, const char *blen_group, const char *blen_id, ThumbSize size, ThumbSource source, const ThumbCancellationToken *cancel_token)
static bool blender::skip_thumbnails_for_filepath (const char *filepath)
ImBuf * blender::IMB_thumb_create (const char *filepath, ThumbSize size, ThumbSource source, ImBuf *img)
ImBuf * blender::IMB_thumb_read (const char *file_or_lib_path, ThumbSize size)
void blender::IMB_thumb_delete (const char *file_or_lib_path, ThumbSize size)
ImBuf * blender::IMB_thumb_manage (const char *file_or_lib_path, ThumbSize size, ThumbSource source, const ThumbCancellationToken *cancel_token=nullptr)
static IMBThumbLocks & blender::get_thumb_locks ()
void blender::IMB_thumb_locks_acquire ()
void blender::IMB_thumb_locks_release ()
void blender::IMB_thumb_path_lock (const char *path)
void blender::IMB_thumb_path_unlock (const char *path)

Escape URI String

The following code is adapted from function g_escape_uri_string from the gnome glib Source: http://svn.gnome.org/viewcvs/glib/trunk/glib/gconvert.c?view=markup released under the Gnu General Public License.

enum  blender::eUnsafeCharacterSet {
  blender::UNSAFE_ALL = 0x1 , blender::UNSAFE_ALLOW_PLUS = 0x2 , blender::UNSAFE_PATH = 0x8 , blender::UNSAFE_HOST = 0x10 ,
  blender::UNSAFE_SLASHES = 0x20
}
static const uchar blender::acceptable [96]
static const char blender::hex [17] = "0123456789abcdef"
static void blender::escape_uri_string (const char *string, char *escaped_string, const int escaped_string_size, const eUnsafeCharacterSet mask)

Macro Definition Documentation

◆ ACCEPTABLE

#define ACCEPTABLE ( a)
Value:
((a) >= 32 && (a) < 128 && (acceptable[(a) - 32] & mask))
ccl_device_inline float2 mask(const MaskType mask, const float2 a)

Referenced by blender::escape_uri_string().

◆ THUMBNAILS

#define THUMBNAILS   "thumbnails"

Definition at line 67 of file thumbs.cc.

Referenced by blender::get_thumb_dir().

◆ URI_MAX

◆ USE_FREEDESKTOP

#define USE_FREEDESKTOP

Definition at line 62 of file thumbs.cc.