![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "common/image.h"
#include "common/colorlabels.h"
#include "common/colorspaces.h"
#include "common/darktable.h"
#include "common/debug.h"
#include "common/exif.h"
#include "common/image_cache.h"
#include "common/imageio.h"
#include "common/imageio_module.h"
#include "common/imageio_gm.h"
#include "common/imageio_im.h"
#include "common/imageio_jpeg.h"
#include "common/imageio_pfm.h"
#include "common/imageio_png.h"
#include "common/imageio_pnm.h"
#include "common/imageio_rawspeed.h"
#include "common/imageio_libraw.h"
#include "common/imageio_rgbe.h"
#include "common/imageio_tiff.h"
#include "common/mipmap_cache.h"
#include "common/styles.h"
#include "control/conf.h"
#include "control/control.h"
#include "develop/blend.h"
#include "develop/develop.h"
#include "develop/imageop.h"
#include <assert.h>
#include <glib/gstdio.h>
#include <inttypes.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
Functions | |
dt_image_flags_t | dt_imageio_get_type_from_extension (const char *extension) |
int | dt_imageio_large_thumbnail (const char *filename, uint8_t **buffer, int32_t *th_width, int32_t *th_height, dt_colorspaces_color_profile_type_t *color_space, const int width, const int height) |
Load the thumbnail embedded into a RAW file having at least the size MAX(width, height) x MAX(width, height) | |
gboolean | dt_imageio_has_mono_preview (const char *filename) |
void | dt_imageio_flip_buffers (char *out, const char *in, const size_t bpp, const int wd, const int ht, const int fwd, const int fht, const int stride, const dt_image_orientation_t orientation) |
void | dt_imageio_flip_buffers_ui8_to_float (float *out, const uint8_t *in, const float black, const float white, const int ch, const int wd, const int ht, const int fwd, const int fht, const int stride, const dt_image_orientation_t orientation) |
dt_imageio_retval_t | dt_imageio_open_hdr (dt_image_t *img, const char *filename, dt_mipmap_buffer_t *buf) |
gboolean | dt_imageio_is_raster (const char *filename) |
gboolean | dt_imageio_is_raw (const char *filename) |
int | dt_imageio_is_hdr (const char *filename) |
static gboolean | _is_in_list (char *elem, char *list) |
gboolean | dt_imageio_is_handled_by_libraw (dt_image_t *img, const char *filename) |
dt_imageio_retval_t | dt_imageio_open_raster (dt_image_t *img, const char *filename, dt_mipmap_buffer_t *buf) |
dt_imageio_retval_t | dt_imageio_open_raw (dt_image_t *img, const char *filename, dt_mipmap_buffer_t *buf) |
void | dt_imageio_to_fractional (float in, uint32_t *num, uint32_t *den) |
int | dt_imageio_export (const int32_t imgid, const char *filename, dt_imageio_module_format_t *format, dt_imageio_module_data_t *format_params, const gboolean high_quality, const gboolean copy_metadata, const gboolean export_masks, dt_colorspaces_color_profile_type_t icc_type, const gchar *icc_filename, dt_iop_color_intent_t icc_intent, dt_imageio_module_storage_t *storage, dt_imageio_module_data_t *storage_params, int num, int total, dt_export_metadata_t *metadata) |
gboolean | _apply_style_before_export (dt_develop_t *dev, dt_imageio_module_data_t *format_params, const int32_t imgid) |
void | _print_export_debug (dt_dev_pixelpipe_t *pipe, dt_imageio_module_data_t *format_params, const gboolean use_style) |
void | _filter_pipeline (const char *filter, dt_dev_pixelpipe_t *pipe) |
gboolean | _get_export_size (dt_develop_t *dev, dt_dev_pixelpipe_t *pipe, const dt_imageio_module_data_t *format_params, const gboolean is_scaling, double *scale, int width, int height, int *processed_width, int *processed_height) |
void | _export_disable_finalscale (dt_dev_pixelpipe_t *pipe) |
void | _swap_byteorder_uint8_to_uint8 (const uint8_t *const restrict inbuf, uint8_t *const restrict outbuf, const size_t processed_width, const size_t processed_height) |
void | _clamp_float_to_uint8 (const float *const inbuf, uint8_t *const restrict outbuf, const size_t processed_width, const size_t processed_height) |
void | _swap_byteorder_float_to_uint8 (const float *const restrict inbuf, uint8_t *const restrict outbuf, const size_t processed_width, const size_t processed_height) |
void | _export_final_buffer_to_uint8 (const float *const restrict inbuf, uint8_t **outbuf, const gboolean display_byteorder, const gboolean high_quality, const size_t processed_width, const size_t processed_height) |
void | _export_final_buffer_to_uint16 (const float *const restrict inbuf, uint16_t **outbuf, const size_t processed_width, const size_t processed_height) |
void | _export_apply_lua_actions (const int32_t imgid, const char *filename, dt_imageio_module_format_t *format, dt_imageio_module_data_t *format_params, dt_imageio_module_storage_t *storage, dt_imageio_module_data_t *storage_params) |
int | dt_imageio_export_with_flags (const int32_t imgid, const char *filename, dt_imageio_module_format_t *format, dt_imageio_module_data_t *format_params, const gboolean ignore_exif, const gboolean display_byteorder, const gboolean high_quality, gboolean is_scaling, const gboolean thumbnail_export, const char *filter, const gboolean copy_metadata, const gboolean export_masks, dt_colorspaces_color_profile_type_t icc_type, const gchar *icc_filename, dt_iop_color_intent_t icc_intent, dt_imageio_module_storage_t *storage, dt_imageio_module_data_t *storage_params, int num, int total, dt_export_metadata_t *metadata) |
dt_imageio_retval_t | dt_imageio_open_exotic (dt_image_t *img, const char *filename, dt_mipmap_buffer_t *buf) |
void | dt_imageio_update_monochrome_workflow_tag (int32_t id, int mask) |
void | dt_imageio_set_hdr_tag (dt_image_t *img) |
dt_imageio_retval_t | dt_imageio_open (dt_image_t *img, const char *filename, dt_mipmap_buffer_t *buf) |
gboolean | dt_imageio_lookup_makermodel (const char *maker, const char *model, char *mk, int mk_len, char *md, int md_len, char *al, int al_len) |
Variables | |
static const gchar * | _supported_raw [] |
static const gchar * | _supported_ldr [] |
static const gchar * | _supported_hdr [] = { "avif", "exr", "hdr", "heic", "heif", "hif", "pfm", NULL } |
static const char * | raster_formats [] |
static const char * | raw_formats [] |
static const char * | hdr_formats [] |
gboolean _apply_style_before_export | ( | dt_develop_t * | dev, |
dt_imageio_module_data_t * | format_params, | ||
const int32_t | imgid | ||
) |
void _clamp_float_to_uint8 | ( | const float *const | inbuf, |
uint8_t *const restrict | outbuf, | ||
const size_t | processed_width, | ||
const size_t | processed_height | ||
) |
Referenced by _export_final_buffer_to_uint8().
void _export_apply_lua_actions | ( | const int32_t | imgid, |
const char * | filename, | ||
dt_imageio_module_format_t * | format, | ||
dt_imageio_module_data_t * | format_params, | ||
dt_imageio_module_storage_t * | storage, | ||
dt_imageio_module_data_t * | storage_params | ||
) |
void _export_disable_finalscale | ( | dt_dev_pixelpipe_t * | pipe | ) |
References dt_dev_pixelpipe_iop_t::enabled, and dt_dev_pixelpipe_t::nodes.
Referenced by dt_imageio_export_with_flags().
void _export_final_buffer_to_uint16 | ( | const float *const restrict | inbuf, |
uint16_t ** | outbuf, | ||
const size_t | processed_width, | ||
const size_t | processed_height | ||
) |
References dt_alloc_align, DT_DEBUG_IMAGEIO, dt_print(), and for_each_channel.
Referenced by dt_imageio_export_with_flags().
void _export_final_buffer_to_uint8 | ( | const float *const restrict | inbuf, |
uint8_t ** | outbuf, | ||
const gboolean | display_byteorder, | ||
const gboolean | high_quality, | ||
const size_t | processed_width, | ||
const size_t | processed_height | ||
) |
References _clamp_float_to_uint8(), _swap_byteorder_float_to_uint8(), _swap_byteorder_uint8_to_uint8(), dt_alloc_align, DT_DEBUG_IMAGEIO, and dt_print().
Referenced by dt_imageio_export_with_flags().
void _filter_pipeline | ( | const char * | filter, |
dt_dev_pixelpipe_t * | pipe | ||
) |
References dt_dev_pixelpipe_disable_after(), and dt_dev_pixelpipe_disable_before().
Referenced by dt_imageio_export_with_flags().
gboolean _get_export_size | ( | dt_develop_t * | dev, |
dt_dev_pixelpipe_t * | pipe, | ||
const dt_imageio_module_data_t * | format_params, | ||
const gboolean | is_scaling, | ||
double * | scale, | ||
int | width, | ||
int | height, | ||
int * | processed_width, | ||
int * | processed_height | ||
) |
References double(), dt_imageio_resizing_factor_get_and_parsing(), height, MIN, dt_dev_pixelpipe_t::processed_height, dt_dev_pixelpipe_t::processed_width, and width.
Referenced by dt_imageio_export_with_flags().
|
static |
References FALSE.
Referenced by dt_imageio_is_handled_by_libraw().
void _print_export_debug | ( | dt_dev_pixelpipe_t * | pipe, |
dt_imageio_module_data_t * | format_params, | ||
const gboolean | use_style | ||
) |
void _swap_byteorder_float_to_uint8 | ( | const float *const restrict | inbuf, |
uint8_t *const restrict | outbuf, | ||
const size_t | processed_width, | ||
const size_t | processed_height | ||
) |
Referenced by _export_final_buffer_to_uint8().
void _swap_byteorder_uint8_to_uint8 | ( | const uint8_t *const restrict | inbuf, |
uint8_t *const restrict | outbuf, | ||
const size_t | processed_width, | ||
const size_t | processed_height | ||
) |
Referenced by _export_final_buffer_to_uint8().
int dt_imageio_export | ( | const int32_t | imgid, |
const char * | filename, | ||
dt_imageio_module_format_t * | format, | ||
dt_imageio_module_data_t * | format_params, | ||
const gboolean | high_quality, | ||
const gboolean | copy_metadata, | ||
const gboolean | export_masks, | ||
dt_colorspaces_color_profile_type_t | icc_type, | ||
const gchar * | icc_filename, | ||
dt_iop_color_intent_t | icc_intent, | ||
dt_imageio_module_storage_t * | storage, | ||
dt_imageio_module_data_t * | storage_params, | ||
int | num, | ||
int | total, | ||
dt_export_metadata_t * | metadata | ||
) |
References dt_conf_is_equal(), dt_imageio_export_with_flags(), FALSE, and TRUE.
Referenced by store(), store(), store_wrapper(), and write_image().
int dt_imageio_export_with_flags | ( | const int32_t | imgid, |
const char * | filename, | ||
dt_imageio_module_format_t * | format, | ||
dt_imageio_module_data_t * | format_params, | ||
const gboolean | ignore_exif, | ||
const gboolean | display_byteorder, | ||
const gboolean | high_quality, | ||
gboolean | is_scaling, | ||
const gboolean | thumbnail_export, | ||
const char * | filter, | ||
const gboolean | copy_metadata, | ||
const gboolean | export_masks, | ||
dt_colorspaces_color_profile_type_t | icc_type, | ||
const gchar * | icc_filename, | ||
dt_iop_color_intent_t | icc_intent, | ||
dt_imageio_module_storage_t * | storage, | ||
dt_imageio_module_data_t * | storage_params, | ||
int | num, | ||
int | total, | ||
dt_export_metadata_t * | metadata | ||
) |
References _apply_style_before_export(), _export_apply_lua_actions(), _export_disable_finalscale(), _export_final_buffer_to_uint16(), _export_final_buffer_to_uint8(), _filter_pipeline(), _get_export_size(), _print_export_debug(), dt_dev_pixelpipe_t::backbuf, dt_dev_pixelpipe_t::backbuf_height, dt_dev_pixelpipe_t::backbuf_width, bpp, dt_mipmap_buffer_t::buf, darktable, DT_COLORSPACE_SRGB, dt_colorspaces_get_output_profile(), dt_control_log(), DT_DEBUG_CONTROL_SIGNAL_RAISE, DT_DEBUG_IMAGEIO, dt_dev_cleanup(), dt_dev_get_final_size(), dt_dev_init(), dt_dev_load_image(), dt_dev_pixelpipe_cache_get_entry_from_data(), dt_dev_pixelpipe_cache_rdlock_entry(), dt_dev_pixelpipe_cache_ref_count_entry(), dt_dev_pixelpipe_cleanup(), dt_dev_pixelpipe_create_nodes(), dt_dev_pixelpipe_get_roi_out(), dt_dev_pixelpipe_init_export(), dt_dev_pixelpipe_init_thumbnail(), dt_dev_pixelpipe_process(), dt_dev_pixelpipe_process_no_gamma(), dt_dev_pixelpipe_set_icc(), dt_dev_pixelpipe_set_input(), dt_dev_pixelpipe_synch_all, dt_exif_read_blob(), dt_exif_xmp_attach_export(), dt_free_align, dt_get_times(), dt_image_full_path(), dt_ioppr_resync_modules_order(), DT_MIPMAP_BLOCKING, dt_mipmap_cache_get, dt_mipmap_cache_release, DT_MIPMAP_F, DT_MIPMAP_FULL, dt_print(), dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_show_times(), DT_SIGNAL_IMAGE_EXPORT_TMPFILE, error(), FALSE, FORMAT_FLAGS_NO_TMPFILE, FORMAT_FLAGS_SUPPORT_XMP, height, dt_imageio_module_data_t::height, dt_mipmap_buffer_t::height, dt_dev_pixelpipe_t::iheight, dt_mipmap_buffer_t::iscale, dt_dev_pixelpipe_t::iwidth, MAX, dt_imageio_module_data_t::max_height, dt_imageio_module_data_t::max_width, darktable_t::mipmap_cache, PATH_MAX, darktable_t::pipeline_threadsafe, darktable_t::pixelpipe_cache, dt_dev_pixelpipe_t::processed_height, dt_dev_pixelpipe_t::processed_width, darktable_t::signals, size, dt_imageio_module_data_t::style, TRUE, width, dt_imageio_module_data_t::width, and dt_mipmap_buffer_t::width.
Referenced by _export_image(), _init_8(), dt_control_merge_hdr_job_run(), dt_imageio_export(), and process_image().
void dt_imageio_flip_buffers | ( | char * | out, |
const char * | in, | ||
const size_t | bpp, | ||
const int | wd, | ||
const int | ht, | ||
const int | fwd, | ||
const int | fht, | ||
const int | stride, | ||
const dt_image_orientation_t | orientation | ||
) |
References bpp, ORIENTATION_FLIP_X, ORIENTATION_FLIP_Y, and ORIENTATION_SWAP_XY.
Referenced by distort_mask(), dt_imageio_open_rawspeed(), and process().
void dt_imageio_flip_buffers_ui8_to_float | ( | float * | out, |
const uint8_t * | in, | ||
const float | black, | ||
const float | white, | ||
const int | ch, | ||
const int | wd, | ||
const int | ht, | ||
const int | fwd, | ||
const int | fht, | ||
const int | stride, | ||
const dt_image_orientation_t | orientation | ||
) |
References ORIENTATION_FLIP_X, ORIENTATION_FLIP_Y, and ORIENTATION_SWAP_XY.
Referenced by dt_imageio_open_jpeg().
dt_image_flags_t dt_imageio_get_type_from_extension | ( | const char * | extension | ) |
References _supported_hdr, _supported_ldr, _supported_raw, DT_IMAGE_HDR, DT_IMAGE_LDR, DT_IMAGE_RAW, and extension().
Referenced by _image_import_internal(), and _upgrade_library_schema_step().
gboolean dt_imageio_has_mono_preview | ( | const char * | filename | ) |
References cleanup(), color_space, DT_DEBUG_IMAGEIO, dt_free_align, dt_imageio_large_thumbnail(), dt_print(), FALSE, and TRUE.
gboolean dt_imageio_is_handled_by_libraw | ( | dt_image_t * | img, |
const char * | filename | ||
) |
References _is_in_list(), dt_conf_get_string(), DT_DEBUG_IMAGEIO, dt_print(), dt_image_t::exif_maker, dt_image_t::exif_model, and FALSE.
Referenced by dt_imageio_open_raw().
int dt_imageio_is_hdr | ( | const char * | filename | ) |
References FALSE, hdr_formats, and TRUE.
Referenced by dt_imageio_open().
gboolean dt_imageio_is_raster | ( | const char * | filename | ) |
References FALSE, raster_formats, and TRUE.
Referenced by dt_imageio_open().
gboolean dt_imageio_is_raw | ( | const char * | filename | ) |
References FALSE, raw_formats, and TRUE.
Referenced by dt_imageio_open().
int dt_imageio_large_thumbnail | ( | const char * | filename, |
uint8_t ** | buffer, | ||
int32_t * | th_width, | ||
int32_t * | th_height, | ||
dt_colorspaces_color_profile_type_t * | color_space, | ||
const int | width, | ||
const int | height | ||
) |
Load the thumbnail embedded into a RAW file having at least the size MAX(width, height) x MAX(width, height)
filename | |
buffer | returned image buffer (allocated) |
th_width | returned actual width of the thumbnail |
th_height | returned actual height of the thumbnail |
color_space | returned color space found for the thumbnail |
width | input target width. th_width will be at least this. |
height | input target height th_height will be at least this. |
References color_space, dt_alloc_align, DT_COLORSPACE_SRGB, dt_exif_get_thumbnail(), dt_free_align, dt_imageio_jpeg_decompress(), dt_imageio_jpeg_decompress_header(), error(), height, dt_imageio_jpeg_t::height, MAX, width, and dt_imageio_jpeg_t::width.
Referenced by _get_image_buffer(), _import_get_thumbnail(), _init_8(), and dt_imageio_has_mono_preview().
gboolean dt_imageio_lookup_makermodel | ( | const char * | maker, |
const char * | model, | ||
char * | mk, | ||
int | mk_len, | ||
char * | md, | ||
int | md_len, | ||
char * | al, | ||
int | al_len | ||
) |
References dt_libraw_lookup_makermodel(), dt_rawspeed_lookup_makermodel(), FALSE, maker, and model.
Referenced by dt_collection_get_makermodel(), and dt_image_refresh_makermodel().
dt_imageio_retval_t dt_imageio_open | ( | dt_image_t * | img, |
const char * | filename, | ||
dt_mipmap_buffer_t * | buf | ||
) |
References dt_image_t::crop_height, dt_image_t::crop_width, dt_image_t::crop_x, dt_image_t::crop_y, dt_control_log(), DT_IMAGE_HDR, dt_image_monochrome_flags(), DT_IMAGEIO_CACHE_FULL, DT_IMAGEIO_FILE_CORRUPTED, dt_imageio_is_hdr(), dt_imageio_is_raster(), dt_imageio_is_raw(), DT_IMAGEIO_OK, dt_imageio_open_hdr(), dt_imageio_open_raster(), dt_imageio_open_raw(), dt_imageio_set_hdr_tag(), dt_imageio_update_monochrome_workflow_tag(), dt_image_t::flags, dt_image_t::height, dt_image_t::id, dt_image_t::loader, LOADER_UNKNOWN, dt_image_t::p_height, dt_image_t::p_width, and dt_image_t::width.
Referenced by _generate_blocking().
dt_imageio_retval_t dt_imageio_open_exotic | ( | dt_image_t * | img, |
const char * | filename, | ||
dt_mipmap_buffer_t * | buf | ||
) |
References DT_IMAGEIO_FILE_CORRUPTED, DT_IMAGEIO_OK, dt_imageio_open_gm(), and dt_imageio_open_im().
Referenced by dt_imageio_open_hdr(), dt_imageio_open_raster(), and dt_imageio_open_raw().
dt_imageio_retval_t dt_imageio_open_hdr | ( | dt_image_t * | img, |
const char * | filename, | ||
dt_mipmap_buffer_t * | buf | ||
) |
dt_imageio_retval_t dt_imageio_open_raster | ( | dt_image_t * | img, |
const char * | filename, | ||
dt_mipmap_buffer_t * | buf | ||
) |
dt_imageio_retval_t dt_imageio_open_raw | ( | dt_image_t * | img, |
const char * | filename, | ||
dt_mipmap_buffer_t * | buf | ||
) |
void dt_imageio_set_hdr_tag | ( | dt_image_t * | img | ) |
References DT_IMAGE_HDR, dt_tag_attach(), dt_tag_new(), FALSE, dt_image_t::flags, and dt_image_t::id.
Referenced by _exif_decode_exif_data(), and dt_imageio_open().
void dt_imageio_to_fractional | ( | float | in, |
uint32_t * | num, | ||
uint32_t * | den | ||
) |
void dt_imageio_update_monochrome_workflow_tag | ( | int32_t | id, |
int | mask | ||
) |
References darktable, DT_DEBUG_CONTROL_SIGNAL_RAISE, DT_IMAGE_MONOCHROME, DT_IMAGE_MONOCHROME_BAYER, DT_IMAGE_MONOCHROME_PREVIEW, DT_SIGNAL_TAG_CHANGED, dt_tag_attach(), dt_tag_detach_by_string(), dt_tag_new(), FALSE, and darktable_t::signals.
Referenced by _exif_decode_exif_data(), _image_set_monochrome_flag(), and dt_imageio_open().
|
static |
Referenced by dt_imageio_get_type_from_extension().
|
static |
Referenced by dt_imageio_get_type_from_extension().
|
static |
Referenced by dt_imageio_get_type_from_extension().
|
static |
Referenced by dt_imageio_is_hdr().
|
static |
Referenced by dt_imageio_is_raster().
|
static |
Referenced by dt_imageio_is_raw().