Simd Library Documentation.

Home | Release Notes | Download | Documentation | Issues | GitHub

24-bit BGR pixel. More...

#include <SimdPixel.hpp>

Public Member Functions

 Bgr24 (const uint8_t &gray=uint8_t(0))
 
 Bgr24 (const uint8_t &b, const uint8_t &g, const uint8_t &r)
 
 Bgr24 (const Bgra32 &p)
 
 Bgr24 (const Rgb24 &p)
 
 Bgr24 (const Rgba32 &p)
 
 Bgr24 (const Bgr24 &p)
 

Static Public Member Functions

template<template< class > class A>
static const Bgr24 & At (const View< A > &view, ptrdiff_t col, ptrdiff_t row)
 
template<template< class > class A>
static Bgr24 & At (View< A > &view, ptrdiff_t col, ptrdiff_t row)
 

Data Fields

uint8_t blue
 Blue channel. First byte of a View::Bgr24 pixel.
 
uint8_t green
 Green channel. Second byte of a View::Bgr24 pixel.
 
uint8_t red
 Red channel. Third byte of a View::Bgr24 pixel. Bgr24(0, 0, 255) is red.
 

Detailed Description

24-bit BGR pixel.

Stores blue, green, red as three consecutive bytes. This is the element type of a View::Bgr24 image and the color type used on BGR canvases. UseMotionDetector and TestMotion alias it as Color and pass it to DrawRectangle, DrawLine and Font::Draw. The bytes are the same order as Simd::FillBgr and as an OpenCV BGR cv::Mat.

Constructor & Destructor Documentation

◆ Bgr24() [1/6]

SIMD_INLINE Bgr24 ( const uint8_t &  gray = uint8_t(0))

Creates a 24-bit BGR pixel with the same value in every channel.

Bgr24() is black. The value is written to blue, green and red.

Parameters
[in]gray- initial value for blue, green and red. It is equal to 0 by default.

◆ Bgr24() [2/6]

SIMD_INLINE Bgr24 ( const uint8_t &  b,
const uint8_t &  g,
const uint8_t &  r 
)

Creates a 24-bit BGR pixel from blue, green and red.

Argument order is blue, green, red. Motion annotation uses Bgr24(0, 0, 255) for red, Bgr24(0, 255, 255) for yellow and Bgr24(255, 255, 255) for white. Debug drawing inside Detector uses Bgr24(0, 255, 0) for moving regions and Bgr24(0, 255, 255) for the model ROI and tracked objects. The transform test writes Bgr24(y, x, red) through View::At, so blue follows the row and green follows the column.

Parameters
[in]b- initial value for the blue channel.
[in]g- initial value for the green channel.
[in]r- initial value for the red channel.

◆ Bgr24() [3/6]

SIMD_INLINE Bgr24 ( const Bgra32 &  p)

Creates a 24-bit BGR pixel from a 32-bit BGRA pixel.

Copies blue, green and red. Alpha is omitted.

Parameters
[in]p- a 32-bit BGRA pixel.

◆ Bgr24() [4/6]

SIMD_INLINE Bgr24 ( const Rgb24 &  p)

Creates a 24-bit BGR pixel from a 24-bit RGB pixel.

Copies the channels by name, so the color is kept and the byte order becomes blue, green, red.

Parameters
[in]p- a 24-bit RGB pixel.

◆ Bgr24() [5/6]

SIMD_INLINE Bgr24 ( const Rgba32 &  p)

Creates a 24-bit BGR pixel from a 32-bit RGBA pixel.

Copies blue, green and red by name. Alpha is omitted.

Parameters
[in]p- a 32-bit RGBA pixel.

◆ Bgr24() [6/6]

SIMD_INLINE Bgr24 ( const Bgr24 &  p)

Creates a copy of a 24-bit BGR pixel.

Parameters
[in]p- a 24-bit BGR pixel.

Member Function Documentation

◆ At() [1/2]

template< template< class > class A > static const Bgr24 & At ( const View< A > &  view,
ptrdiff_t  col,
ptrdiff_t  row 
)
static

Gets a constant reference to the BGR pixel at (col, row).

Requires view.format == View::Bgr24 and then returns Simd::At. col is the x coordinate and row is the y coordinate; both must lie inside the view. Typical code uses the equivalent view.At<Pixel::Bgr24>(x, y).

Parameters
[in]view- an image view of 24-bit BGR pixel format.
[in]col- x-coordinate of the pixel.
[in]row- y-coordinate of the pixel.
Returns
a constant reference to the pixel.

◆ At() [2/2]

template< template< class > class A > static Bgr24 & At ( View< A > &  view,
ptrdiff_t  col,
ptrdiff_t  row 
)
static

Gets a reference to the BGR pixel at (col, row).

Requires view.format == View::Bgr24 and then returns Simd::At. col is the x coordinate and row is the y coordinate; both must lie inside the view. The transform test assigns pixels with view.At<Pixel::Bgr24>(x, y) = Pixel::Bgr24(y, x, red).

Parameters
[in]view- an image view of 24-bit BGR pixel format.
[in]col- x-coordinate of the pixel.
[in]row- y-coordinate of the pixel.
Returns
a reference to the pixel.