codeworkx | 62f02ba | 2012-05-20 12:00:36 +0200 | [diff] [blame] | 1 | /* |
| 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 |
Daniel Hillenbrand | 0fdadca | 2012-07-22 15:45:33 +0200 | [diff] [blame^] | 29 | #define ANDROID_ALOG |
codeworkx | 62f02ba | 2012-05-20 12:00:36 +0200 | [diff] [blame] | 30 | |
| 31 | #if defined(REAL_DEBUG) |
Daniel Hillenbrand | 0fdadca | 2012-07-22 15:45:33 +0200 | [diff] [blame^] | 32 | #ifdef ANDROID_ALOG |
| 33 | #define PRINT ALOGE |
| 34 | #define PRINTD ALOGD |
codeworkx | 62f02ba | 2012-05-20 12:00:36 +0200 | [diff] [blame] | 35 | #else |
| 36 | #define PRINT printf |
| 37 | #define PRINTD printf |
| 38 | #endif |
| 39 | #else |
| 40 | void VOID_FUNC(const char *format, ...); |
| 41 | |
| 42 | #define PRINT VOID_FUNC |
| 43 | #define PRINTD VOID_FUNC |
| 44 | #endif |
| 45 | |
| 46 | #ifdef __cplusplus |
| 47 | |
| 48 | struct blit_op_table { |
| 49 | int op; |
| 50 | const char *str; |
| 51 | }; |
| 52 | |
| 53 | extern struct blit_op_table optbl[]; |
| 54 | |
| 55 | class FimgApi |
| 56 | { |
| 57 | public: |
| 58 | #endif |
| 59 | |
| 60 | #ifdef __cplusplus |
| 61 | private : |
| 62 | bool m_flagCreate; |
| 63 | |
| 64 | protected : |
| 65 | FimgApi(); |
| 66 | FimgApi(const FimgApi& rhs) {} |
| 67 | virtual ~FimgApi(); |
| 68 | |
| 69 | public: |
| 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 | |
| 76 | protected: |
| 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 |
| 88 | extern "C" |
| 89 | #endif |
| 90 | struct FimgApi *createFimgApi(); |
| 91 | |
| 92 | #ifdef __cplusplus |
| 93 | extern "C" |
| 94 | #endif |
| 95 | void destroyFimgApi(FimgApi *ptrFimgApi); |
| 96 | |
| 97 | #ifdef __cplusplus |
| 98 | extern "C" |
| 99 | #endif |
| 100 | int stretchFimgApi(struct fimg2d_blit *cmd); |
| 101 | #ifdef __cplusplus |
| 102 | extern "C" |
| 103 | #endif |
| 104 | int SyncFimgApi(void); |
| 105 | |
| 106 | void printDataBlit(char *title, struct fimg2d_blit *cmd); |
| 107 | void printDataBlitRotate(enum rotation rotate); |
| 108 | void printDataBlitImage(char *title, struct fimg2d_image *image); |
| 109 | void printDataBlitRect(char *title, struct fimg2d_rect *rect); |
| 110 | void printDataBlitClip(struct fimg2d_clip *clip); |
| 111 | void printDataBlitScale(struct fimg2d_scale *scaling); |
| 112 | void printDataMatrix(int matrixType); |
| 113 | |
| 114 | #endif //FIMG_API_H |