ARX  1.0
The next-generation open source augmented reality toolkit.
Loading...
Searching...
No Matches
image_utils.h
Go to the documentation of this file.
1/*
2 * image_utils.h
3 * artoolkitX
4 *
5 * Implements a basic image loading/saving system.
6 *
7 * This file is part of artoolkitX.
8 *
9 * artoolkitX is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU Lesser General Public License as published by
11 * the Free Software Foundation, either version 3 of the License, or
12 * (at your option) any later version.
13 *
14 * artoolkitX is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with artoolkitX. If not, see <http://www.gnu.org/licenses/>.
21 *
22 * As a special exception, the copyright holders of this library give you
23 * permission to link this library with independent modules to produce an
24 * executable, regardless of the license terms of these independent modules, and to
25 * copy and distribute the resulting executable under terms of your choice,
26 * provided that you also meet, for each linked independent module, the terms and
27 * conditions of the license of that module. An independent module is a module
28 * which is neither derived from nor based on this library. If you modify this
29 * library, you may extend this exception to your version of the library, but you
30 * are not obligated to do so. If you do not wish to do so, delete this exception
31 * statement from your version.
32 *
33 * Copyright 2018 Realmax, Inc.
34 *
35 * Author(s): Daniel Bell
36 *
37 */
38
39#ifndef __ARUtil_image_utils_h__
40#define __ARUtil_image_utils_h__
41
42#include <stdio.h>
43#include <string>
44#include <memory>
45#include <ARX/ARUtil/types.h>
46
47ARUTIL_EXTERN std::string getFileExtension(const std::string& filename);
48
49ARUTIL_EXTERN bool ReadImageFromFile(const char* fileName, std::shared_ptr<unsigned char> &refImage, int *cols, int *rows, int *nc, bool forceMono = false);
50
51ARUTIL_EXTERN bool WriteImageTofile(unsigned char* data, int width, int height, int stride, std::string fileName, bool colourImage = false);
52
53#endif // !__ARUtil_image_utils_h__
ARUTIL_EXTERN bool WriteImageTofile(unsigned char *data, int width, int height, int stride, std::string fileName, bool colourImage=false)
Definition: image_utils.cpp:74
ARUTIL_EXTERN std::string getFileExtension(const std::string &filename)
Definition: image_utils.cpp:53
ARUTIL_EXTERN bool ReadImageFromFile(const char *fileName, std::shared_ptr< unsigned char > &refImage, int *cols, int *rows, int *nc, bool forceMono=false)
Definition: image_utils.cpp:57
#define ARUTIL_EXTERN
Definition: types.h:58