The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame^] | 1 | /* |
| 2 | ** |
| 3 | ** Copyright 2008, The Android Open Source Project |
| 4 | ** |
| 5 | ** Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | ** you may not use this file except in compliance with the License. |
| 7 | ** You may obtain a copy of the License at |
| 8 | ** |
| 9 | ** http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | ** |
| 11 | ** Unless required by applicable law or agreed to in writing, software |
| 12 | ** distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | ** See the License for the specific language governing permissions and |
| 15 | ** limitations under the License. |
| 16 | */ |
| 17 | |
| 18 | #ifndef ANDROID_HARDWARE_FAKECAMERA_H |
| 19 | #define ANDROID_HARDWARE_FAKECAMERA_H |
| 20 | |
| 21 | #include <ui/CameraHardwareInterface.h> |
| 22 | |
| 23 | namespace android { |
| 24 | |
| 25 | class FakeCamera { |
| 26 | public: |
| 27 | FakeCamera(int width, int height); |
| 28 | ~FakeCamera(); |
| 29 | |
| 30 | void setSize(int width, int height); |
| 31 | void getNextFrameAsRgb565(uint16_t *buffer); |
| 32 | void getNextFrameAsYuv422(uint8_t *buffer); |
| 33 | status_t dump(int fd, const Vector<String16>& args); |
| 34 | |
| 35 | private: |
| 36 | void drawSquare(uint16_t *buffer, int x, int y, int size, int color, int shadow); |
| 37 | void drawCheckerboard(uint16_t *buffer, int size); |
| 38 | |
| 39 | static const int kRed = 0xf800; |
| 40 | static const int kGreen = 0x07c0; |
| 41 | static const int kBlue = 0x003e; |
| 42 | |
| 43 | int mWidth, mHeight; |
| 44 | int mCounter; |
| 45 | int mCheckX, mCheckY; |
| 46 | uint16_t *mTmpRgb16Buffer; |
| 47 | }; |
| 48 | |
| 49 | }; // namespace android |
| 50 | |
| 51 | #endif // ANDROID_HARDWARE_FAKECAMERA_H |