⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 imagerotatezoom.h

📁 瑞星微公司RK27XX系列芯片的SDK开发包
💻 H
字号:
/******************************************************************************
Copyright(C)2007,Rockchip Co., Ltd. All Rights Reserved.
File:RGBRotateScale_transform.h
Desc:
Note:
Author:hxd
$Log:
Revision 1.0  2007/09/01 hxd
*****************************************************************************/
#include "..\..\ImageWin\ImageWin.h"
#ifndef IMAGE_ROTATEZOOM_H
#define IMAGE_ROTATEZOOM_H

#define NEAREST  1
#define BILNEAR  2
#define ROTATE     3

//#define RGB16BIT
//#define RGB24BIT
#define RGB32BIT         //output format is 32bits

#define LCD_WIDTH    LCD_W
#define LCD_HEIGHT   LCD_H


#define MIN(x,y) ((x)>(y)?(y):(x))

typedef struct RGBRotateScale
{
    unsigned char*           data;//void*   data;
    int   width;
    int   height;
    int   size;
    unsigned char*  bgr;
}rgbrotatescale;

typedef unsigned char TUInt8;
typedef unsigned short TUInt16;

typedef struct TARGB32         //32 bit color
{
    TUInt8 A, B, G, R;    //A is alpha
}targb32;

typedef struct TARGB24       //24 bit color
{
    TUInt8 B, G, R;   //A is alpha
}targb24;

typedef struct TARGB16
{
    TUInt16 RGB;//RGB为16位
}targb16;

#ifdef RGB16BIT
typedef targb16 targbmodel;
#endif

#ifdef RGB24BIT
typedef targb24 targbmodel;
#endif

#ifdef RGB32BIT
typedef targb32 targbmodel;
#endif

typedef struct TPicRegion //一块颜色数据区的描述,便于参数传递
{
    targbmodel* pdata;     //颜色数据首地址
    long     byte_width;//一行数据的物理宽度(字节宽度)
    long     width;//像素宽度
    long     height;//像素高度
}tpicregion;

//图片缩放、旋转接口结构体
typedef struct
{
    short rotateenable;//是否启动旋转标记变量
    short zoomenable;//是否启动缩放标记变量
    short moveenable;//是否启动移动按键
    long  movedx;//图片的x轴平移增量
    long  movedy;//图片的y轴平移增量
    long  rotateangleindex;//旋转次数

    float zoomrate;//缩放的比例,该值为1时表示原图缩小到屏幕尺寸大小,该值大于1表示缩小到比屏幕尺寸大的比例,基于原图来说总是缩小的
    long  rcenterx0;//图片旋转的中心轴x坐标
    long  rcentery0;//图片旋转的中心轴y坐标
}tRGBPicRotateZoomInOut;

extern tRGBPicRotateZoomInOut RGBRotScaInitial(rgbrotatescale* org, tRGBPicRotateZoomInOut* factor);
extern void NineScreenZoom(tpicregion* Dst, const tpicregion* Src, int ScreenWidth, int ScreenHeight);
extern rgbrotatescale* RGBRotScaTransform(rgbrotatescale* org, tRGBPicRotateZoomInOut* pRGBRotateScale, unsigned char *ImageLCDLogicBuf, int ScreenWidth, int ScreenHeight);

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -