Utils.h 2.07 KB
Newer Older
Guillaume Roguez's avatar
Guillaume Roguez committed
1
/*
2
 *  Copyright (C) 2016-2019 Savoir-faire Linux Inc.
Guillaume Roguez's avatar
Guillaume Roguez committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
 *
 *  Author: Edric Ladent-Milaret <edric.ladent-milaret@savoirfairelinux.com>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
Edric Milaret's avatar
Edric Milaret committed
18 19
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
 * USA.
Guillaume Roguez's avatar
Guillaume Roguez committed
20 21 22 23
 */

#import <Foundation/Foundation.h>

Edric Milaret's avatar
Edric Milaret committed
24
#import <map>
Guillaume Roguez's avatar
Guillaume Roguez committed
25 26
#import <string>
#import <vector>
27
struct AVFrame;
Guillaume Roguez's avatar
Guillaume Roguez committed
28 29 30

@interface Utils : NSObject

Edric Milaret's avatar
Edric Milaret committed
31 32 33 34
+ (NSArray*)vectorToArray:(const std::vector<std::string>&)vector;
+ (NSMutableDictionary*)mapToDictionnary:
    (const std::map<std::string, std::string>&)map;
+ (std::map<std::string, std::string>)dictionnaryToMap:(NSDictionary*)dict;
35
+ (NSArray*)vectorOfMapsToArray:(const std::vector<std::map<std::string, std::string>>&)vectorOfMaps;
36 37
+ (NSData*)dataFromVectorOfUInt8:(std::vector<uint8_t>)vectorOfUInt8;
+ (std::vector<uint8_t>)vectorOfUInt8FromData:(NSData*)data;
Kateryna Kostiuk's avatar
Kateryna Kostiuk committed
38
+ (std::vector<std::map<std::string, std::string>>)arrayOfDictionnarisToVectorOfMap:(NSArray*)dictionaries;
39
+ (UIImage*)convertHardwareDecodedFrameToImage:(const AVFrame*)frame;
Kateryna Kostiuk's avatar
Kateryna Kostiuk committed
40 41 42 43 44 45
+ (AVFrame*)configureHardwareDecodedFrame:(AVFrame*)frame
                          fromImageBuffer: (CVImageBufferRef)image
                                    angle:(int) angle;
+ (AVFrame*)configureFrame:(AVFrame*)frame
           fromImageBuffer: (CVImageBufferRef)image
                     angle:(int)angle;
46 47
+(UIImageOrientation)uimageOrientationFromRotation:(double)rotation;
+(CGImagePropertyOrientation)ciimageOrientationFromRotation:(double)rotation;
Guillaume Roguez's avatar
Guillaume Roguez committed
48
@end