You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

107 lines
3.3 KiB

/*******************************************************************************
* lib_smartfb_priv.h
*
* History:
* 2017/07/25 - [Hao Qian] created file
*
* Copyright (c) 2017 Ambarella, Inc.
*
* This file and its contents ( "Software" ) are protected by intellectual
* property rights including, without limitation, U.S. and/or foreign
* copyrights. This Software is also the confidential and proprietary
* information of Ambarella, Inc. and its licensors. You may not use, reproduce,
* disclose, distribute, modify, or otherwise prepare derivative works of this
* Software or any portion thereof except pursuant to a signed license agreement
* or nondisclosure agreement with Ambarella, Inc. or its authorized affiliates.
* In the absence of such an agreement, you agree to promptly notify and return
* this Software to Ambarella, Inc.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT,
* MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL AMBARELLA, INC. OR ITS AFFILIATES BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; COMPUTER FAILURE OR MALFUNCTION; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************/
#ifndef _SMARTFB_LIB_PRIV_H
#define _SMARTFB_LIB_PRIV_H
#include "lib_smartfb.h"
#ifndef LINE_SPACING
#define LINE_SPACING(x) ((x) * 3 / 2)
#endif
#define SMARTFB_MAX_STRING_LEN (32)
#define SMARTFB_BITS_PER_PIXEL_8 (8)
#define SMARTFB_BITS_PER_PIXEL_32 (32)
#define SMARTFB_MOSAIC_USED_COLOR_TAB_NUM (64)
#define SMARTFB_USED_COLOR_TAB_NUM (SMARTFB_COLOR_NUM * SMARTFB_ALPHA_NUM)
enum line_type {
SMARTFB_LINE_DEGREE0_0 = 0,
SMARTFB_LINE_DEGREE0_45 = 1,
SMARTFB_LINE_DEGREE45_90 = 2,
SMARTFB_LINE_DEGREE90_90 = 3,
SMARTFB_LINE_DEGREE90_135 = 4,
SMARTFB_LINE_DEGREE135_180 = 5,
SMARTFB_LINE_TYPE_NUM,
};
typedef struct fb_color_s {
u16 r;
u16 g;
u16 b;
} fb_color_t;
struct fb_cmap_user {
u32 start; /* First entry */
u32 len; /* Number of entries */
u16 *r;
u16 *g;
u16 *b;
u16 *transparent; /* transparency, can be NULL */
};
typedef struct smartfb_saved_cap_area_params_s {
u16 offset_x;
u16 offset_y;
u16 width;
u16 height;
char name[MAX_NAME_SIZE];
u8 *buffer;
} smartfb_saved_cap_area_params_t;
typedef struct smartfb_saved_cap_area_s {
smartfb_saved_cap_area_params_t params[MAX_CAP_AREA_NUM];
u32 used_map : MAX_CAP_AREA_NUM;
u32 reserved : (32 - MAX_CAP_AREA_NUM);
} smartfb_saved_cap_area_t;
typedef struct smartfb_context_s {
u8 *fb_mem;
u32 init_done : 1;
u32 cycle_buffer_num : 4;
u32 cur_cycle_buffer : 4;
u32 drawed_cycle_buffer : 4;
u32 mode_name : 1;
u32 reserved : 18;
int fb;
// linux fb header
struct fb_var_screeninfo var;
struct fb_fix_screeninfo fix;
// saved capture area
smartfb_saved_cap_area_t saved_areas;
} smartfb_context_t;
#endif //_SMARTFB_LIB_PRIV_H