y8i-to-y8y8.cpp
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2019 Intel Corporation. All Rights Reserved.
3 
4 #include "y8i-to-y8y8.h"
5 
6 #include "stream.h"
7 
8 #ifdef RS2_USE_CUDA
9 #include "cuda/cuda-conversion.cuh"
10 #endif
11 
12 namespace librealsense
13 {
14  struct y8i_pixel { uint8_t l, r; };
15  void unpack_y8_y8_from_y8i(byte * const dest[], const byte * source, int width, int height, int actual_size)
16  {
17  auto count = width * height;
18 #ifdef RS2_USE_CUDA
19  rscuda::split_frame_y8_y8_from_y8i_cuda(dest, count, reinterpret_cast<const y8i_pixel *>(source));
20 #else
21  split_frame(dest, count, reinterpret_cast<const y8i_pixel*>(source),
22  [](const y8i_pixel & p) -> uint8_t { return p.l; },
23  [](const y8i_pixel & p) -> uint8_t { return p.r; });
24 #endif
25  }
26 
27  y8i_to_y8y8::y8i_to_y8y8(int left_idx, int right_idx) :
28  y8i_to_y8y8("Y8i to Y8-Y8 Converter", left_idx, right_idx) {}
29 
30  y8i_to_y8y8::y8i_to_y8y8(const char * name, int left_idx, int right_idx)
33  {}
34 
35  void y8i_to_y8y8::process_function(byte * const dest[], const byte * source, int width, int height, int actual_size, int input_size)
36  {
37  unpack_y8_y8_from_y8i(dest, source, width, height, actual_size);
38  }
39 } // namespace librealsense
y8i_to_y8y8(int left_idx=1, int right_idx=2)
Definition: y8i-to-y8y8.cpp:27
GLuint const GLchar * name
GLfloat GLfloat p
Definition: glext.h:12687
unsigned char uint8_t
Definition: stdint.h:78
void unpack_y8_y8_from_y8i(byte *const dest[], const byte *source, int width, int height, int actual_size)
Definition: y8i-to-y8y8.cpp:15
void process_function(byte *const dest[], const byte *source, int width, int height, int actual_size, int input_size) override
Definition: y8i-to-y8y8.cpp:35
GLint GLsizei GLsizei height
unsigned char byte
Definition: src/types.h:52
GLint GLsizei count
GLsizei GLsizei GLchar * source
LZ4LIB_API char * dest
Definition: lz4.h:438
void split_frame(byte *const dest[], int count, const SOURCE *source, SPLIT_A split_a, SPLIT_B split_b)
Definition: image.h:15
GLint GLsizei width


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:50:23