27struct ApplyIntrinsicsFunction {
28 ApplyIntrinsicsFunction(
const CameraIntrinsics& intrinsics,
33 double normalized_x, normalized_y;
39struct InvertIntrinsicsFunction {
40 InvertIntrinsicsFunction(
const CameraIntrinsics& intrinsics,
45 double normalized_x, normalized_y;
48 normalized_x, normalized_y, warp_x, warp_y);
57template <
typename WarpFunction>
58void LookupWarpGrid::Compute(
const CameraIntrinsics& intrinsics,
67# pragma omp parallel for schedule(static) \
68 num_threads(threads_) if (threads_ > 1 && height > 100)
72 double src_x = (
x - 0.5 *
overscan *
w) / aspx,
74 double warp_x, warp_y;
75 WarpFunction(intrinsics, src_x, src_y, &warp_x, &warp_y);
76 warp_x = warp_x * aspx + 0.5 *
overscan *
w;
77 warp_y = warp_y * aspy + 0.5 *
overscan * h;
78 int ix =
int(warp_x), iy =
int(warp_y);
79 int fx =
round((warp_x - ix) * 256), fy =
round((warp_y - iy) * 256);
100 Offset offset = {(short)(ix -
x),
104 offset_[
y *
width +
x] = offset;
109template <
typename WarpFunction>
118 if (offset_ ==
NULL) {
129template <
typename PixelType>
134 PixelType* output_buffer) {
136# pragma omp parallel for schedule(static) \
137 num_threads(threads_) if (threads_ > 1 && height > 100)
141 Offset offset = offset_[
y *
width +
x];
142 const int pixel_index =
144 const PixelType* s = &input_buffer[pixel_index];
145 for (
int i = 0; i <
channels; i++) {
147 ((s[i] * (256 - offset.fx) + s[
channels + i] * offset.fx) *
160template <
typename PixelType>
166 PixelType* output_buffer) {
169 distort_.Update<InvertIntrinsicsFunction>(*
this, width, height, overscan);
170 distort_.Apply<PixelType>(
171 input_buffer, width, height,
channels, output_buffer);
174template <
typename PixelType>
180 PixelType* output_buffer) {
183 undistort_.Update<ApplyIntrinsicsFunction>(*
this, width, height, overscan);
185 undistort_.Apply<PixelType>(
186 input_buffer, width, height,
channels, output_buffer);
typedef double(DMatrix)[4][4]
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Brightness Control the brightness and contrast of the input color Vector Map input vector components with curves Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert Invert a producing a negative Combine Generate a color from its and blue channels(Deprecated)") DefNode(ShaderNode
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
void NormalizedToImageSpace(double normalized_x, double normalized_y, double *image_x, double *image_y) const
virtual void ApplyIntrinsics(double normalized_x, double normalized_y, double *image_x, double *image_y) const =0
virtual void InvertIntrinsics(double image_x, double image_y, double *normalized_x, double *normalized_y) const =0
void ImageSpaceToNormalized(double image_x, double image_y, double *normalized_x, double *normalized_y) const
void DistortBuffer(const PixelType *input_buffer, int width, int height, double overscan, int channels, PixelType *output_buffer)
void UndistortBuffer(const PixelType *input_buffer, int width, int height, double overscan, int channels, PixelType *output_buffer)
void Apply(const PixelType *input_buffer, int width, int height, int channels, PixelType *output_buffer)
void Update(const CameraIntrinsics &intrinsics, int width, int height, double overscan)
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int