Daniel Hillenbrand | 09e7e82 | 2013-06-14 16:18:47 +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 "sec_g2d_4x.h" |
| 26 | |
| 27 | #undef REAL_DEBUG |
| 28 | #undef ANDROID_LOG |
| 29 | |
| 30 | #if defined(REAL_DEBUG) |
| 31 | #ifdef ANDROID_LOG |
| 32 | #define PRINT SLOGE |
| 33 | #define PRINTD SLOGD |
| 34 | #else |
| 35 | #define PRINT printf |
| 36 | #define PRINTD printf |
| 37 | #endif |
| 38 | #else |
| 39 | void VOID_FUNC(const char *format, ...); |
| 40 | |
| 41 | #define PRINT VOID_FUNC |
| 42 | #define PRINTD VOID_FUNC |
| 43 | #endif |
| 44 | |
| 45 | struct Fimg { |
| 46 | int srcX; |
| 47 | int srcY; |
| 48 | unsigned int srcW; |
| 49 | unsigned int srcH; |
| 50 | unsigned int srcFWStride; // this is not w, just stride (w * bpp) |
| 51 | unsigned int srcFH; |
| 52 | unsigned int srcBPP; |
| 53 | int srcColorFormat; |
| 54 | unsigned char *srcAddr; |
| 55 | |
| 56 | int dstX; |
| 57 | int dstY; |
| 58 | unsigned int dstW; |
| 59 | unsigned int dstH; |
| 60 | unsigned int dstFWStride; // this is not w, just stride (w * bpp) |
| 61 | unsigned int dstFH; |
| 62 | unsigned int dstBPP; |
| 63 | int dstColorFormat; |
| 64 | unsigned char *dstAddr; |
| 65 | |
| 66 | int clipT; |
| 67 | int clipB; |
| 68 | int clipL; |
| 69 | int clipR; |
| 70 | |
| 71 | int mskX; |
| 72 | int mskY; |
| 73 | unsigned int mskW; |
| 74 | unsigned int mskH; |
| 75 | unsigned int mskFWStride; // this is not w, just stride (w * bpp) |
| 76 | unsigned int mskFH; |
| 77 | unsigned int mskBPP; |
| 78 | int mskColorFormat; |
| 79 | unsigned char *mskAddr; |
| 80 | |
| 81 | unsigned long fillcolor; |
| 82 | int rotate; |
| 83 | unsigned int alpha; |
| 84 | int xfermode; |
| 85 | int isDither; |
| 86 | int isFilter; |
| 87 | int colorFilter; |
| 88 | int matrixType; |
| 89 | float matrixSx; |
| 90 | float matrixSy; |
| 91 | }; |
| 92 | |
| 93 | #ifdef __cplusplus |
| 94 | |
| 95 | struct blit_op_table { |
| 96 | int op; |
| 97 | const char *str; |
| 98 | }; |
| 99 | |
| 100 | extern struct blit_op_table optbl[]; |
| 101 | |
| 102 | class FimgApi |
| 103 | { |
| 104 | public: |
| 105 | #endif |
| 106 | |
| 107 | #ifdef __cplusplus |
| 108 | private : |
| 109 | bool m_flagCreate; |
| 110 | |
| 111 | protected : |
| 112 | FimgApi(); |
| 113 | FimgApi(const FimgApi& rhs) {} |
| 114 | virtual ~FimgApi(); |
| 115 | |
| 116 | public: |
| 117 | bool Create(void); |
| 118 | bool Destroy(void); |
| 119 | inline bool FlagCreate(void) { return m_flagCreate; } |
| 120 | bool Stretch(struct fimg2d_blit *cmd); |
| 121 | bool Sync(void); |
| 122 | |
| 123 | protected: |
| 124 | virtual bool t_Create(void); |
| 125 | virtual bool t_Destroy(void); |
| 126 | virtual bool t_Stretch(struct fimg2d_blit *cmd); |
| 127 | virtual bool t_Sync(void); |
| 128 | virtual bool t_Lock(void); |
| 129 | virtual bool t_UnLock(void); |
| 130 | |
| 131 | }; |
| 132 | #endif |
| 133 | |
| 134 | #ifdef __cplusplus |
| 135 | extern "C" |
| 136 | #endif |
| 137 | struct FimgApi *createFimgApi(); |
| 138 | |
| 139 | #ifdef __cplusplus |
| 140 | extern "C" |
| 141 | #endif |
| 142 | void destroyFimgApi(FimgApi *ptrFimgApi); |
| 143 | |
| 144 | #ifdef __cplusplus |
| 145 | extern "C" |
| 146 | #endif |
| 147 | int stretchFimgApi(struct fimg2d_blit *cmd); |
| 148 | #ifdef __cplusplus |
| 149 | extern "C" |
| 150 | #endif |
| 151 | int SyncFimgApi(void); |
| 152 | |
| 153 | void printDataBlit(char *title, struct fimg2d_blit *cmd); |
| 154 | void printDataBlitRotate(int rotate); |
| 155 | void printDataBlitImage(char *title, struct fimg2d_image *image); |
| 156 | void printDataBlitRect(char *title, struct fimg2d_rect *rect); |
| 157 | void printDataBlitScale(struct fimg2d_scale *scaling); |
| 158 | #endif //FIMG_API_H |