blob: 378fd1b277772f950e2cb31065921534c14105a7 [file] [log] [blame]
codeworkx62f02ba2012-05-20 12:00:36 +02001/*
2**
3** Copyright 2009 Samsung Electronics Co, Ltd.
4** Copyright 2008, The Android Open Source Project
5**
6** Licensed under the Apache License, Version 2.0 (the "License");
7** you may not use this file except in compliance with the License.
8** You may obtain a copy of the License at
9**
10** http://www.apache.org/licenses/LICENSE-2.0
11**
12** Unless required by applicable law or agreed to in writing, software
13** distributed under the License is distributed on an "AS IS" BASIS,
14** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15** See the License for the specific language governing permissions and
16** limitations under the License.
17**
18**
19*/
20
21#ifndef FIMG_API_H
22#define FIMG_API_H
23
24#include <utils/Log.h>
25#include "SkMatrix.h"
26#include "sec_g2d_4x.h"
27
28#define REAL_DEBUG
29#define ANDROID_LOG
30
31#if defined(REAL_DEBUG)
32#ifdef ANDROID_LOG
Daniel Hillenbrand0fdadca2012-07-22 15:45:33 +020033#define PRINT ALOGE
34#define PRINTD ALOGD
codeworkx62f02ba2012-05-20 12:00:36 +020035#else
36#define PRINT printf
37#define PRINTD printf
38#endif
39#else
40void VOID_FUNC(const char *format, ...);
41
42#define PRINT VOID_FUNC
43#define PRINTD VOID_FUNC
44#endif
45
46#ifdef __cplusplus
47
48struct blit_op_table {
49 int op;
50 const char *str;
51};
52
53extern struct blit_op_table optbl[];
54
55class FimgApi
56{
57public:
58#endif
59
60#ifdef __cplusplus
61private :
62 bool m_flagCreate;
63
64protected :
65 FimgApi();
66 FimgApi(const FimgApi& rhs) {}
67 virtual ~FimgApi();
68
69public:
70 bool Create(void);
71 bool Destroy(void);
72 inline bool FlagCreate(void) { return m_flagCreate; }
73 bool Stretch(struct fimg2d_blit *cmd);
74 bool Sync(void);
75
76protected:
77 virtual bool t_Create(void);
78 virtual bool t_Destroy(void);
79 virtual bool t_Stretch(struct fimg2d_blit *cmd);
80 virtual bool t_Sync(void);
81 virtual bool t_Lock(void);
82 virtual bool t_UnLock(void);
83
84};
85#endif
86
87#ifdef __cplusplus
88extern "C"
89#endif
90struct FimgApi *createFimgApi();
91
92#ifdef __cplusplus
93extern "C"
94#endif
95void destroyFimgApi(FimgApi *ptrFimgApi);
96
97#ifdef __cplusplus
98extern "C"
99#endif
100int stretchFimgApi(struct fimg2d_blit *cmd);
101#ifdef __cplusplus
102extern "C"
103#endif
104int SyncFimgApi(void);
105
106void printDataBlit(char *title, struct fimg2d_blit *cmd);
107void printDataBlitRotate(enum rotation rotate);
108void printDataBlitImage(char *title, struct fimg2d_image *image);
109void printDataBlitRect(char *title, struct fimg2d_rect *rect);
110void printDataBlitClip(struct fimg2d_clip *clip);
111void printDataBlitScale(struct fimg2d_scale *scaling);
112void printDataMatrix(int matrixType);
113
114#endif //FIMG_API_H