-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathraspicam_still.cpp
More file actions
167 lines (155 loc) · 6.06 KB
/
raspicam_still.cpp
File metadata and controls
167 lines (155 loc) · 6.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
/**********************************************************
Software developed by AVA ( Ava Group of the University of Cordoba, ava at uco dot es)
Main author Rafael Munoz Salinas (rmsalinas at uco dot es)
This software is released under BSD license as expressed below
-------------------------------------------------------------------
Copyright (c) 2013, AVA ( Ava Group University of Cordoba, ava at uco dot es)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software
must display the following acknowledgement:
This product includes software developed by the Ava group of the University of Cordoba.
4. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY AVA ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL AVA BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
****************************************************************/
#include "raspicam_still.h"
#include "private_still/private_still_impl.h"
namespace raspicam {
RaspiCam_Still::RaspiCam_Still() {
_impl= new _private::Private_Impl_Still() ;
}
RaspiCam_Still::~RaspiCam_Still() {
release();
delete _impl;
}
bool RaspiCam_Still::open ( ) {
return _impl->initialize() ==0;
}
bool RaspiCam_Still::grab_retrieve ( unsigned char * preallocated_data, unsigned int length ) {
return _impl->takePicture ( preallocated_data, length );
}
void RaspiCam_Still::release() {}
size_t RaspiCam_Still::getImageBufferSize() const{
return _impl-> getImageBufferSize();
}
void RaspiCam_Still::commitParameters() {
_impl-> commitParameters();
}
void RaspiCam_Still::setWidth ( unsigned int width ) {
_impl-> setWidth ( width );
}
void RaspiCam_Still::setHeight ( unsigned int height ) {
_impl->setHeight ( height );
}
void RaspiCam_Still::setCaptureSize ( unsigned int width, unsigned int height ) {
_impl->setCaptureSize ( width,height );
}
void RaspiCam_Still::setBrightness ( unsigned int brightness ) {
_impl->setBrightness ( brightness );
}
void RaspiCam_Still::setQuality ( unsigned int quality ) {
_impl->setQuality ( quality );
}
void RaspiCam_Still::setRotation ( int rotation ) {
_impl-> setRotation ( rotation );
}
void RaspiCam_Still::setISO ( int iso ) {
_impl-> setISO ( iso );
}
void RaspiCam_Still::setSharpness ( int sharpness ) {
_impl->setSharpness ( sharpness );
}
void RaspiCam_Still::setContrast ( int contrast ) {
_impl->setContrast ( contrast );
}
void RaspiCam_Still::setSaturation ( int saturation ) {
_impl->setSaturation ( saturation );
}
void RaspiCam_Still::setEncoding ( RASPICAM_ENCODING encoding ) {
_impl->setEncoding ( encoding );
}
void RaspiCam_Still::setExposure ( RASPICAM_EXPOSURE exposure ) {
_impl->setExposure ( exposure );
}
void RaspiCam_Still::setAWB ( RASPICAM_AWB awb ) {
_impl->setAWB ( awb );
}
void RaspiCam_Still::setImageEffect ( RASPICAM_IMAGE_EFFECT imageEffect ) {
_impl-> setImageEffect ( imageEffect );
}
void RaspiCam_Still::setMetering ( RASPICAM_METERING metering ) {
_impl->setMetering ( metering );
}
void RaspiCam_Still::setHorizontalFlip ( bool hFlip ) {
_impl->setHorizontalFlip ( hFlip );
}
void RaspiCam_Still::setVerticalFlip ( bool vFlip ) {
_impl->setVerticalFlip ( vFlip );
}
unsigned int RaspiCam_Still::getWidth() {
return _impl->getWidth();
}
unsigned int RaspiCam_Still::getHeight() {
return _impl->getHeight();
}
unsigned int RaspiCam_Still::getBrightness() {
return _impl->getBrightness();
}
unsigned int RaspiCam_Still::getRotation() {
return _impl->getRotation();
}
unsigned int RaspiCam_Still::getQuality() {
return _impl->getQuality();
}
int RaspiCam_Still::getISO() {
return _impl->getISO();
}
int RaspiCam_Still::getSharpness() {
return _impl->getSharpness();
}
int RaspiCam_Still::getContrast() {
return _impl->getContrast();
}
int RaspiCam_Still::getSaturation() {
return _impl->getSaturation();
}
RASPICAM_ENCODING RaspiCam_Still::getEncoding() {
return _impl->getEncoding();
}
RASPICAM_EXPOSURE RaspiCam_Still::getExposure() {
return _impl->getExposure ();
}
RASPICAM_AWB RaspiCam_Still::getAWB() {
return _impl->getAWB();
}
RASPICAM_IMAGE_EFFECT RaspiCam_Still::getImageEffect() {
return _impl->getImageEffect();
}
RASPICAM_METERING RaspiCam_Still::getMetering() {
return _impl->getMetering();
}
bool RaspiCam_Still::isHorizontallyFlipped() {
return _impl->isHorizontallyFlipped();
}
bool RaspiCam_Still::isVerticallyFlipped() {
return _impl->isVerticallyFlipped();
}
}