libsstvenc
Asynchronous Analogue SSTV encoder
|
Functions | |
uint8_t | sstvenc_yuv_calc_y (uint8_t r, uint8_t g, uint8_t b) |
uint8_t | sstvenc_yuv_calc_u (uint8_t r, uint8_t g, uint8_t b) |
uint8_t | sstvenc_yuv_calc_v (uint8_t r, uint8_t g, uint8_t b) |
uint8_t | sstvenc_rgb_calc_r (uint8_t r, uint8_t g, uint8_t b) |
uint8_t | sstvenc_rgb_calc_g (uint8_t r, uint8_t g, uint8_t b) |
uint8_t | sstvenc_rgb_calc_b (uint8_t r, uint8_t g, uint8_t b) |
void | sstvenc_rgb_to_mono (uint8_t *dest, const uint8_t *src, uint16_t width, uint16_t height) |
void | sstvenc_rgb_to_yuv (uint8_t *dest, const uint8_t *src, uint16_t width, uint16_t height) |
void | sstvenc_yuv_to_rgb (uint8_t *dest, const uint8_t *src, uint16_t width, uint16_t height) |
void | sstvenc_yuv_to_mono (uint8_t *dest, const uint8_t *src, uint16_t width, uint16_t height) |
void | sstvenc_mono_to_rgb (uint8_t *dest, const uint8_t *src, uint16_t width, uint16_t height) |
void | sstvenc_mono_to_yuv (uint8_t *dest, const uint8_t *src, uint16_t width, uint16_t height) |
Functions for extracting the Y, U or V components of a RGB colour. The equations in this module came from JL Barber (N7CXI)'s presentation at the Dayton SSSTV forum, 2000-05-20.
http://www.barberdsp.com/downloads/Dayton%20Paper.pdf
void sstvenc_mono_to_rgb | ( | uint8_t * | dest, |
const uint8_t * | src, | ||
uint16_t | width, | ||
uint16_t | height ) |
Convert the given mono framebuffer to RGB.
[out] | dest | Destination framebuffer, which is assumed to be triple the size of src. This can be the same location as src – so long as the buffer is sufficiently large. |
[in] | src | Source framebuffer, which is assumed to be mono |
[in] | width | Width of the framebuffer in pixels |
[in] | height | Height of the framebuffer in pixels |
Definition at line 122 of file yuv.c.
void sstvenc_mono_to_yuv | ( | uint8_t * | dest, |
const uint8_t * | src, | ||
uint16_t | width, | ||
uint16_t | height ) |
Convert the given mono framebuffer to YUV.
[out] | dest | Destination framebuffer, which is assumed to be triple the size as src. This can be the same location as src if it is big enough. |
[in] | src | Source framebuffer, which is assumed to be RGB |
[in] | width | Width of the framebuffer in pixels |
[in] | height | Height of the framebuffer in pixels |
Definition at line 138 of file yuv.c.
uint8_t sstvenc_rgb_calc_b | ( | uint8_t | r, |
uint8_t | g, | ||
uint8_t | b ) |
Return the blue component of a YUV colour.
[in] | y | Y (monochrome) component in Q8 fixed-point |
[in] | u | U (Y - R) component in Q8 fixed-point |
[in] | v | V (Y - B) component in Q8 fixed-point |
Definition at line 53 of file yuv.c.
Referenced by sstvenc_yuv_to_rgb().
uint8_t sstvenc_rgb_calc_g | ( | uint8_t | r, |
uint8_t | g, | ||
uint8_t | b ) |
Return the green component of a YUV colour.
[in] | y | Y (monochrome) component in Q8 fixed-point |
[in] | u | U (Y - R) component in Q8 fixed-point |
[in] | v | V (Y - B) component in Q8 fixed-point |
Definition at line 45 of file yuv.c.
Referenced by sstvenc_yuv_to_rgb().
uint8_t sstvenc_rgb_calc_r | ( | uint8_t | r, |
uint8_t | g, | ||
uint8_t | b ) |
Return the red component of a YUV colour.
[in] | y | Y (monochrome) component in Q8 fixed-point |
[in] | u | U (Y - R) component in Q8 fixed-point |
[in] | v | V (Y - B) component in Q8 fixed-point |
Definition at line 38 of file yuv.c.
Referenced by sstvenc_yuv_to_rgb().
void sstvenc_rgb_to_mono | ( | uint8_t * | dest, |
const uint8_t * | src, | ||
uint16_t | width, | ||
uint16_t | height ) |
Convert the given RGB framebuffer to monochrome (Y component only).
[out] | dest | Destination framebuffer, which is assumed to be at least one third of the size of src. This can be the same location as src – after conversion the occupied size will be one third of the original buffer and may be realloc() 'd to that size. |
[in] | src | Source framebuffer, which is assumed to be RGB |
[in] | width | Width of the framebuffer in pixels |
[in] | height | Height of the framebuffer in pixels |
Definition at line 60 of file yuv.c.
References sstvenc_yuv_calc_y().
void sstvenc_rgb_to_yuv | ( | uint8_t * | dest, |
const uint8_t * | src, | ||
uint16_t | width, | ||
uint16_t | height ) |
Convert the given RGB framebuffer to YUV.
[out] | dest | Destination framebuffer, which is assumed to be the same size as src. This can be the same location as src. |
[in] | src | Source framebuffer, which is assumed to be RGB |
[in] | width | Width of the framebuffer in pixels |
[in] | height | Height of the framebuffer in pixels |
Definition at line 73 of file yuv.c.
References sstvenc_yuv_calc_u(), sstvenc_yuv_calc_v(), and sstvenc_yuv_calc_y().
uint8_t sstvenc_yuv_calc_u | ( | uint8_t | r, |
uint8_t | g, | ||
uint8_t | b ) |
Return the U (red - luminance) component of a RGB colour.
[in] | r | Red component in Q8 fixed-point |
[in] | g | Green component in Q8 fixed-point |
[in] | b | Blue component in Q8 fixed-point |
Definition at line 22 of file yuv.c.
Referenced by main(), and sstvenc_rgb_to_yuv().
uint8_t sstvenc_yuv_calc_v | ( | uint8_t | r, |
uint8_t | g, | ||
uint8_t | b ) |
Return the V (blue - luminance) component of a RGB colour.
[in] | r | Red component in Q8 fixed-point |
[in] | g | Green component in Q8 fixed-point |
[in] | b | Blue component in Q8 fixed-point |
Definition at line 30 of file yuv.c.
Referenced by main(), and sstvenc_rgb_to_yuv().
uint8_t sstvenc_yuv_calc_y | ( | uint8_t | r, |
uint8_t | g, | ||
uint8_t | b ) |
Return the Y (luminance) component of a RGB colour. This routine is useful for converting colour to monochrome as well as RGB to YUV.
[in] | r | Red component in Q8 fixed-point |
[in] | g | Green component in Q8 fixed-point |
[in] | b | Blue component in Q8 fixed-point |
Definition at line 14 of file yuv.c.
Referenced by main(), sstvenc_rgb_to_mono(), and sstvenc_rgb_to_yuv().
void sstvenc_yuv_to_mono | ( | uint8_t * | dest, |
const uint8_t * | src, | ||
uint16_t | width, | ||
uint16_t | height ) |
Convert the given YUV framebuffer to monochrome (Y component only).
[out] | dest | Destination framebuffer, which is assumed to be at least one third of the size of src. This can be the same location as src – after conversion the occupied size will be one third of the original buffer and may be realloc() 'd to that size. |
[in] | src | Source framebuffer, which is assumed to be YUV |
[in] | width | Width of the framebuffer in pixels |
[in] | height | Height of the framebuffer in pixels |
Definition at line 109 of file yuv.c.
void sstvenc_yuv_to_rgb | ( | uint8_t * | dest, |
const uint8_t * | src, | ||
uint16_t | width, | ||
uint16_t | height ) |
Convert the given YUV framebuffer to RGB.
[out] | dest | Destination framebuffer, which is assumed to be the same size as src. This can be the same location as src. |
[in] | src | Source framebuffer, which is assumed to be YUV |
[in] | width | Width of the framebuffer in pixels |
[in] | height | Height of the framebuffer in pixels |
Definition at line 91 of file yuv.c.
References sstvenc_rgb_calc_b(), sstvenc_rgb_calc_g(), and sstvenc_rgb_calc_r().