Shaka Packager SDK
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
shaka::media::DvbImageBuilder Class Reference

#include <dvb_image.h>

Public Member Functions

 DvbImageBuilder (const DvbImageColorSpace *color_space, const RgbaColor &default_color, uint16_t max_width, uint16_t max_height)
 
 DvbImageBuilder (const DvbImageBuilder &)=delete
 
DvbImageBuilderoperator= (const DvbImageBuilder &)=delete
 
uint16_t max_width () const
 
uint16_t max_height () const
 
bool AddPixel (BitDepth bit_depth, uint8_t byte_code, bool is_top_rows)
 
void NewRow (bool is_top_rows)
 
void MirrorToBottomRows ()
 Copies the top-rows to the bottom rows.
 
bool GetPixels (const RgbaColor **pixels, uint16_t *width, uint16_t *height) const
 

Detailed Description

Defines a builder that generates an image from a DVB-sub byte stream. This allocates a single buffer big enough to hold the max-sized image and fills it in series. The NewRow() method must be called to start a new line of the image.

This adds pixels in an interlaced format. Adding pixels and new rows on top-rows doesn't affect the bottom-rows. Top-rows refers to even-indexed lines (e.g. 0,2,4).

Definition at line 89 of file dvb_image.h.

Constructor & Destructor Documentation

◆ DvbImageBuilder()

shaka::media::DvbImageBuilder::DvbImageBuilder ( const DvbImageColorSpace color_space,
const RgbaColor default_color,
uint16_t  max_width,
uint16_t  max_height 
)

Definition at line 194 of file dvb_image.cc.

◆ ~DvbImageBuilder()

shaka::media::DvbImageBuilder::~DvbImageBuilder ( )

Definition at line 209 of file dvb_image.cc.

Member Function Documentation

◆ AddPixel()

bool shaka::media::DvbImageBuilder::AddPixel ( BitDepth  bit_depth,
uint8_t  byte_code,
bool  is_top_rows 
)

Definition at line 211 of file dvb_image.cc.

◆ GetPixels()

bool shaka::media::DvbImageBuilder::GetPixels ( const RgbaColor **  pixels,
uint16_t *  width,
uint16_t *  height 
) const

Gets the pixel buffer. Each row is based on the max_width field, but the max filled row with will be given in width. This assumes that NewRow was called recently and we are at the beginning of the rows.

Parameters
pixelsA pointer to a RgbaColor* variable that will be set to the pixel data pointer.
widthWill be filled with the max width of all rows.
heightWill be filled with the number of rows set.
Returns
True on success, false on error.

Definition at line 245 of file dvb_image.cc.

◆ max_height()

uint16_t shaka::media::DvbImageBuilder::max_height ( ) const
inline

Definition at line 101 of file dvb_image.h.

◆ max_width()

uint16_t shaka::media::DvbImageBuilder::max_width ( ) const
inline

Definition at line 100 of file dvb_image.h.

◆ MirrorToBottomRows()

void shaka::media::DvbImageBuilder::MirrorToBottomRows ( )

Copies the top-rows to the bottom rows.

Definition at line 233 of file dvb_image.cc.

◆ NewRow()

void shaka::media::DvbImageBuilder::NewRow ( bool  is_top_rows)

Definition at line 227 of file dvb_image.cc.


The documentation for this class was generated from the following files: