8 Package 2 of Ingenic Video Capture

overview

        In the previous section, we analyzed the requirements of video capture and encapsulated the interface class of video capture. On the video screen, time information and various text information are often superimposed, which requires the use of dot matrix fonts. There are generally two types of dot matrix fonts, one is solid color fonts, and the other is stroke fonts. When the background color of the video is roughly the same as the color of the text in the solid-color font library, the text will be difficult to read. The stroked font overcomes the shortcomings of the solid color font, but the stroked font takes up more space.

        In addition, we also need to be able to superimpose pictures, such as: pictures in bmp format, pictures in png format, etc. Therefore, reading pictures and converting the picture data into the data form required by the Ingenic SDK OSD module is also a function that must be implemented in advance.

Realization of dot matrix font library

        The header files of the dot matrix font library are as follows:

#pragma once

#include <stdio.h>

#include "HP_Mutex.h"

class CHP_LatticeFont
{
public:
        static void Open();
        static CHP_LatticeFont *&Singleton();
        static void Close();

        int Init(const char *pszAsc16File, const char *pszHz16File, const char *pszAsc16StrokeFile = NULL,
                const char *pszHz16StrokeFile = NULL);
        void DeInit();
        int GetCode(const char *pszText, char *pCode, int &nTotalCodeLen, bool bUseStrokeFont = false);
   

Guess you like

Origin blog.csdn.net/hope_wisdom/article/details/131883490