Blender  V3.3
Classes | Typedefs | Functions
png.c File Reference
#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)
 
ImBufimb_loadpng (const unsigned char *mem, size_t size, int flags, char colorspace[IM_MAX_SPACE])
 

Detailed Description

Todo:
Save floats as 16 bits per channel, currently readonly.

Definition in file png.c.

Typedef Documentation

◆ PNGReadStruct

typedef struct PNGReadStruct PNGReadStruct

Function Documentation

◆ channel_colormanage_noop()

static float channel_colormanage_noop ( float  value)
static

Definition at line 99 of file png.c.

Referenced by imb_savepng().

◆ Flush()

static void Flush ( png_structp  png_ptr)
static

Definition at line 65 of file png.c.

References void.

Referenced by imb_savepng(), and init_bgl_version_1_0_methods().

◆ ftoshort()

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().

◆ imb_is_a_png()

bool imb_is_a_png ( const unsigned char *  mem,
size_t  size 
)

Definition at line 48 of file png.c.

References size().

Referenced by imb_loadpng().

◆ imb_loadpng()

ImBuf* imb_loadpng ( const unsigned char *  mem,
size_t  size,
int  flags,
char  colorspace[IM_MAX_SPACE] 
)

◆ imb_png_error()

static void imb_png_error ( png_structp   UNUSEDpng_ptr,
png_const_charp  message 
)
static

Definition at line 519 of file png.c.

Referenced by imb_loadpng().

◆ imb_png_warning()

static void imb_png_warning ( png_structp   UNUSEDpng_ptr,
png_const_charp  message 
)
static

Definition at line 507 of file png.c.

References G, G_DEBUG, and STRPREFIX.

Referenced by imb_loadpng().

◆ imb_savepng()

bool imb_savepng ( struct ImBuf ibuf,
const char *  filepath,
int  flags 
)

◆ ReadData()

static void ReadData ( png_structp  png_ptr,
png_bytep  data,
png_size_t  length 
)
static

Definition at line 83 of file png.c.

References data, PNGReadStruct::data, blender::math::length(), PNGReadStruct::seek, and size().

◆ UPSAMPLE_8_TO_16()

BLI_INLINE unsigned short UPSAMPLE_8_TO_16 ( const unsigned char  _val)

Definition at line 43 of file png.c.

Referenced by imb_savepng().

◆ WriteData()

static void WriteData ( png_structp  png_ptr,
png_bytep  data,
png_size_t  length 
)
static