![]() |
MediaX v1.0.0rc7 [7e6cb74]
Video streaming for military vehicles
|
Helper functions for different colour space options, optimised for CPU. More...
#include <colourspace_cpu.h>
Public Member Functions | |
ColourSpaceCpu ()=default | |
Construct a new Colour Space object. | |
~ColourSpaceCpu () final=default | |
Destroy the Colour Space Cpu object. | |
int | Convert (mediax::rtp::Resolution res, uint8_t *in, AVPixelFormat in_format, uint8_t in_bytes, uint8_t *out, AVPixelFormat out_format, uint8_t out_bytes) const |
Convert the image from one format to another. | |
int | RgbToYuv (uint32_t height, uint32_t width, uint8_t *rgb, uint8_t *yuv) const final |
Convert YUV to RGBA on the CPU. | |
int | RgbToMono8 (uint32_t height, uint32_t width, uint8_t *rgb, uint8_t *mono8) const final |
Convert RGB to Monochrome 8 bits ber pixel on the CPU. | |
int | RgbToMono16 (uint32_t height, uint32_t width, uint8_t *rgb, uint8_t *mono16) const final |
Convert RGB to Monochrome 16 bits ber pixel on the CPU. | |
int | RgbaToYuv (uint32_t width, uint32_t height, uint8_t *rgba, uint8_t *yuv) const final |
Convert RGBA to YUV on the CPU. | |
int | RgbaToRgb (uint32_t width, uint32_t height, uint8_t *rgba, uint8_t *rgb) const final |
Convert RGBA to RGB on the CPU. | |
int | RgbaToBgra (uint32_t width, uint32_t height, uint8_t *rgba, uint8_t *bgra) const final |
Convert RGBA to BGRA on the CPU. | |
int | RgbToBgra (uint32_t width, uint32_t height, uint8_t *rgb, uint8_t *bgra) const final |
Convert RGB to RGBA on the CPU. | |
int | YuvToBgra (uint32_t height, uint32_t width, uint8_t *yuv, uint8_t *bgra) const final |
Convert YUV to RGBA on the CPU. | |
int | Mono8ToBgra (uint32_t width, uint32_t height, uint8_t *mono8, uint8_t *bgra) const final |
Convert Mono8 to RGBA on the CPU. | |
int | Mono16ToBgra (uint32_t width, uint32_t height, uint8_t *mono16, uint8_t *bgra) const final |
Convert Mono16 to RGBA on the CPU. | |
int | Nv12ToBgra (uint32_t height, uint32_t width, uint8_t *nv12, uint8_t *bgra) const |
Construct a new Nv12 To Bgra object. | |
int | Nv12ToRgb (uint32_t height, uint32_t width, uint8_t *nv12, uint8_t *rgb) const |
Construct a new Nv12 To Rgb object. | |
int | RgbToRgba (uint32_t width, uint32_t height, uint8_t *rgb, uint8_t *rgba) const final |
Convert RGB to RGBA on the CPU. | |
int | Yuv422ToRgba (uint32_t height, uint32_t width, uint8_t *yuv422, uint8_t *rgba) const final |
Convert YUV to RGBA on the CPU. | |
int | Yuv420ToRgba (uint32_t height, uint32_t width, uint8_t *yuv420, uint8_t *rgba) const final |
Convert YUV420P to RGBA on the CPU. | |
int | Mono8ToRgba (uint32_t width, uint32_t height, uint8_t *mono8, uint8_t *rgba) const final |
Convert Mono8 to RGBA on the CPU. | |
int | Mono8ToRgb (uint32_t width, uint32_t height, uint8_t *mono8, uint8_t *rgb) const final |
Convert Mono8 to RGB on the CPU. | |
int | Mono16ToRgba (uint32_t width, uint32_t height, uint8_t *mono16, uint8_t *rgba) const final |
Convert Mono16 to RGBA on the CPU. | |
int | Mono16ToRgb (uint32_t width, uint32_t height, uint8_t *mono16, uint8_t *rgb) const final |
Convert Mono16 to RGBA on the CPU. | |
int | YuvToArgb (uint32_t height, uint32_t width, uint8_t *yuv, uint8_t *argb) const |
Convert YUV to RGBA on the CPU. | |
int | YuvToRgb (uint32_t height, uint32_t width, uint8_t *yuv, uint8_t *rgb) const final |
Convert YUV to RGB on the CPU. | |
int | Yuv420pToRgb (uint32_t height, uint32_t width, uint8_t *yuv, uint8_t *rgb) const final |
Convert YUV to RGBA on the CPU. | |
int | ScaleToSizeRgb (uint32_t source_height, uint32_t source_width, uint8_t *source_rgb_buffer, uint32_t target_height, uint32_t target_width, uint8_t *target_rgb_buffer) const final |
Scale the image to the target size. | |
int | ScaleToSizeRgba (uint32_t source_height, uint32_t source_width, uint8_t *source_rgb_buffer, uint32_t target_height, uint32_t target_width, uint8_t *target_rgba_buffer) const final |
Scale the image to the target size. | |
int | ScaleToSizeBgra (uint32_t source_height, uint32_t source_width, uint8_t *source_rgb_buffer, uint32_t target_height, uint32_t target_width, uint8_t *target_bgra_buffer) const |
Scale the image to the target size. | |
![]() | |
ColourSpace ()=default | |
Construct a new Colour Space object. | |
virtual | ~ColourSpace ()=default |
Destroy the Colour Space object. | |
Helper functions for different colour space options, optimised for CPU.
int mediax::video::ColourSpaceCpu::Convert | ( | mediax::rtp::Resolution | res, |
uint8_t * | in, | ||
AVPixelFormat | in_format, | ||
uint8_t | in_bytes, | ||
uint8_t * | out, | ||
AVPixelFormat | out_format, | ||
uint8_t | out_bytes | ||
) | const |
Convert the image from one format to another.
res | The resolution of the image |
in | The input image buffer |
in_format | The input image format |
in_bytes | The input image bytes per pixel |
out | The output image buffer |
out_format | The output image format |
out_bytes | The output image bytes per pixel |
|
finalvirtual |
Convert Mono16 to RGBA on the CPU.
width | The height of the image |
height | The width of the image |
mono16 | The monochrome 16 bit image |
bgra | The BGRA image buffer |
Implements mediax::video::ColourSpace.
|
finalvirtual |
Convert Mono16 to RGBA on the CPU.
width | The height of the image |
height | The width of the image |
mono16 | The monochrome 16 bit image |
rgb | The RGB image buffer |
Implements mediax::video::ColourSpace.
|
finalvirtual |
Convert Mono16 to RGBA on the CPU.
width | The height of the image |
height | The width of the image |
mono16 | The monochrome 16 bit image |
rgba | The RGBA image buffer |
Implements mediax::video::ColourSpace.
|
finalvirtual |
Convert Mono8 to RGBA on the CPU.
width | The height of the image |
height | The width of the image |
mono8 | The monochrome 8 bit image |
bgra | The BGRA image buffer |
Implements mediax::video::ColourSpace.
|
finalvirtual |
Convert Mono8 to RGB on the CPU.
width | |
height | |
mono8 | |
rgb |
Implements mediax::video::ColourSpace.
|
finalvirtual |
Convert Mono8 to RGBA on the CPU.
width | The height of the image |
height | The width of the image |
mono8 | The monochrome 8 bit image |
rgba | The RGBA image buffer |
Implements mediax::video::ColourSpace.
int mediax::video::ColourSpaceCpu::Nv12ToBgra | ( | uint32_t | height, |
uint32_t | width, | ||
uint8_t * | nv12, | ||
uint8_t * | bgra | ||
) | const |
Construct a new Nv12 To Bgra object.
width | The height of the image |
height | The width of the image |
nv12 | The NV12 bit image |
bgra | The BGRA image buffer |
int mediax::video::ColourSpaceCpu::Nv12ToRgb | ( | uint32_t | height, |
uint32_t | width, | ||
uint8_t * | nv12, | ||
uint8_t * | rgb | ||
) | const |
Construct a new Nv12 To Rgb object.
height | |
width | |
nv12 | |
rgb |
|
finalvirtual |
Convert RGBA to BGRA on the CPU.
width | |
height | |
rgba | |
bgra |
Implements mediax::video::ColourSpace.
|
finalvirtual |
Convert RGBA to RGB on the CPU.
width | |
height | |
rgba | |
rgb |
Implements mediax::video::ColourSpace.
|
finalvirtual |
Convert RGBA to YUV on the CPU.
width | The width of the image |
height | The height of the image |
rgba | The RGB image buffer |
yuv | The YUV:422 image buffer |
Implements mediax::video::ColourSpace.
|
finalvirtual |
Convert RGB to RGBA on the CPU.
width | The height of the image |
height | The width of the image |
rgb | The RGB image buffer |
bgra | The BGRA image buffer |
Implements mediax::video::ColourSpace.
|
finalvirtual |
Convert RGB to Monochrome 16 bits ber pixel on the CPU.
height | The height of the image |
width | The width of the image |
rgb | The RGB image buffer |
mono16 | The monochrome 16 image buffer |
Implements mediax::video::ColourSpace.
|
finalvirtual |
Convert RGB to Monochrome 8 bits ber pixel on the CPU.
height | The height of the image |
width | The width of the image |
rgb | The RGB image buffer |
mono8 | The monochrome 8 image buffer |
Implements mediax::video::ColourSpace.
|
finalvirtual |
Convert RGB to RGBA on the CPU.
width | The height of the image |
height | The width of the image |
rgb | The RGB image buffer |
rgba | The RGBA image buffer |
Implements mediax::video::ColourSpace.
|
finalvirtual |
Convert YUV to RGBA on the CPU.
height | The height of the image |
width | The width of the image |
rgb | The RGB image buffer |
yuv | The YUV:422 image buffer |
Implements mediax::video::ColourSpace.
int mediax::video::ColourSpaceCpu::ScaleToSizeBgra | ( | uint32_t | source_height, |
uint32_t | source_width, | ||
uint8_t * | source_rgb_buffer, | ||
uint32_t | target_height, | ||
uint32_t | target_width, | ||
uint8_t * | target_bgra_buffer | ||
) | const |
Scale the image to the target size.
source_height | The height of the source image |
source_width | The width of the source image |
source_rgb_buffer | The source image buffer |
target_height | The height of the target image |
target_width | The width of the target image |
target_bgra_buffer | The target image buffer |
|
finalvirtual |
Scale the image to the target size.
source_height | The height of the source image |
source_width | The width of the source image |
source_rgb_buffer | The source image buffer |
target_height | The height of the target image |
target_width | The width of the target image |
target_rgb_buffer | The target image buffer |
Implements mediax::video::ColourSpace.
|
finalvirtual |
Scale the image to the target size.
source_height | The height of the source image |
source_width | The width of the source image |
source_rgb_buffer | The source image buffer |
target_height | The height of the target image |
target_width | The width of the target image |
target_rgba_buffer | The target image buffer |
Implements mediax::video::ColourSpace.
|
finalvirtual |
Convert YUV to RGBA on the CPU.
height | The height of the image |
width | The width of the image |
yuv | The YUV:420p image buffer |
rgb | The RGB image buffer |
Implements mediax::video::ColourSpace.
|
finalvirtual |
Convert YUV420P to RGBA on the CPU.
height | The height of the image |
width | The width of the image |
yuv420 | The YUV:420P image buffer |
rgba | The RGBA image buffer |
Implements mediax::video::ColourSpace.
|
finalvirtual |
Convert YUV to RGBA on the CPU.
height | The height of the image |
width | The width of the image |
yuv422 | The YUV:422 image buffer |
rgba | The RGBA image buffer |
Implements mediax::video::ColourSpace.
int mediax::video::ColourSpaceCpu::YuvToArgb | ( | uint32_t | height, |
uint32_t | width, | ||
uint8_t * | yuv, | ||
uint8_t * | argb | ||
) | const |
Convert YUV to RGBA on the CPU.
height | |
width | |
yuv | |
argb |
|
finalvirtual |
Convert YUV to RGBA on the CPU.
height | The height of the image |
width | The width of the image |
yuv | The YUV:422 image buffer |
bgra | The BGRA image buffer |
Implements mediax::video::ColourSpace.
|
finalvirtual |
Convert YUV to RGB on the CPU.
height | The height of the image |
width | The width of the image |
yuv | The YUV:422 image buffer |
rgb | The RGB image buffer |
Implements mediax::video::ColourSpace.