defocus-modules/include/defocus/models.h

41 lines
1.4 KiB
C

#ifndef DF_MODELS_H
#define DF_MODELS_H
/** @file models.h
* @brief Camera models for defocus.
*
* Camera models are usually implemented as a function taking an input image and parameters required for the model
* and produce an output image.
*
* All camera models use the same coordinate space: The camera looks along the positive z-axis in a right-handed
* coordinate system. (-> positive y is down, positive x is right.)
*/
#include "image.h"
/** @brief Simple pinhole camera model.
*
* The simplest possible(?) camera model.
* This function takes an input image at a known distance from the camera and moves it to a new distance.
*
* @param in_image input image
* @param focal_length the cameras focal length in millimeters.
* @param orig_z the distance of the input image from the camera.
* @param new_z the distance of the generated output image.
* @param out_image the output image.
*/
void df_pinhole(const df_image *in_image, float focal_length, float orig_z, float new_z, df_image *out_image);
/** @brief Thin-lense model.
*
* @param in_image input image
* @param focal_length the cameras focal length in millimeters.
* @param aperture the aperture size in millimeters.
* @param orig_z the distnce of the input image from the camera.
* @param out_image the output image.
*/
void df_thin_lense(
const df_image *in_image, float focal_length, float aperture, float orig_z, float new_z, df_image *out_image);
#endif