Blender V4.3
format_psd.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10
11#include "IMB_filetype.hh"
12
13#include "IMB_imbuf_types.hh"
14
15OIIO_NAMESPACE_USING
16using namespace blender::imbuf;
17
18bool imb_is_a_psd(const uchar *mem, size_t size)
19{
20 return imb_oiio_check(mem, size, "psd");
21}
22
23ImBuf *imb_load_psd(const uchar *mem, size_t size, int flags, char colorspace[IM_MAX_SPACE])
24{
25 ImageSpec config, spec;
26 config.attribute("oiio:UnassociatedAlpha", 1);
27
28 ReadContext ctx{mem, size, "psd", IMB_FTYPE_PSD, flags};
29
30 /* PSD should obey color space information embedded in the file. */
31 ctx.use_embedded_colorspace = true;
32
33 return imb_oiio_read(ctx, config, colorspace, spec);
34}
unsigned char uchar
#define IM_MAX_SPACE
Definition IMB_imbuf.hh:49
@ IMB_FTYPE_PSD
Contains defines and structs used throughout the imbuf module.
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition btDbvt.cpp:52
bool imb_is_a_psd(const uchar *mem, size_t size)
Definition format_psd.cc:18
ImBuf * imb_load_psd(const uchar *mem, size_t size, int flags, char colorspace[IM_MAX_SPACE])
Definition format_psd.cc:23
ImBuf * imb_oiio_read(const ReadContext &ctx, const ImageSpec &config, char colorspace[IM_MAX_SPACE], ImageSpec &r_newspec)
bool imb_oiio_check(const uchar *mem, size_t mem_size, const char *file_format)