|
Blender V5.0
|
#include <algorithm>#include <csetjmp>#include <cstdio>#include "MEM_guardedalloc.h"#include "BLI_fileops.h"#include "BLI_listbase.h"#include "BLI_string.h"#include "BLI_string_utf8.h"#include "BLI_utildefines.h"#include "BKE_idprop.hh"#include "DNA_ID.h"#include "IMB_colormanagement.hh"#include "IMB_filetype.hh"#include "IMB_imbuf.hh"#include "IMB_imbuf_types.hh"#include "IMB_metadata.hh"#include "CLG_log.h"#include <cstring>#include <jerror.h>#include <jpeglib.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) |
| #define | INPUT_RELOAD(cinfo) |
| #define | MAKE_BYTE_AVAIL(cinfo, action) |
| #define | INPUT_BYTE(cinfo, V, action) |
| #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 | |
| using | my_error_ptr = my_error_mgr * |
| using | my_src_ptr = my_source_mgr * |
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 uchar *buffer, size_t size) |
| static boolean | handle_app1 (j_decompress_ptr cinfo) |
| static ImBuf * | ibJpegImageFromCinfo (jpeg_decompress_struct *cinfo, int flags, int max_size, size_t *r_width, size_t *r_height) |
| bool | imb_is_a_jpeg (const uchar *mem, const size_t size) |
| BLI_STATIC_ASSERT (sizeof(NeoGeo_Word)==4, "Must be 4 bytes") | |
| ImBuf * | imb_load_jpeg (const uchar *buffer, size_t size, int flags, ImFileColorSpace &) |
| ImBuf * | imb_thumbnail_jpeg (const char *filepath, const int flags, const size_t max_thumb_size, ImFileColorSpace &r_colorspace, size_t *r_width, size_t *r_height) |
| static void | write_jpeg (jpeg_compress_struct *cinfo, ImBuf *ibuf) |
| static int | init_jpeg (FILE *outfile, jpeg_compress_struct *cinfo, ImBuf *ibuf) |
| static bool | save_stdjpeg (const char *filepath, ImBuf *ibuf) |
| bool | imb_savejpeg (ImBuf *ibuf, const char *filepath, int flags) |
Variables | |
| static CLG_LogRef | LOG = {"image.jpeg"} |
| static const uchar | jpeg_default_quality = 75 |
| static uchar | ibuf_quality |
| #define INPUT_2BYTES | ( | cinfo, | |
| V, | |||
| action ) |
Definition at line 206 of file format_jpeg.cc.
Referenced by handle_app1().
| #define INPUT_BYTE | ( | cinfo, | |
| V, | |||
| action ) |
| #define INPUT_RELOAD | ( | cinfo | ) |
Definition at line 181 of file format_jpeg.cc.
| #define INPUT_SYNC | ( | cinfo | ) |
Definition at line 177 of file format_jpeg.cc.
Referenced by handle_app1().
| #define INPUT_VARS | ( | cinfo | ) |
Definition at line 171 of file format_jpeg.cc.
Referenced by handle_app1().
| #define JPEG_APP1_MAX (1 << 16) |
Definition at line 483 of file format_jpeg.cc.
Referenced by imb_thumbnail_jpeg().
| #define JPEG_MARKER_APP1 (0xE1) |
Definition at line 482 of file format_jpeg.cc.
Referenced by imb_thumbnail_jpeg().
| #define JPEG_MARKER_MSB (0xFF) |
Definition at line 480 of file format_jpeg.cc.
Referenced by imb_thumbnail_jpeg().
| #define JPEG_MARKER_SOI (0xD8) |
Definition at line 481 of file format_jpeg.cc.
Referenced by imb_thumbnail_jpeg().
| #define MAKE_BYTE_AVAIL | ( | cinfo, | |
| action ) |
Definition at line 188 of file format_jpeg.cc.
| #define MAKESTMT | ( | stuff | ) |
Definition at line 166 of file format_jpeg.cc.
| using my_error_ptr = my_error_mgr * |
Definition at line 73 of file format_jpeg.cc.
| using my_src_ptr = my_source_mgr * |
Definition at line 101 of file format_jpeg.cc.
| BLI_STATIC_ASSERT | ( | sizeof(NeoGeo_Word) | = =4, |
| "Must be 4 bytes" | ) |
|
static |
Definition at line 108 of file format_jpeg.cc.
References my_source_mgr::pub, and my_source_mgr::terminal.
Referenced by memory_source().
|
static |
Definition at line 221 of file format_jpeg.cc.
References i, ibuf_quality, INPUT_2BYTES, INPUT_BYTE, INPUT_SYNC, INPUT_VARS, length(), NeoGeo_Word::quality, and STRPREFIX.
Referenced by ibJpegImageFromCinfo().
|
static |
Definition at line 249 of file format_jpeg.cc.
References b, BLI_strdupn(), BLI_strnlen(), ImBuf::byte_buffer, ImBufByteBuffer::data, ImBuf::flags, float, ImBuf::foptions, ImBuf::ftype, handle_app1(), IB_byte_data, IB_metadata, IB_test, IB_uninitialized_pixels, ibuf_quality, IMB_allocImBuf(), IMB_FTYPE_JPG, IMB_metadata_ensure(), IMB_metadata_set_field(), jpeg_default_quality, max_uu(), MEM_freeN(), ImBuf::metadata, min_uu(), ImBuf::ppm, ImbFormatOptions::quality, str, STRPREFIX, ImBuf::x, x, ImBuf::y, and y.
Referenced by imb_load_jpeg(), and imb_thumbnail_jpeg().
| bool imb_is_a_jpeg | ( | const uchar * | mem, |
| const size_t | size ) |
Definition at line 54 of file format_jpeg.cc.
References magic(), and size().
Referenced by imb_load_jpeg().
| ImBuf * imb_load_jpeg | ( | const uchar * | buffer, |
| size_t | size, | ||
| int | flags, | ||
| ImFileColorSpace & | r_colorspace ) |
Definition at line 446 of file format_jpeg.cc.
References ibJpegImageFromCinfo(), imb_is_a_jpeg(), jpeg_error(), memory_source(), my_error_mgr::pub, my_error_mgr::setjmp_buffer, and size().
Referenced by imb_thumbnail_jpeg().
| bool imb_savejpeg | ( | ImBuf * | ibuf, |
| const char * | filepath, | ||
| int | flags ) |
Definition at line 762 of file format_jpeg.cc.
References ImBuf::flags, and save_stdjpeg().
| ImBuf * imb_thumbnail_jpeg | ( | const char * | filepath, |
| const int | flags, | ||
| const size_t | max_thumb_size, | ||
| ImFileColorSpace & | r_colorspace, | ||
| size_t * | r_width, | ||
| size_t * | r_height ) |
Definition at line 485 of file format_jpeg.cc.
References BLI_fopen(), CLOG_ERROR, i, ibJpegImageFromCinfo(), imb_load_jpeg(), JPEG_APP1_MAX, jpeg_error(), JPEG_MARKER_APP1, JPEG_MARKER_MSB, JPEG_MARKER_SOI, LOG, MEM_calloc_arrayN(), MEM_SAFE_FREE, my_error_mgr::pub, and my_error_mgr::setjmp_buffer.
|
static |
Definition at line 675 of file format_jpeg.cc.
References ImBuf::foptions, jpeg_default_quality, ImBuf::planes, ImbFormatOptions::quality, ImBuf::x, and ImBuf::y.
Referenced by save_stdjpeg().
|
static |
Definition at line 103 of file format_jpeg.cc.
Referenced by memory_source().
|
static |
Definition at line 75 of file format_jpeg.cc.
References my_error_mgr::setjmp_buffer.
Referenced by imb_load_jpeg(), imb_thumbnail_jpeg(), and save_stdjpeg().
|
static |
Definition at line 143 of file format_jpeg.cc.
References my_source_mgr::buffer, fill_input_buffer(), init_source(), my_source_mgr::pub, my_source_mgr::size, size(), skip_input_data(), and term_source().
Referenced by imb_load_jpeg().
|
static |
Definition at line 728 of file format_jpeg.cc.
References BLI_fopen(), init_jpeg(), jpeg_error(), my_error_mgr::pub, my_error_mgr::setjmp_buffer, and write_jpeg().
Referenced by imb_savejpeg().
|
static |
Definition at line 124 of file format_jpeg.cc.
References my_source_mgr::pub.
Referenced by memory_source().
|
static |
Definition at line 138 of file format_jpeg.cc.
Referenced by memory_source().
|
static |
Definition at line 560 of file format_jpeg.cc.
References ARRAY_SIZE, BLI_snprintf_utf8_rlen(), ImBuf::byte_buffer, ImBufByteBuffer::colorspace, blender::Vector< T, InlineBufferCapacity, Allocator >::data(), IDProperty::data, ImBufByteBuffer::data, ImBuf::foptions, IDPropertyData::group, IDP_STRING, IDP_string_get, IMB_colormanagement_space_to_icc_profile(), blender::Vector< T, InlineBufferCapacity, Allocator >::is_empty(), LISTBASE_FOREACH, MEM_freeN(), MEM_malloc_arrayN(), ImBuf::metadata, blender::Vector< T, InlineBufferCapacity, Allocator >::prepend(), ImbFormatOptions::quality, NeoGeo_Word::quality, blender::Vector< T, InlineBufferCapacity, Allocator >::size(), STREQ, STRNCPY_UTF8, ImBuf::x, x, ImBuf::y, and y.
Referenced by save_stdjpeg().
|
static |
Definition at line 52 of file format_jpeg.cc.
Referenced by handle_app1(), and ibJpegImageFromCinfo().
|
static |
Definition at line 51 of file format_jpeg.cc.
Referenced by ibJpegImageFromCinfo(), and init_jpeg().
|
static |
Definition at line 38 of file format_jpeg.cc.