12# include <sys/types.h>
86 const uchar *mem,
size_t size,
int flags,
char colorspace[
IM_MAX_SPACE],
const char *descr)
93 fprintf(stderr,
"%s: nullptr pointer\n", __func__);
98 STRNCPY(effective_colorspace, colorspace);
103 ibuf = type->load(mem, size, flags, effective_colorspace);
112 fprintf(stderr,
"%s: unknown file-format (%s)\n", __func__, descr);
129 if (mmap_file ==
nullptr) {
130 fprintf(stderr,
"%s: couldn't get mapping %s\n", __func__, descr);
170 size_t max_thumb_size,
175 if (type ==
nullptr) {
179 ImBuf *ibuf =
nullptr;
187 STRNCPY(effective_colorspace, colorspace);
190 if (type->load_filepath_thumbnail) {
191 ibuf = type->load_filepath_thumbnail(
192 filepath, flags, max_thumb_size, colorspace, &width, &height);
212 if (width > 0 && height > 0) {
File and directory operations.
size_t BLI_file_size(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
int BLI_open(const char *filepath, int oflag, int pmode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void * BLI_mmap_get_pointer(BLI_mmap_file *file) ATTR_WARN_UNUSED_RESULT
void BLI_mmap_free(BLI_mmap_file *file) ATTR_NONNULL(1)
BLI_mmap_file * BLI_mmap_open(int fd) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
size_t BLI_mmap_get_length(const BLI_mmap_file *file) ATTR_WARN_UNUSED_RESULT
bool BLI_path_is_rel(const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
#define STRNCPY(dst, src)
#define SNPRINTF(dst, format,...)
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
bool IMB_colormanagement_space_name_is_data(const char *name)
void IMB_premultiply_alpha(ImBuf *ibuf)
void IMB_rectfill_alpha(ImBuf *ibuf, float value)
void IMB_unpremultiply_alpha(ImBuf *ibuf)
int IMB_ispic_type(const char *filepath)
Contains defines and structs used throughout the imbuf module.
@ IB_alphamode_channel_packed
void colormanage_imbuf_make_linear(ImBuf *ibuf, const char *from_colorspace)
ColorSpace * colormanage_colorspace_get_named(const char *name)
const ImFileType * IMB_file_type_from_ftype(int ftype)
const ImFileType IMB_FILE_TYPES[]
const ImFileType * IMB_FILE_TYPES_LAST
ImBuf * IMB_loadifffile(int file, int flags, char colorspace[IM_MAX_SPACE], const char *descr)
ImBuf * IMB_testiffname(const char *filepath, int flags)
ImBuf * IMB_loadiffname(const char *filepath, int flags, char colorspace[IM_MAX_SPACE])
ImBuf * IMB_ibImageFromMemory(const uchar *mem, size_t size, int flags, char colorspace[IM_MAX_SPACE], const char *descr)
ImBuf * IMB_thumb_load_image(const char *filepath, size_t max_thumb_size, char colorspace[IM_MAX_SPACE], IMBThumbLoadFlags load_flags)
static void imb_handle_alpha(ImBuf *ibuf, int flags, char colorspace[IM_MAX_SPACE], const char effective_colorspace[IM_MAX_SPACE])
char filepath[IMB_FILEPATH_SIZE]
ImBufFloatBuffer float_buffer
ImBufByteBuffer byte_buffer