|
Blender V4.3
|
#include <algorithm>#include <csetjmp>#include <cstdio>#include "MEM_guardedalloc.h"#include "BLI_fileops.h"#include "BLI_listbase.h"#include "BLI_string.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 <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) (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 | |
| 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, char colorspace[IM_MAX_SPACE]) |
| 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 (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 const uchar | jpeg_default_quality = 75 |
| static uchar | ibuf_quality |
Definition at line 201 of file jpeg.cc.
Referenced by handle_app1().
| #define INPUT_BYTE | ( | cinfo, | |
| V, | |||
| action ) MAKESTMT(MAKE_BYTE_AVAIL(cinfo, action); bytes_in_buffer--; V = GETJOCTET(*next_input_byte++);) |
Definition at line 195 of file jpeg.cc.
Referenced by handle_app1().
| #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) |
Definition at line 172 of file jpeg.cc.
Referenced by handle_app1().
| #define INPUT_VARS | ( | cinfo | ) |
Definition at line 166 of file jpeg.cc.
Referenced by handle_app1().
| #define JPEG_APP1_MAX (1 << 16) |
Definition at line 477 of file jpeg.cc.
Referenced by imb_thumbnail_jpeg().
| #define JPEG_MARKER_APP1 (0xE1) |
Definition at line 476 of file jpeg.cc.
Referenced by imb_thumbnail_jpeg().
| #define JPEG_MARKER_MSB (0xFF) |
Definition at line 474 of file jpeg.cc.
Referenced by imb_thumbnail_jpeg().
| #define JPEG_MARKER_SOI (0xD8) |
Definition at line 475 of file jpeg.cc.
Referenced by imb_thumbnail_jpeg().
| #define MAKE_BYTE_AVAIL | ( | cinfo, | |
| action ) |
| using my_error_ptr = my_error_mgr * |
| using my_src_ptr = my_source_mgr * |
| BLI_STATIC_ASSERT | ( | sizeof(NeoGeo_Word) | = =4, |
| "Must be 4 bytes" | ) |
|
static |
Definition at line 103 of file jpeg.cc.
References my_source_mgr::pub, and my_source_mgr::terminal.
Referenced by memory_source().
|
static |
Definition at line 216 of file jpeg.cc.
References ibuf_quality, INPUT_2BYTES, INPUT_BYTE, INPUT_SYNC, INPUT_VARS, length(), NeoGeo_Word::quality, and STRPREFIX.
Referenced by ibJpegImageFromCinfo().
|
static |
Definition at line 244 of file jpeg.cc.
References b, BLI_strdupn(), BLI_strnlen(), ImBuf::byte_buffer, ImBufByteBuffer::data, double(), ImBuf::flags, float, ImBuf::foptions, ImBuf::ftype, handle_app1(), IB_metadata, IB_rect, 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 ) |
| ImBuf * imb_load_jpeg | ( | const uchar * | buffer, |
| size_t | size, | ||
| int | flags, | ||
| char | colorspace[IM_MAX_SPACE] ) |
Definition at line 441 of file jpeg.cc.
References COLOR_ROLE_DEFAULT_BYTE, colorspace_set_default_role(), ibJpegImageFromCinfo(), IM_MAX_SPACE, imb_is_a_jpeg(), jpeg_error(), memory_source(), my_error_mgr::pub, and my_error_mgr::setjmp_buffer.
Referenced by imb_thumbnail_jpeg().
Definition at line 746 of file jpeg.cc.
References ImBuf::flags, and save_stdjpeg().
| 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 479 of file jpeg.cc.
References BLI_fopen(), 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, my_error_mgr::pub, and my_error_mgr::setjmp_buffer.
Definition at line 657 of file 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 98 of file jpeg.cc.
Referenced by memory_source().
|
static |
Definition at line 70 of file jpeg.cc.
References my_error_mgr::setjmp_buffer.
Referenced by imb_load_jpeg(), imb_thumbnail_jpeg(), and save_stdjpeg().
|
static |
Definition at line 138 of file 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 712 of file 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 119 of file jpeg.cc.
References my_source_mgr::pub.
Referenced by memory_source().
|
static |
Definition at line 133 of file jpeg.cc.
Referenced by memory_source().
|
static |
Definition at line 556 of file jpeg.cc.
References ARRAY_SIZE, BLI_snprintf_rlen(), ImBuf::byte_buffer, IDProperty::data, ImBufByteBuffer::data, ImBuf::foptions, IDPropertyData::group, IDP_STRING, IDP_String, LISTBASE_FOREACH, MEM_freeN(), MEM_mallocN, ImBuf::metadata, ImbFormatOptions::quality, NeoGeo_Word::quality, STREQ, STRNCPY, ImBuf::x, x, ImBuf::y, and y.
Referenced by save_stdjpeg().
|
static |
Definition at line 47 of file jpeg.cc.
Referenced by handle_app1(), and ibJpegImageFromCinfo().
|
static |
Definition at line 46 of file jpeg.cc.
Referenced by ibJpegImageFromCinfo(), and init_jpeg().