thin lense model prototype
This commit is contained in:
parent
ffbe68606b
commit
9b14e29924
|
@ -4,12 +4,14 @@
|
|||
#include <defocus/defocus.h>
|
||||
|
||||
int pinhole_fn(int argc, char **argv);
|
||||
int thin_lense_fn(int argc, char **argv);
|
||||
|
||||
static const char *_model_names[] = {"pinhole"};
|
||||
static const char *_model_names[] = {"pinhole", "thin_lense"};
|
||||
typedef int (*model_fn)(int argc, char **argv);
|
||||
|
||||
static model_fn _model_fns[] = {
|
||||
pinhole_fn,
|
||||
thin_lense_fn,
|
||||
};
|
||||
|
||||
void usage(const char *pname)
|
||||
|
@ -121,3 +123,9 @@ int pinhole_fn(int argc, char **argv)
|
|||
|
||||
return error_code;
|
||||
}
|
||||
|
||||
int thin_lense_fn(int argc, char **argv)
|
||||
{
|
||||
fprintf(stderr, "Not implemented yet");
|
||||
return 1;
|
||||
}
|
|
@ -6,6 +6,6 @@
|
|||
*/
|
||||
#include "base.h"
|
||||
#include "image.h"
|
||||
#include "pinhole.h"
|
||||
#include "models.h"
|
||||
|
||||
#endif
|
||||
|
|
40
include/defocus/models.h
Normal file
40
include/defocus/models.h
Normal file
|
@ -0,0 +1,40 @@
|
|||
#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
|
|
@ -1,12 +0,0 @@
|
|||
#ifndef DF_PINHOLE_H
|
||||
#define DF_PINHOLE_H
|
||||
|
||||
/** @file pinhole.h
|
||||
* @brief Defocus based on pinhole camera model.
|
||||
*/
|
||||
|
||||
#include "image.h"
|
||||
|
||||
void df_pinhole(const df_image *in_image, float focal_length, float orig_z, float new_z, df_image *out_image);
|
||||
|
||||
#endif
|
|
@ -1,4 +1,4 @@
|
|||
#include <defocus/pinhole.h>
|
||||
#include <defocus/models.h>
|
||||
#include <defocus/base.h>
|
||||
#include <defocus/image.h>
|
||||
|
||||
|
|
6
lib/thin_lense.c
Normal file
6
lib/thin_lense.c
Normal file
|
@ -0,0 +1,6 @@
|
|||
#include <defocus/models.h>
|
||||
|
||||
void df_thin_lense(
|
||||
const df_image *in_image, float focal_length, float aperture, float orig_z, float new_z, df_image *out_image)
|
||||
{
|
||||
}
|
|
@ -11,6 +11,7 @@ lib = library('df',
|
|||
'lib/pinhole.c',
|
||||
'lib/image.c',
|
||||
'lib/color.c',
|
||||
'lib/thin_lense.c',
|
||||
include_directories: incdir,
|
||||
dependencies: m_dep,
|
||||
version: '0.1.0',
|
||||
|
|
Loading…
Reference in New Issue
Block a user