|
Blender
V3.3
|
#include <setjmp.h>#include <stdio.h>#include "MEM_guardedalloc.h"#include "BLI_fileops.h"#include "BLI_string.h"#include "BLI_utildefines.h"#include "BKE_idprop.h"#include "DNA_ID.h"#include "IMB_filetype.h"#include "IMB_imbuf.h"#include "IMB_imbuf_types.h"#include "IMB_metadata.h"#include "imbuf.h"#include <jerror.h>#include <jpeglib.h>#include "IMB_colormanagement.h"#include "IMB_colormanagement_intern.h"Go to the source code of this file.
Classes | |
| struct | my_error_mgr |
| struct | my_source_mgr |
| struct | NeoGeo_Word |
Macros | |
| #define | MAKESTMT(stuff) |
| #define | INPUT_VARS(cinfo) |
| #define | INPUT_SYNC(cinfo) (datasrc->next_input_byte = next_input_byte, datasrc->bytes_in_buffer = bytes_in_buffer) |
| #define | INPUT_RELOAD(cinfo) (next_input_byte = datasrc->next_input_byte, bytes_in_buffer = datasrc->bytes_in_buffer) |
| #define | MAKE_BYTE_AVAIL(cinfo, action) |
| #define | INPUT_BYTE(cinfo, V, action) MAKESTMT(MAKE_BYTE_AVAIL(cinfo, action); bytes_in_buffer--; V = GETJOCTET(*next_input_byte++);) |
| #define | INPUT_2BYTES(cinfo, V, action) |
| #define | JPEG_MARKER_MSB (0xFF) |
| #define | JPEG_MARKER_SOI (0xD8) |
| #define | JPEG_MARKER_APP1 (0xE1) |
| #define | JPEG_APP1_MAX (1 << 16) |
Typedefs | |
| typedef struct my_error_mgr | my_error_mgr |
| typedef my_error_mgr * | my_error_ptr |
| typedef my_source_mgr * | my_src_ptr |
Functions | |
| static void | jpeg_error (j_common_ptr cinfo) ATTR_NORETURN |
| static void | init_source (j_decompress_ptr cinfo) |
| static boolean | fill_input_buffer (j_decompress_ptr cinfo) |
| static void | skip_input_data (j_decompress_ptr cinfo, long num_bytes) |
| static void | term_source (j_decompress_ptr cinfo) |
| static void | memory_source (j_decompress_ptr cinfo, const unsigned char *buffer, size_t size) |
| static boolean | handle_app1 (j_decompress_ptr cinfo) |
| static ImBuf * | ibJpegImageFromCinfo (struct jpeg_decompress_struct *cinfo, int flags, int max_size, size_t *r_width, size_t *r_height) |
| bool | imb_is_a_jpeg (const unsigned char *mem, const size_t size) |
| BLI_STATIC_ASSERT (sizeof(struct NeoGeo_Word)==4, "Must be 4 bytes") | |
| ImBuf * | imb_load_jpeg (const unsigned char *buffer, size_t size, int flags, char colorspace[IM_MAX_SPACE]) |
| struct ImBuf * | imb_thumbnail_jpeg (const char *filepath, const int flags, const size_t max_thumb_size, char colorspace[IM_MAX_SPACE], size_t *r_width, size_t *r_height) |
| static void | write_jpeg (struct jpeg_compress_struct *cinfo, struct ImBuf *ibuf) |
| static int | init_jpeg (FILE *outfile, struct jpeg_compress_struct *cinfo, struct ImBuf *ibuf) |
| static bool | save_stdjpeg (const char *name, struct ImBuf *ibuf) |
| bool | imb_savejpeg (struct ImBuf *ibuf, const char *filepath, int flags) |
Variables | |
| static const uchar | jpeg_default_quality = 75 |
| static uchar | ibuf_quality |
| #define INPUT_BYTE | ( | cinfo, | |
| V, | |||
| action | |||
| ) | MAKESTMT(MAKE_BYTE_AVAIL(cinfo, action); bytes_in_buffer--; V = GETJOCTET(*next_input_byte++);) |
| #define INPUT_RELOAD | ( | cinfo | ) | (next_input_byte = datasrc->next_input_byte, bytes_in_buffer = datasrc->bytes_in_buffer) |
| #define INPUT_SYNC | ( | cinfo | ) | (datasrc->next_input_byte = next_input_byte, datasrc->bytes_in_buffer = bytes_in_buffer) |
| #define INPUT_VARS | ( | cinfo | ) |
| #define MAKE_BYTE_AVAIL | ( | cinfo, | |
| action | |||
| ) |
| typedef struct my_error_mgr my_error_mgr |
| typedef my_error_mgr* my_error_ptr |
| typedef my_source_mgr* my_src_ptr |
| BLI_STATIC_ASSERT | ( | sizeof(struct NeoGeo_Word) | = =4, |
| "Must be 4 bytes" | |||
| ) |
|
static |
|
static |
Definition at line 225 of file jpeg.c.
References ibuf_quality, INPUT_2BYTES, INPUT_BYTE, INPUT_SYNC, INPUT_VARS, blender::math::length(), NeoGeo_Word::quality, and STRPREFIX.
Referenced by ibJpegImageFromCinfo().
|
static |
Definition at line 253 of file jpeg.c.
References usdtokens::b(), BLI_strdupn(), buffer, ImBuf::flags, float(), ImBuf::foptions, ImBuf::ftype, usdtokens::g(), handle_app1(), IB_metadata, IB_rect, IB_test, ibuf_quality, IMB_allocImBuf(), IMB_FTYPE_JPG, IMB_metadata_ensure(), IMB_metadata_set_field(), jpeg_default_quality, MAX2, max_uu(), MEM_freeN, ImBuf::metadata, MIN2, min_uu(), NULL, ImBuf::ppm, ImbFormatOptions::quality, r, ImBuf::rect, str, STRPREFIX, x, ImBuf::x, y, and ImBuf::y.
Referenced by imb_load_jpeg(), and imb_thumbnail_jpeg().
| bool imb_is_a_jpeg | ( | const unsigned char * | mem, |
| const size_t | size | ||
| ) |
Definition at line 51 of file jpeg.c.
References magic(), and size().
Referenced by imb_load_jpeg().
| ImBuf* imb_load_jpeg | ( | const unsigned char * | buffer, |
| size_t | size, | ||
| int | flags, | ||
| char | colorspace[IM_MAX_SPACE] | ||
| ) |
Definition at line 448 of file jpeg.c.
References buffer, COLOR_ROLE_DEFAULT_BYTE, colorspace_set_default_role(), ibJpegImageFromCinfo(), IM_MAX_SPACE, imb_is_a_jpeg(), jpeg_error(), memory_source(), NULL, my_error_mgr::pub, my_error_mgr::setjmp_buffer, and size().
Referenced by imb_thumbnail_jpeg().
| struct ImBuf* imb_thumbnail_jpeg | ( | const char * | filepath, |
| const int | flags, | ||
| const size_t | max_thumb_size, | ||
| char | colorspace[IM_MAX_SPACE], | ||
| size_t * | r_width, | ||
| size_t * | r_height | ||
| ) |
Definition at line 489 of file jpeg.c.
References BLI_fopen(), buffer, COLOR_ROLE_DEFAULT_BYTE, colorspace_set_default_role(), ibJpegImageFromCinfo(), IM_MAX_SPACE, imb_load_jpeg(), JPEG_APP1_MAX, jpeg_error(), JPEG_MARKER_APP1, JPEG_MARKER_MSB, JPEG_MARKER_SOI, MEM_callocN, MEM_SAFE_FREE, NULL, my_error_mgr::pub, and my_error_mgr::setjmp_buffer.
|
static |
Definition at line 663 of file jpeg.c.
References ImBuf::foptions, jpeg_default_quality, ImBuf::planes, ImbFormatOptions::quality, NeoGeo_Word::quality, ImBuf::x, and ImBuf::y.
Referenced by save_stdjpeg().
|
static |
|
static |
Definition at line 72 of file jpeg.c.
References err.
Referenced by imb_load_jpeg(), imb_thumbnail_jpeg(), and save_stdjpeg().
|
static |
Definition at line 147 of file jpeg.c.
References buffer, fill_input_buffer(), init_source(), NULL, size(), skip_input_data(), src, and term_source().
Referenced by imb_load_jpeg().
Definition at line 718 of file jpeg.c.
References BLI_fopen(), init_jpeg(), jpeg_error(), NULL, my_error_mgr::pub, blender::bke::attribute_accessor_functions::remove(), my_error_mgr::setjmp_buffer, and write_jpeg().
|
static |
|
static |
Definition at line 564 of file jpeg.c.
References ARRAY_SIZE, BLI_snprintf_rlen(), buffer, IDProperty::data, ListBase::first, ImBuf::foptions, IDPropertyData::group, IDP_String, IDP_STRING, IDProperty::len, MEM_freeN, MEM_mallocN, ImBuf::metadata, IDProperty::name, IDProperty::next, NULL, ImbFormatOptions::quality, NeoGeo_Word::quality, ImBuf::rect, STREQ, IDProperty::type, x, ImBuf::x, y, and ImBuf::y.
Referenced by save_stdjpeg().
|
static |
Definition at line 49 of file jpeg.c.
Referenced by handle_app1(), and ibJpegImageFromCinfo().
|
static |
Definition at line 48 of file jpeg.c.
Referenced by ibJpegImageFromCinfo(), and init_jpeg().