Blender V4.3
merge.cpp File Reference
#include "session/merge.h"
#include "util/array.h"
#include "util/map.h"
#include "util/system.h"
#include "util/time.h"
#include "util/unique_ptr.h"
#include <OpenImageIO/filesystem.h>
#include <OpenImageIO/imageio.h>

Go to the source code of this file.

Classes

struct  MergeImagePass
 
struct  SampleCount
 
struct  MergeImageLayer
 
struct  MergeImage
 

Enumerations

enum  MergeChannelOp {
  MERGE_CHANNEL_NOP , MERGE_CHANNEL_COPY , MERGE_CHANNEL_SUM , MERGE_CHANNEL_AVERAGE ,
  MERGE_CHANNEL_SAMPLES
}
 

Functions

static MergeChannelOp parse_channel_operation (const string &pass_name)
 
static bool split_last_dot (string &in, string &suffix)
 
static bool parse_channel_name (string name, string &renderlayer, string &pass, string &channel, bool multiview_channels)
 
static bool parse_channels (const ImageSpec &in_spec, vector< MergeImageLayer > &layers, string &error)
 
static bool open_images (const vector< string > &filepaths, vector< MergeImage > &images, string &error)
 
static void merge_render_time (ImageSpec &spec, const vector< MergeImage > &images, const string &name, const bool average)
 
static void merge_layer_render_time (ImageSpec &spec, const vector< MergeImage > &images, const string &layer_name, const string &time_name, const bool average)
 
static void merge_channels_metadata (vector< MergeImage > &images, ImageSpec &out_spec)
 
static void alloc_pixels (const ImageSpec &spec, array< float > &pixels)
 
static bool merge_pixels (const vector< MergeImage > &images, const ImageSpec &out_spec, const unordered_map< string, SampleCount > &layer_samples, array< float > &out_pixels, string &error)
 
static bool save_output (const string &filepath, const ImageSpec &spec, const array< float > &pixels, string &error)
 
static void read_layer_samples (vector< MergeImage > &images, unordered_map< string, SampleCount > &layer_samples)
 

Enumeration Type Documentation

◆ MergeChannelOp

Enumerator
MERGE_CHANNEL_NOP 
MERGE_CHANNEL_COPY 
MERGE_CHANNEL_SUM 
MERGE_CHANNEL_AVERAGE 
MERGE_CHANNEL_SAMPLES 

Definition at line 22 of file merge.cpp.

Function Documentation

◆ alloc_pixels()

static void alloc_pixels ( const ImageSpec & spec,
array< float > & pixels )
static

Definition at line 385 of file merge.cpp.

Referenced by merge_pixels().

◆ merge_channels_metadata()

static void merge_channels_metadata ( vector< MergeImage > & images,
ImageSpec & out_spec )
static

◆ merge_layer_render_time()

static void merge_layer_render_time ( ImageSpec & spec,
const vector< MergeImage > & images,
const string & layer_name,
const string & time_name,
const bool average )
static

◆ merge_pixels()

static bool merge_pixels ( const vector< MergeImage > & images,
const ImageSpec & out_spec,
const unordered_map< string, SampleCount > & layer_samples,
array< float > & out_pixels,
string & error )
static

◆ merge_render_time()

static void merge_render_time ( ImageSpec & spec,
const vector< MergeImage > & images,
const string & name,
const bool average )
static

◆ open_images()

static bool open_images ( const vector< string > & filepaths,
vector< MergeImage > & images,
string & error )
static

Definition at line 238 of file merge.cpp.

References error(), image(), MergeImage::in, and parse_channels().

Referenced by ImageMerger::run().

◆ parse_channel_name()

static bool parse_channel_name ( string name,
string & renderlayer,
string & pass,
string & channel,
bool multiview_channels )
static

Definition at line 115 of file merge.cpp.

References split_last_dot(), and view.

Referenced by parse_channels().

◆ parse_channel_operation()

static MergeChannelOp parse_channel_operation ( const string & pass_name)
static

◆ parse_channels()

static bool parse_channels ( const ImageSpec & in_spec,
vector< MergeImageLayer > & layers,
string & error )
static

◆ read_layer_samples()

static void read_layer_samples ( vector< MergeImage > & images,
unordered_map< string, SampleCount > & layer_samples )
static

Definition at line 527 of file merge.cpp.

References array< T, alignment >::data(), initialize(), and array< T, alignment >::resize().

Referenced by ImageMerger::run().

◆ save_output()

static bool save_output ( const string & filepath,
const ImageSpec & spec,
const array< float > & pixels,
string & error )
static

Definition at line 477 of file merge.cpp.

References error(), and unique_name().

Referenced by ImageMerger::run().

◆ split_last_dot()

static bool split_last_dot ( string & in,
string & suffix )
static

Definition at line 101 of file merge.cpp.

References pos.

Referenced by parse_channel_name().