Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
imageio.h File Reference
#include "common/image.h"
#include "common/imageio_module.h"
#include "common/mipmap_cache.h"
#include "common/tags.h"
#include <glib.h>
#include <stdio.h>
#include <inttypes.h>
+ Include dependency graph for imageio.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define FILTERS_ARE_CYGM(filters)    ((filters) == 0xb4b4b4b4 || (filters) == 0x4b4b4b4b || (filters) == 0x1e1e1e1e || (filters) == 0xe1e1e1e1)
 
#define FILTERS_ARE_RGBE(filters)    ((filters) == 0x63636363 || (filters) == 0x36363636 || (filters) == 0x9c9c9c9c || (filters) == 0xc9c9c9c9)
 
#define FILTERS_ARE_4BAYER(filters)   (FILTERS_ARE_CYGM(filters) || FILTERS_ARE_RGBE(filters))
 
#define ADOBE_COEFF_FACTOR   10000
 

Typedefs

typedef enum dt_imageio_levels_t dt_imageio_levels_t
 

Enumerations

enum  dt_imageio_levels_t {
  IMAGEIO_INT8 = 0x0 ,
  IMAGEIO_INT12 = 0x1 ,
  IMAGEIO_INT16 = 0x2 ,
  IMAGEIO_INT32 = 0x3 ,
  IMAGEIO_FLOAT = 0x4 ,
  IMAGEIO_BW = 0x5 ,
  IMAGEIO_PREC_MASK = 0xFF ,
  IMAGEIO_RGB = 0x100 ,
  IMAGEIO_GRAY = 0x200 ,
  IMAGEIO_CHANNEL_MASK = 0xFF00
}
 

Functions

gboolean dt_imageio_is_ldr (const char *filename)
 
gboolean dt_imageio_has_mono_preview (const char *filename)
 
void dt_imageio_set_hdr_tag (dt_image_t *img)
 
void dt_imageio_update_monochrome_workflow_tag (int32_t id, int mask)
 
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 (dt_image_t *img, const char *filename, dt_mipmap_buffer_t *buf)
 
dt_imageio_retval_t dt_imageio_open_exotic (dt_image_t *img, const char *filename, dt_mipmap_buffer_t *buf)
 
int dt_imageio_export (const int32_t imgid, const char *filename, struct dt_imageio_module_format_t *format, struct 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)
 
int dt_imageio_export_with_flags (const int32_t imgid, const char *filename, struct dt_imageio_module_format_t *format, struct 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)
 
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)
 
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_lookup_makermodel (const char *maker, const char *model, char *mk, int mk_len, char *md, int md_len, char *al, int al_len)
 
dt_image_flags_t dt_imageio_get_type_from_extension (const char *extension)
 

Macro Definition Documentation

◆ ADOBE_COEFF_FACTOR

#define ADOBE_COEFF_FACTOR   10000

◆ FILTERS_ARE_4BAYER

#define FILTERS_ARE_4BAYER (   filters)    (FILTERS_ARE_CYGM(filters) || FILTERS_ARE_RGBE(filters))
Todo:
: kill this pls.

◆ FILTERS_ARE_CYGM

#define FILTERS_ARE_CYGM (   filters)     ((filters) == 0xb4b4b4b4 || (filters) == 0x4b4b4b4b || (filters) == 0x1e1e1e1e || (filters) == 0xe1e1e1e1)

◆ FILTERS_ARE_RGBE

#define FILTERS_ARE_RGBE (   filters)     ((filters) == 0x63636363 || (filters) == 0x36363636 || (filters) == 0x9c9c9c9c || (filters) == 0xc9c9c9c9)

Typedef Documentation

◆ dt_imageio_levels_t

Enumeration Type Documentation

◆ dt_imageio_levels_t

Enumerator
IMAGEIO_INT8 
IMAGEIO_INT12 
IMAGEIO_INT16 
IMAGEIO_INT32 
IMAGEIO_FLOAT 
IMAGEIO_BW 
IMAGEIO_PREC_MASK 
IMAGEIO_RGB 
IMAGEIO_GRAY 
IMAGEIO_CHANNEL_MASK 

Function Documentation

◆ dt_imageio_export()

int dt_imageio_export ( const int32_t  imgid,
const char *  filename,
struct dt_imageio_module_format_t format,
struct 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 
)

◆ dt_imageio_export_with_flags()

int dt_imageio_export_with_flags ( const int32_t  imgid,
const char *  filename,
struct dt_imageio_module_format_t format,
struct 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(), _clamp_float_to_uint8(), _export_apply_lua_actions(), _export_final_buffer_to_uint16(), _filter_pipeline(), _get_export_size(), _print_export_debug(), _swap_byteorder_float_to_uint8(), 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_alloc_align, DT_COLORSPACE_SRGB, dt_colorspaces_get_output_profile(), dt_control_log(), DT_DEBUG_CONTROL_SIGNAL_RAISE, DT_DEBUG_IMAGEIO, dt_dev_cleanup(), 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_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_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_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, 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().

◆ dt_imageio_flip_buffers()

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 
)

◆ dt_imageio_flip_buffers_ui8_to_float()

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

dt_image_flags_t dt_imageio_get_type_from_extension ( const char *  extension)

◆ dt_imageio_has_mono_preview()

gboolean dt_imageio_has_mono_preview ( const char *  filename)

◆ dt_imageio_is_ldr()

gboolean dt_imageio_is_ldr ( const char *  filename)

◆ dt_imageio_large_thumbnail()

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)

Parameters
filename
bufferreturned image buffer (allocated)
th_widthreturned actual width of the thumbnail
th_heightreturned actual height of the thumbnail
color_spacereturned color space found for the thumbnail
widthinput target width. th_width will be at least this.
heightinput target height th_height will be at least this.
Returns
int 0 on success
Todo:
: check if the embedded thumbs have a color space set! currently we assume that it's always sRGB

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

◆ dt_imageio_lookup_makermodel()

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 
)

◆ dt_imageio_open()

◆ dt_imageio_open_exotic()

◆ dt_imageio_open_hdr()

◆ dt_imageio_open_raster()

◆ dt_imageio_set_hdr_tag()

◆ dt_imageio_update_monochrome_workflow_tag()