Blender
V3.3
|
#include <png.h>
#include "BLI_fileops.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BKE_global.h"
#include "BKE_idprop.h"
#include "DNA_ID.h"
#include "MEM_guardedalloc.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "IMB_allocimbuf.h"
#include "IMB_filetype.h"
#include "IMB_metadata.h"
#include "IMB_colormanagement.h"
#include "IMB_colormanagement_intern.h"
Go to the source code of this file.
Classes | |
struct | PNGReadStruct |
Typedefs | |
typedef struct PNGReadStruct | PNGReadStruct |
Functions | |
static void | ReadData (png_structp png_ptr, png_bytep data, png_size_t length) |
static void | WriteData (png_structp png_ptr, png_bytep data, png_size_t length) |
static void | Flush (png_structp png_ptr) |
BLI_INLINE unsigned short | UPSAMPLE_8_TO_16 (const unsigned char _val) |
bool | imb_is_a_png (const unsigned char *mem, size_t size) |
static float | channel_colormanage_noop (float value) |
BLI_INLINE unsigned short | ftoshort (float val) |
bool | imb_savepng (struct ImBuf *ibuf, const char *filepath, int flags) |
static void | imb_png_warning (png_structp UNUSED(png_ptr), png_const_charp message) |
static void | imb_png_error (png_structp UNUSED(png_ptr), png_const_charp message) |
ImBuf * | imb_loadpng (const unsigned char *mem, size_t size, int flags, char colorspace[IM_MAX_SPACE]) |
typedef struct PNGReadStruct PNGReadStruct |
Definition at line 99 of file png.c.
Referenced by imb_savepng().
|
static |
Definition at line 65 of file png.c.
References void.
Referenced by imb_savepng(), and init_bgl_version_1_0_methods().
BLI_INLINE unsigned short ftoshort | ( | float | val | ) |
Definition at line 105 of file png.c.
References unit_float_to_ushort_clamp().
Referenced by imb_savepng().
bool imb_is_a_png | ( | const unsigned char * | mem, |
size_t | size | ||
) |
ImBuf* imb_loadpng | ( | const unsigned char * | mem, |
size_t | size, | ||
int | flags, | ||
char | colorspace[IM_MAX_SPACE] | ||
) |
Definition at line 524 of file png.c.
References channels(), COLOR_ROLE_DEFAULT_BYTE, colorspace_set_default_role(), count, PNGReadStruct::data, ImbFormatOptions::flag, ImBuf::flags, ImBuf::foptions, from, ImBuf::ftype, height, IB_metadata, IB_test, IM_MAX_SPACE, imb_addrectfloatImBuf(), imb_addrectImBuf(), imb_alloc_pixels(), IMB_allocImBuf(), IMB_freeImBuf(), IMB_FTYPE_PNG, imb_is_a_png(), IMB_metadata_ensure(), IMB_metadata_set_field(), imb_png_error(), imb_png_warning(), MEM_freeN, MEM_mallocN, ImBuf::metadata, NULL, PNG_16BIT, ImBuf::ppm, ImBuf::rect, ImBuf::rect_float, PNGReadStruct::seek, size(), PNGReadStruct::size, blender::bke::to_float(), width, ImBuf::x, and ImBuf::y.
|
static |
Definition at line 519 of file png.c.
Referenced by imb_loadpng().
|
static |
Definition at line 110 of file png.c.
References BLI_fopen(), channel_colormanage_noop(), ImBuf::channels, ImBuf::colormanage_flag, IDProperty::data, ImBuf::encodedsize, ListBase::first, ImbFormatOptions::flag, float(), ImBuf::float_colorspace, Flush(), ImBuf::foptions, from, blender::bke::from_float(), ftoshort(), IDPropertyData::group, IB_mem, IDP_String, IDP_STRING, imb_addencodedbufferImBuf(), IMB_COLORMANAGE_IS_DATA, IMB_colormanagement_get_luminance(), linearrgb_to_srgb(), MEM_callocN, MEM_freeN, MEM_mallocN, ImBuf::metadata, IDProperty::name, IDProperty::next, NULL, ImBuf::planes, PNG_16BIT, ImBuf::ppm, premul_to_straight_v4_v4(), ImbFormatOptions::quality, ImBuf::rect, ImBuf::rect_float, usdtokens::rgb(), IDProperty::type, UPSAMPLE_8_TO_16(), ImBuf::x, and ImBuf::y.
Definition at line 83 of file png.c.
References data, PNGReadStruct::data, blender::math::length(), PNGReadStruct::seek, and size().
BLI_INLINE unsigned short UPSAMPLE_8_TO_16 | ( | const unsigned char | _val | ) |
Definition at line 43 of file png.c.
Referenced by imb_savepng().
Definition at line 70 of file png.c.
References data, ImBuf::encodedbuffer, ImBuf::encodedbuffersize, ImBuf::encodedsize, imb_enlargeencodedbufferImBuf(), and blender::math::length().