CaptureMoment 0.1.0
Free and open-source non-destructive photo editor
Loading...
Searching...
No Matches
CaptureMoment::Core::ImageProcessing Namespace Reference

Classes

class  BenchmarkingBackendDecider
 Implements IBackendDecider using a runtime performance comparison strategy. More...
 
interface  IBackendDecider
 Abstract interface defining the strategy for hardware backend selection. More...
 
struct  ImageView
 Represents a zero-copy window over contiguous image memory. More...
 
interface  IWorkingImageHardware
 Abstract interface representing an image used as a working buffer. More...
 
class  WorkingImageContext
 Manages the lifecycle of a single IWorkingImage instance and its data. More...
 
class  WorkingImageCPU
 Class extending IWorkingImageHardware for CPU-specific implementations. This class defines the base contract for all working image implementations that store their data on the CPU. Specific CPU backend implementations (e.g., Halide, SIMD, OpenMP) should inherit from this interface. It ensures that all CPU-based implementations provide the core functionality. More...
 
class  WorkingImageCPU_Default
 Fallback CPU backend operating directly on the Context's memory view. More...
 
class  WorkingImageCPU_Halide
 Updates the internal image data from a CPU-based ImageRegion. More...
 
class  WorkingImageData
 Base class providing raw buffer storage and metadata for working images. More...
 
class  WorkingImageFactory
 Factory with registration support for creating IWorkingImageHardware instances. More...
 
class  WorkingImageGPU
 Class extending IWorkingImageHardware for GPU-specific implementations. More...
 
class  WorkingImageGPU_Halide
 Concrete implementation of WorkingImageGPU using Halide for processing. More...
 
class  WorkingImageHalide
 Base class providing common Halide buffer functionality for image processing. More...
 

Functions

static std::string feature_to_string (Halide::Target::Feature feature)
 Converts a Halide Target::Feature to a human-readable string.
 
static bool should_test_feature (Halide::Target::Feature feature)
 Checks if a GPU feature should be tested on the current platform.
 
static Halide::Buffer< float > create_fresh_test_buffer (int width, int height, int channels)
 Creates a fresh test buffer filled with gradient data.
 
static Halide::Func create_benchmark_pipeline (const Halide::Buffer< float > &input, Halide::Var &x, Halide::Var &y, Halide::Var &c)
 Creates a simple brightness adjustment pipeline for benchmarking.
 
static bool try_compile_jit (Halide::Func &pipeline, const Halide::Target &target)
 Attempts to compile a pipeline for a GPU target.
 
static Halide::Expr kernel_cubic (Halide::Expr x)
 
void registerDefaultBackends ()
 Registers all default Core backends (CPU and GPU) to the factory.
 

Function Documentation

◆ feature_to_string()

static std::string CaptureMoment::Core::ImageProcessing::feature_to_string ( Halide::Target::Feature feature)
static

Converts a Halide Target::Feature to a human-readable string.

Parameters
featureThe Halide feature enum value.
Returns
String representation of the feature name.

Definition at line 26 of file benchmarking_backend_decider.cpp.

◆ should_test_feature()

static bool CaptureMoment::Core::ImageProcessing::should_test_feature ( Halide::Target::Feature feature)
static

Checks if a GPU feature should be tested on the current platform.

Parameters
featureThe GPU feature to check.
Returns
true if the feature should be tested, false to skip entirely.

Definition at line 44 of file benchmarking_backend_decider.cpp.

Referenced by CaptureMoment::Core::ImageProcessing::BenchmarkingBackendDecider::decide().

◆ create_fresh_test_buffer()

static Halide::Buffer< float > CaptureMoment::Core::ImageProcessing::create_fresh_test_buffer ( int width,
int height,
int channels )
static

Creates a fresh test buffer filled with gradient data.

Returns
A new Halide::Buffer<float> ready for GPU testing.
Note
IMPORTANT: Each GPU backend needs a FRESH buffer because:
  • Halide buffers become "tied" to a specific device interface
  • Reusing a buffer across different GPU backends causes: "halide_copy_to_device does not support switching interfaces"

Definition at line 83 of file benchmarking_backend_decider.cpp.

Referenced by CaptureMoment::Core::ImageProcessing::BenchmarkingBackendDecider::decide().

◆ create_benchmark_pipeline()

static Halide::Func CaptureMoment::Core::ImageProcessing::create_benchmark_pipeline ( const Halide::Buffer< float > & input,
Halide::Var & x,
Halide::Var & y,
Halide::Var & c )
static

Creates a simple brightness adjustment pipeline for benchmarking.

Parameters
inputThe input buffer to process.
xThe x dimension variable.
yThe y dimension variable.
cThe c dimension variable.
Returns
A Halide Func representing the pipeline.

Definition at line 109 of file benchmarking_backend_decider.cpp.

◆ try_compile_jit()

static bool CaptureMoment::Core::ImageProcessing::try_compile_jit ( Halide::Func & pipeline,
const Halide::Target & target )
static

Attempts to compile a pipeline for a GPU target.

Parameters
pipelineThe pipeline to compile.
targetThe target to compile for.
Returns
true if compilation succeeded, false otherwise.

Definition at line 123 of file benchmarking_backend_decider.cpp.

◆ kernel_cubic()

static Halide::Expr CaptureMoment::Core::ImageProcessing::kernel_cubic ( Halide::Expr x)
static

Definition at line 122 of file working_image_gpu_halide.cpp.

◆ registerDefaultBackends()

void CaptureMoment::Core::ImageProcessing::registerDefaultBackends ( )

Registers all default Core backends (CPU and GPU) to the factory.

This function must be called once during application startup (before any images are processed) to populate the factory's registry. It includes the concrete implementations (WorkingImageCPU_Halide, WorkingImageGPU_Halide) and registers them.

If you add custom backends (e.g., Plugins), you can call this function first and then register your own custom backends.

Note
This function is NOT thread-safe regarding the underlying factory registry map. Ensure it is called from a single thread at startup.

Definition at line 21 of file working_image_registration.cpp.

References CaptureMoment::Core::Common::CPU_RAM, CaptureMoment::Core::Common::GPU_MEMORY, and CaptureMoment::Core::ImageProcessing::WorkingImageFactory::registerCreator().

CaptureMoment — footer