Permalink
Browse files

Merge branch 'develop' of github.com:openframeworks/openFrameworks in…

…to develop
  • Loading branch information...
2 parents c9ac086 + b5a76d5 commit 379d795d4ce27543e7b1b4e3d026cac45f1ae7aa @arturoc arturoc committed May 3, 2012
Showing with 36,341 additions and 497 deletions.
  1. +43 −0 addons/ofxAssimpModelLoader/src/ofxAssimpModelLoader.cpp
  2. +7 −0 addons/ofxAssimpModelLoader/src/ofxAssimpModelLoader.h
  3. +5 −0 addons/ofxOpenCv/libs/opencv/include/opencv2/flann/any.h
  4. +4 −0 addons/ofxOpenCv/libs/opencv/include/opencv2/flann/lsh_index.h
  5. BIN addons/ofxOpenCv/libs/opencv/lib/ios/opencv.a
  6. BIN addons/ofxOpenCv/libs/opencv/lib/ios/opencv_calib3d.a
  7. BIN addons/ofxOpenCv/libs/opencv/lib/ios/opencv_contrib.a
  8. BIN addons/ofxOpenCv/libs/opencv/lib/ios/opencv_core.a
  9. BIN addons/ofxOpenCv/libs/opencv/lib/ios/opencv_features2d.a
  10. BIN addons/ofxOpenCv/libs/opencv/lib/ios/opencv_flann.a
  11. BIN addons/ofxOpenCv/libs/opencv/lib/ios/opencv_gpu.a
  12. BIN addons/ofxOpenCv/libs/opencv/lib/ios/opencv_highgui.a
  13. BIN addons/ofxOpenCv/libs/opencv/lib/ios/opencv_imgproc.a
  14. BIN addons/ofxOpenCv/libs/opencv/lib/ios/opencv_legacy.a
  15. BIN addons/ofxOpenCv/libs/opencv/lib/ios/opencv_ml.a
  16. BIN addons/ofxOpenCv/libs/opencv/lib/ios/opencv_objdetect.a
  17. BIN addons/ofxOpenCv/libs/opencv/lib/ios/opencv_video.a
  18. BIN addons/ofxOpenCv/libs/opencv/lib/ios/zlib.a
  19. BIN addons/ofxOpenCv/libs/opencv/lib/osx/opencv.a
  20. +6 −0 addons/ofxOpenCv/src/ofxCvConstants.h
  21. +6 −0 addons/ofxOsc/libs/oscpack/src/ip/posix/UdpSocket.cpp
  22. +3 −2 addons/ofxOsc/libs/oscpack/src/osc/OscTypes.h
  23. +2 −1 addons/ofxiPhone/ofxiPhoneExtras.h
  24. +2 −2 addons/ofxiPhone/src/AVFoundationVideoGrabber.mm
  25. +2 −0 addons/ofxiPhone/src/AVFoundationVideoPlayer.h
  26. +5 −1 addons/ofxiPhone/src/AVFoundationVideoPlayer.mm
  27. +5 −0 addons/ofxiPhone/src/ofxOpenALSoundPlayer.cpp
  28. +2 −0 addons/ofxiPhone/src/ofxOpenALSoundPlayer.h
  29. +16 −8 addons/ofxiPhone/src/ofxiPhoneExtras.mm
  30. +17 −13 addons/ofxiPhone/src/ofxiPhoneImagePicker.h
  31. +206 −159 addons/ofxiPhone/src/ofxiPhoneImagePicker.mm
  32. +17 −5 addons/ofxiPhone/src/ofxiPhoneViewController.mm
  33. 0 {examples/3d → apps/devApps}/fboTrailsExample/src/main.cpp
  34. 0 {examples/3d → apps/devApps}/fboTrailsExample/src/testApp.cpp
  35. 0 {examples/3d → apps/devApps}/fboTrailsExample/src/testApp.h
  36. +0 −3 apps/devApps/projectGenerator/src/addons/ofAddon.cpp
  37. +19 −0 apps/devApps/projectGenerator/src/projects/baseProject.cpp
  38. +23 −5 apps/devApps/projectGenerator/src/projects/xcodeProject.cpp
  39. +17 −1 apps/devApps/projectGenerator/src/utils/Utils.cpp
  40. +1 −1 apps/devApps/projectGenerator/src/utils/Utils.h
  41. 0 examples/{3d/fboTrailsExampleAlt → gl/fboTrailsExample}/bin/data/.gitkeep
  42. 0 examples/{3d/fboTrailsExampleAlt → gl/fboTrailsExample}/src/main.cpp
  43. 0 examples/{3d/fboTrailsExampleAlt → gl/fboTrailsExample}/src/testApp.cpp
  44. 0 examples/{3d/fboTrailsExampleAlt → gl/fboTrailsExample}/src/testApp.h
  45. +6 −6 examples/gl/viewportExample/src/testApp.cpp
  46. +0 −6 examples/ios/CoreLocationExample/src/testApp.mm
  47. BIN examples/ios/ImagePickerExample/bin/data/images/instructions.png
  48. +0 −1 examples/ios/ImagePickerExample/src/testApp.h
  49. +35 −42 examples/ios/ImagePickerExample/src/testApp.mm
  50. +0 −6 examples/ios/KeyboardExample/src/testApp.mm
  51. +0 −6 examples/ios/MapKitExample/src/testApp.mm
  52. +0 −3 examples/ios/OpenAlExample/src/testApp.mm
  53. +0 −6 examples/ios/TouchAndAccelExample/src/testApp.mm
  54. +0 −2 examples/ios/advancedEventsExample/src/testApp.h
  55. +0 −3 examples/ios/advancedEventsExample/src/testApp.mm
  56. +0 −3 examples/ios/advancedGraphics/src/testApp.mm
  57. +0 −3 examples/ios/audioInputExample/src/testApp.mm
  58. +0 −3 examples/ios/audioOutputExample/src/testApp.mm
  59. +0 −6 examples/ios/emptyExample/src/testApp.mm
  60. +2 −8 examples/ios/eventsExample/src/testApp.mm
  61. +0 −3 examples/ios/fontShapesExample/src/testApp.mm
  62. +0 −3 examples/ios/fontsExample/src/testApp.mm
  63. +0 −3 examples/ios/graphicsExample/src/testApp.mm
  64. +0 −3 examples/ios/iPhoneGuiExample/src/testApp.mm
  65. +0 −3 examples/ios/imageLoaderExample/src/testApp.mm
  66. +2 −11 examples/ios/iosCustomSizeExample/src/testApp.mm
  67. +1 −9 examples/ios/iosExternalDisplayExample/src/testApp.mm
  68. +1 −5 examples/ios/iosNativeExample/src/Apps/CircleApp.mm
  69. +1 −5 examples/ios/iosNativeExample/src/Apps/ImageApp.mm
  70. +1 −5 examples/ios/iosNativeExample/src/Apps/SquareApp.mm
  71. +1 −5 examples/ios/iosNativeExample/src/Apps/TriangleApp.mm
  72. +0 −8 examples/ios/iosNativeExample/src/testApp.mm
  73. +1 −5 examples/ios/moviePlayerExample/src/testApp.mm
  74. +6 −1 examples/ios/opencvExample/src/testApp.h
  75. +12 −22 examples/ios/opencvExample/src/testApp.mm
  76. +35,712 −0 examples/ios/opencvFaceExample/bin/data/haarcascade_frontalface_default.xml
  77. BIN examples/ios/opencvFaceExample/bin/data/test.jpg
  78. +8 −2 examples/ios/opencvFaceExample/src/testApp.h
  79. +44 −19 examples/ios/opencvFaceExample/src/testApp.mm
  80. +0 −3 examples/ios/polygonExample/src/testApp.mm
  81. +0 −3 examples/ios/soundPlayerExample/src/testApp.mm
  82. +0 −3 examples/ios/textureExample/src/testApp.mm
  83. +0 −3 examples/ios/vboExample/src/testApp.mm
  84. +0 −3 examples/ios/videoGrabberExample/src/testApp.mm
  85. +0 −7 examples/ios/xmlSettingsExample/src/testApp.mm
  86. +0 −1 examples/math/vectorMathExample/addons.make
  87. +28 −26 examples/math/vectorMathExample/src/testApp.cpp
  88. +6 −8 libs/openFrameworks/3d/of3dUtils.cpp
  89. +2 −2 libs/openFrameworks/3d/of3dUtils.h
  90. +22 −5 libs/openFrameworks/gl/ofFbo.cpp
  91. +6 −4 libs/openFrameworks/sound/ofBaseSoundPlayer.h
  92. +6 −0 libs/openFrameworks/sound/ofFmodSoundPlayer.cpp
  93. +1 −0 libs/openFrameworks/sound/ofFmodSoundPlayer.h
  94. +5 −0 libs/openFrameworks/sound/ofOpenALSoundPlayer.cpp
  95. +1 −0 libs/openFrameworks/sound/ofOpenALSoundPlayer.h
  96. +9 −0 libs/openFrameworks/sound/ofSoundPlayer.cpp
  97. +1 −0 libs/openFrameworks/sound/ofSoundPlayer.h
  98. +4 −3 libs/openFrameworks/video/ofiPhoneVideoPlayer.mm
  99. +1 −1 libs/openFrameworksCompiled/project/makefileCommon/Makefile.examples
  100. BIN scripts/ios/template/bin/data/Default.png
  101. BIN scripts/ios/template/bin/data/Icon.png
  102. +8 −8 scripts/osx/template/emptyExample.xcodeproj/project.pbxproj
@@ -1017,6 +1017,49 @@ ofPoint ofxAssimpModelLoader::getScale(){
}
//-------------------------------------------
+ofPoint ofxAssimpModelLoader::getSceneMin(bool bScaled ){
+ ofPoint sceneMin(scene_min.x, scene_min.y, scene_min.z);
+ if( bScaled ){
+ return sceneMin * scale;
+ }else{
+ return sceneMin;
+ }
+}
+
+//-------------------------------------------
+ofPoint ofxAssimpModelLoader::getSceneMax(bool bScaled ){
+ ofPoint sceneMax(scene_max.x, scene_max.y, scene_max.z);
+ if( bScaled ){
+ return sceneMax * scale;
+ }else{
+ return sceneMax;
+ }
+}
+
+//-------------------------------------------
+int ofxAssimpModelLoader::getNumRotations(){
+ return rotAngle.size();
+}
+
+//-------------------------------------------
+ofPoint ofxAssimpModelLoader::getRotationAxis(int which){
+ if(rotAxis.size() > which){
+ return rotAxis[which];
+ }else{
+ return ofPoint();
+ }
+}
+
+//-------------------------------------------
+float ofxAssimpModelLoader::getRotationAngle(int which){
+ if(rotAngle.size() > which){
+ return rotAngle[which];
+ }else{
+ return 0.0;
+ }
+}
+
+//-------------------------------------------
const aiScene* ofxAssimpModelLoader::getAssimpScene(){
return scene;
}
@@ -86,6 +86,13 @@ class ofxAssimpModelLoader{
float getNormalizedScale();
ofPoint getScale();
+ ofPoint getSceneMin(bool bScaled = false);
+ ofPoint getSceneMax(bool bScaled = false);
+
+ int getNumRotations(); // returns the no. of applied rotations
+ ofPoint getRotationAxis(int which); // gets each rotation axis
+ float getRotationAngle(int which); //gets each rotation angle
+
void calculateDimensions();
const aiScene* getAssimpScene();
@@ -30,6 +30,11 @@ struct empty_any
{
};
+ inline std::ostream& operator <<(std::ostream& out, const empty_any&){
+ out<<"[empty_any]";
+ return out;
+ }
+
struct base_any_policy
{
virtual void static_delete(void** x) = 0;
@@ -56,6 +56,10 @@ namespace cvflann
struct LshIndexParams : public IndexParams
{
+ LshIndexParams(){
+
+ }
+
LshIndexParams(unsigned int table_number, unsigned int key_size, unsigned int multi_probe_level)
{
(* this)["algorithm"] = FLANN_INDEX_LSH;
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,6 +1,12 @@
#ifndef OFX_CV_CONSTANTS_H
#define OFX_CV_CONSTANTS_H
+#ifdef MIN
+ #undef MIN
+#endif
+#ifdef MAX
+ #undef MAX
+#endif
#include "cv.h"
#include <vector>
@@ -115,6 +115,12 @@ class UdpSocket::Implementation{
// enable multiple listeners for a single port on same network interface
int reuse = 1; // int on posix
setsockopt(socket_, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(reuse));
+
+ #ifdef __APPLE__
+ // needed also for OS X - enable multiple listeners for a single port on same network interface
+ int reusePort = 1; // int on posix
+ setsockopt(socket_, SOL_SOCKET, SO_REUSEPORT, &reusePort, sizeof(reusePort));
+ #endif
memset( &sendToAddr_, 0, sizeof(sendToAddr_) );
sendToAddr_.sin_family = AF_INET;
@@ -125,8 +125,9 @@ extern MessageTerminator EndMessage;
struct NilType{
};
-extern NilType Nil;
-
+#ifndef _OBJC_OBJC_H_
+ extern NilType Nil;
+#endif
struct InfinitumType{
};
@@ -52,7 +52,8 @@
enum ofxiPhoneDeviceType {
OFXIPHONE_DEVICE_IPHONE,
OFXIPHONE_DEVICE_IPODTOUCH,
- OFXIPHONE_DEVICE_IPAD
+ OFXIPHONE_DEVICE_IPAD,
+ OFXIPHONE_UNKNOWN_DEVICE
};
@@ -160,8 +160,8 @@ -(CGImageRef)getCurrentFrame{
-(void)listDevices{
NSArray * devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo];
int i=0;
- for (AVCaptureDevice *device in devices){
- cout<<"Device "<<i<<": "<<ofxNSStringToString(device.localizedName)<<endl;
+ for (AVCaptureDevice * captureDevice in devices){
+ cout<<"Device "<<i<<": "<<ofxNSStringToString(captureDevice.localizedName)<<endl;
i++;
}
}
@@ -82,6 +82,8 @@ using namespace std;
- (pair<UIImage*,CGImageRef>)getCopyOfCurrentFrame;
- (CVImageBufferRef)getCurrentFrame;
+- (void)updateFrameTimeDifference;
+
- (void)audioCallbackWithQueue:(AudioQueueRef)queue output:(AudioQueueBufferRef)output_buffer;
/// return the current video time (on-screen time)
@@ -559,10 +559,14 @@ - (CVImageBufferRef)getCurrentFrame
{
// try to get video
CVImageBufferRef image_buffer = CMSampleBufferGetImageBuffer(buffer);
- last_returned_frame_presentation_timestamp_s = presentation_timestamp_s;
return image_buffer;
}
+-(void)updateFrameTimeDifference
+{
+ last_returned_frame_presentation_timestamp_s = presentation_timestamp_s;
+}
+
- (pair<UIImage*,CGImageRef>)getCopyOfCurrentFrame
{
// try to get video
@@ -302,6 +302,11 @@ float ofxOpenALSoundPlayer::getVolume() {
}
//--------------------------------------------------------------
+bool ofxOpenALSoundPlayer::isLoaded() {
+ return bLoadedOk;
+}
+
+//--------------------------------------------------------------
//static calls ---------------------------------------------------------------------------------------------------------------
@@ -88,6 +88,8 @@ class ofxOpenALSoundPlayer : public ofBaseSoundPlayer{
float getVolume();
float getPan();
+
+ bool isLoaded();
// IPHONE EXTRA FUNCTIONS
static void vibrate();
@@ -34,12 +34,11 @@
//--------------------------------------------------------------
ofxiPhoneDeviceType ofxiPhoneGetDeviceType() {
- if([[[UIDevice currentDevice] model] caseInsensitiveCompare:@"iPhone"])
- return OFXIPHONE_DEVICE_IPHONE;
- else if([[[UIDevice currentDevice] model] caseInsensitiveCompare:@"iPod"])
- return OFXIPHONE_DEVICE_IPODTOUCH;
- else
- return OFXIPHONE_DEVICE_IPAD;
+ NSString * dev = [[[UIDevice currentDevice] model] lowercaseString];
+ if( [dev hasPrefix:@"iphone"] ) return OFXIPHONE_DEVICE_IPHONE;
+ if( [dev hasPrefix:@"ipad"] ) return OFXIPHONE_DEVICE_IPAD;
+ if( [dev hasPrefix:@"ipod"] ) return OFXIPHONE_DEVICE_IPODTOUCH;
+ return OFXIPHONE_UNKNOWN_DEVICE; //this would need to be declared
}
@@ -450,8 +449,17 @@ void releaseData(void *info, const void *data, size_t dataSize) {
void ofxiPhoneScreenGrab(id delegate) {
CGRect rect = [[UIScreen mainScreen] bounds];
- int width = rect.size.width;
- int height = rect.size.height;
+
+ //fix from: http://forum.openframeworks.cc/index.php/topic,6092.15.html
+ //TODO: look and see if we need to take rotation into account
+ if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)] == YES){
+ float f_scale = [[UIScreen mainScreen] scale];
+ rect.size.width *= f_scale;
+ rect.size.height *= f_scale;
+ }
+
+ int width = rect.size.width;
+ int height = rect.size.height;
NSInteger myDataLength = width * height * 4;
GLubyte *buffer = (GLubyte *) malloc(myDataLength);
@@ -24,14 +24,14 @@ class canLoadPixels
virtual void loadPixels() = 0;
};
+//----------------------------------------------------------- overlay.
@interface OverlayView : UIView
-{
- UIImagePickerController * _del;
-}
-- (id)initWithFrame:(CGRect)frame andDelegate:(UIImagePickerController *)del;
-- (void) takePhoto:(id) sender;
+@property (nonatomic, retain) id delegate;
+- (void)initUI;
+- (void)takePhoto:(id)sender;
@end
+//-----------------------------------------------------------
@interface ofxiPhoneImagePickerDelegate : NSObject <UINavigationControllerDelegate, UIImagePickerControllerDelegate>
{
@@ -63,17 +63,19 @@ class canLoadPixels
- (UIImageOrientation) getImageOrientation;
-- (bool) openLibrary;
-- (bool) openCamera:(int)camera;
+- (BOOL) openLibrary;
+- (BOOL) openCamera:(int)camera;
#ifdef __IPHONE_3_1
-- (bool) showCameraOverlay;
+- (BOOL) showCameraOverlay;
+- (BOOL) showCameraOverlayWithCustomView:(UIView *)overlayView;
- (void) hideCameraOverlay;
#endif
-- (bool) openSavedPhotos;
+- (BOOL) openSavedPhotos;
+- (void) close;
-- (bool) isCameraAvailable;
-- (bool) isPhotoLibraryAvailable;
-- (bool) isSavedPhotosAvailable;
+- (BOOL) isCameraAvailable;
+- (BOOL) isPhotoLibraryAvailable;
+- (BOOL) isSavedPhotosAvailable;
//- (bool) wasNewImagePicked;
- (void) saveImageToPhotoAlbum;
@@ -96,12 +98,14 @@ class ofxiPhoneImagePicker : public canLoadPixels
bool openCamera(int camera=0); // 0 for rear, 1 for front
bool openLibrary();
-
+
#ifdef __IPHONE_3_1
bool showCameraOverlay();
+ bool showCameraOverlayWithCustomView(UIView * view);
void hideCameraOverlay();
#endif
bool openSavedPhotos();
+ void close();
bool cameraIsAvailable; //variables to see if specific functions are available for a specific device.
bool photoLibraryIsAvailable;
Oops, something went wrong.

0 comments on commit 379d795

Please sign in to comment.