darktable  3.6.1
About: darktable is an open source photography workflow application and RAW developer. A virtual lighttable and darkroom for photographers.
  Fossies Dox: darktable-3.6.1.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

avif.c File Reference
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include "bauhaus/bauhaus.h"
#include "common/colorspaces.h"
#include "common/darktable.h"
#include "common/imageio.h"
#include "common/imageio_module.h"
#include "control/conf.h"
#include "imageio/format/imageio_format_api.h"
#include <avif/avif.h>
Include dependency graph for avif.c:

Go to the source code of this file.

Classes

struct  dt_imageio_avif_t
 
struct  dt_imageio_avif_gui_t
 

Macros

#define AVIF_MIN_TILE_SIZE   512
 
#define AVIF_MAX_TILE_SIZE   3072
 
#define AVIF_DEFAULT_TILE_SIZE   AVIF_MIN_TILE_SIZE * 2
 

Typedefs

typedef struct dt_imageio_avif_t dt_imageio_avif_t
 
typedef struct dt_imageio_avif_gui_t dt_imageio_avif_gui_t
 

Enumerations

enum  avif_compression_type_e { AVIF_COMP_LOSSLESS = 0 , AVIF_COMP_LOSSY = 1 }
 
enum  avif_tiling_e { AVIF_TILING_ON = 0 , AVIF_TILING_OFF }
 
enum  avif_color_mode_e { AVIF_COLOR_MODE_RGB = 0 , AVIF_COLOR_MODE_GRAYSCALE }
 

Functions

int dt_module_dt_version ()
 
int dt_module_mod_version ()
 
static const char * avif_get_compression_string (enum avif_compression_type_e comp)
 
static int floor_log2 (int i)
 
void init (dt_imageio_module_format_t *self)
 
void cleanup (dt_imageio_module_format_t *self)
 
int write_image (struct dt_imageio_module_data_t *data, const char *filename, const void *in, dt_colorspaces_color_profile_type_t over_type, const char *over_filename, void *exif, int exif_len, int imgid, int num, int total, struct dt_dev_pixelpipe_t *pipe, const gboolean export_masks)
 
size_t params_size (dt_imageio_module_format_t *self)
 
voidget_params (dt_imageio_module_format_t *self)
 
int set_params (dt_imageio_module_format_t *self, const void *params, const int size)
 
void free_params (dt_imageio_module_format_t *self, dt_imageio_module_data_t *params)
 
int bpp (struct dt_imageio_module_data_t *data)
 
int levels (struct dt_imageio_module_data_t *data)
 
const char * mime (dt_imageio_module_data_t *data)
 
const char * extension (dt_imageio_module_data_t *data)
 
int flags (struct dt_imageio_module_data_t *data)
 
static void bit_depth_changed (GtkWidget *widget, gpointer user_data)
 
static void color_mode_changed (GtkWidget *widget, gpointer user_data)
 
static void tiling_changed (GtkWidget *widget, gpointer user_data)
 
static void compression_type_changed (GtkWidget *widget, gpointer user_data)
 
static void quality_changed (GtkWidget *slider, gpointer user_data)
 
void gui_init (dt_imageio_module_format_t *self)
 
void gui_cleanup (dt_imageio_module_format_t *self)
 
void gui_reset (dt_imageio_module_format_t *self)
 

Variables

struct {
   char *   name
 
   uint32_t   bit_depth
 
avif_bit_depth []
 

Macro Definition Documentation

◆ AVIF_DEFAULT_TILE_SIZE

#define AVIF_DEFAULT_TILE_SIZE   AVIF_MIN_TILE_SIZE * 2

Definition at line 41 of file avif.c.

◆ AVIF_MAX_TILE_SIZE

#define AVIF_MAX_TILE_SIZE   3072

Definition at line 40 of file avif.c.

◆ AVIF_MIN_TILE_SIZE

#define AVIF_MIN_TILE_SIZE   512

Definition at line 39 of file avif.c.

Typedef Documentation

◆ dt_imageio_avif_gui_t

◆ dt_imageio_avif_t

Enumeration Type Documentation

◆ avif_color_mode_e

Enumerator
AVIF_COLOR_MODE_RGB 
AVIF_COLOR_MODE_GRAYSCALE 

Definition at line 57 of file avif.c.

◆ avif_compression_type_e

Enumerator
AVIF_COMP_LOSSLESS 
AVIF_COMP_LOSSY 

Definition at line 45 of file avif.c.

◆ avif_tiling_e

Enumerator
AVIF_TILING_ON 
AVIF_TILING_OFF 

Definition at line 51 of file avif.c.

Function Documentation

◆ avif_get_compression_string()

static const char * avif_get_compression_string ( enum avif_compression_type_e  comp)
static

Definition at line 104 of file avif.c.

References AVIF_COMP_LOSSLESS, and AVIF_COMP_LOSSY.

Referenced by gui_init(), and write_image().

Here is the caller graph for this function:

◆ bit_depth_changed()

static void bit_depth_changed ( GtkWidget *  widget,
gpointer  user_data 
)
static

Definition at line 699 of file avif.c.

References avif_bit_depth, bit_depth, dt_bauhaus_combobox_get(), and dt_conf_set_int().

Referenced by gui_init(), and gui_reset().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bpp()

int bpp ( struct dt_imageio_module_data_t data)

Definition at line 669 of file avif.c.

Referenced by get_params().

Here is the caller graph for this function:

◆ cleanup()

void cleanup ( dt_imageio_module_format_t self)

Definition at line 201 of file avif.c.

◆ color_mode_changed()

static void color_mode_changed ( GtkWidget *  widget,
gpointer  user_data 
)
static

Definition at line 706 of file avif.c.

References dt_bauhaus_combobox_get(), and dt_conf_set_int().

Referenced by gui_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ compression_type_changed()

static void compression_type_changed ( GtkWidget *  widget,
gpointer  user_data 
)
static

Definition at line 720 of file avif.c.

References AVIF_COMP_LOSSLESS, AVIF_COMP_LOSSY, dt_bauhaus_combobox_get(), dt_conf_set_int(), FALSE, litsupport_rawspeed.modules::module, dt_imageio_avif_gui_t::quality, and TRUE.

Referenced by gui_init(), and gui_reset().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dt_module_dt_version()

int dt_module_dt_version ( )

Definition at line 43 of file avif.c.

◆ dt_module_mod_version()

int dt_module_mod_version ( )

Definition at line 43 of file avif.c.

◆ extension()

const char * extension ( dt_imageio_module_data_t data)

Definition at line 684 of file avif.c.

◆ flags()

int flags ( struct dt_imageio_module_data_t data)

Definition at line 694 of file avif.c.

References FORMAT_FLAGS_SUPPORT_XMP.

◆ floor_log2()

static int floor_log2 ( int  i)
static

Definition at line 118 of file avif.c.

Referenced by write_image().

Here is the caller graph for this function:

◆ free_params()

void free_params ( dt_imageio_module_format_t self,
dt_imageio_module_data_t params 
)

Definition at line 662 of file avif.c.

References dtstyle_to_xmp::params.

◆ get_params()

void * get_params ( dt_imageio_module_format_t self)

Definition at line 605 of file avif.c.

References AVIF_COMP_LOSSLESS, AVIF_COMP_LOSSY, dt_imageio_avif_t::bit_depth, bpp(), dt_imageio_avif_t::color_mode, dt_imageio_avif_t::compression_type, dt_conf_get_bool(), dt_conf_get_int(), dt_conf_get_string(), dt_imageio_avif_t::quality, and dt_imageio_avif_t::tiling.

Here is the call graph for this function:

◆ gui_cleanup()

void gui_cleanup ( dt_imageio_module_format_t self)

Definition at line 910 of file avif.c.

References dt_imageio_module_format_t::gui_data.

◆ gui_init()

◆ gui_reset()

◆ init()

void init ( dt_imageio_module_format_t self)

Definition at line 139 of file avif.c.

References AVIF_COLOR_MODE_GRAYSCALE, AVIF_COMP_LOSSLESS, AVIF_COMP_LOSSY, AVIF_TILING_OFF, AVIF_TILING_ON, bit_depth, darktable, DT_DEBUG_IMAGEIO, dt_lua_register_module_member, dt_print(), FALSE, darktable_t::lua_state, luaA_enum, luaA_enum_value, and dt_imageio_module_format_t::ready.

Here is the call graph for this function:

◆ levels()

int levels ( struct dt_imageio_module_data_t data)

Definition at line 674 of file avif.c.

References IMAGEIO_FLOAT, and IMAGEIO_RGB.

◆ mime()

const char * mime ( dt_imageio_module_data_t data)

Definition at line 679 of file avif.c.

◆ params_size()

size_t params_size ( dt_imageio_module_format_t self)

Definition at line 600 of file avif.c.

◆ quality_changed()

static void quality_changed ( GtkWidget *  slider,
gpointer  user_data 
)
static

Definition at line 739 of file avif.c.

References dt_bauhaus_slider_get(), and dt_conf_set_int().

Referenced by gui_init(), and gui_reset().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_params()

int set_params ( dt_imageio_module_format_t self,
const void params,
const int  size 
)

Definition at line 644 of file avif.c.

References dt_imageio_avif_t::bit_depth, dt_imageio_avif_t::color_mode, dt_imageio_avif_t::compression_type, dt_bauhaus_combobox_set(), dt_bauhaus_slider_set(), extract_wb::g, dt_imageio_module_format_t::gui_data, dtstyle_to_xmp::params, dt_imageio_avif_t::quality, and dt_imageio_avif_t::tiling.

Here is the call graph for this function:

◆ tiling_changed()

static void tiling_changed ( GtkWidget *  widget,
gpointer  user_data 
)
static

Definition at line 713 of file avif.c.

References dt_bauhaus_combobox_get(), and dt_conf_set_bool().

Referenced by gui_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_image()

Variable Documentation

◆ 

const struct { ... } avif_bit_depth[]
Initial value:
= {
{
.name = N_("8 bit"),
.bit_depth = 8
},
{
.name = N_("10 bit"),
.bit_depth = 10
},
{
.name = N_("12 bit"),
.bit_depth = 12
},
{
.name = NULL,
}
}
#define N_(String)
Definition: temperature.c:236

Referenced by bit_depth_changed(), and gui_init().

◆ bit_depth

uint32_t bit_depth

Definition at line 85 of file avif.c.

Referenced by bit_depth_changed(), dt_imageio_open_avif(), gui_init(), init(), read_header(), and write_image().

◆ name

char* name

Definition at line 84 of file avif.c.

Referenced by gui_init().