forked from dusty-nv/jetson-inference
-
Notifications
You must be signed in to change notification settings - Fork 0
/
loadImage.h
58 lines (44 loc) · 2.11 KB
/
loadImage.h
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
/*
* http://github.com/dusty-nv/jetson-inference
*/
#ifndef __IMAGE_LOADER_H_
#define __IMAGE_LOADER_H_
#include "cudaUtility.h"
/**
* Load a color image from disk into CUDA memory with alpha.
* This function loads the image into shared CPU/GPU memory, using the functions from cudaMappedMemory.h
*
* @param filename Path to the image file on disk.
* @param cpu Pointer to CPU buffer allocated containing the image.
* @param gpu Pointer to CUDA device buffer residing on GPU containing image.
* @param width Variable containing width in pixels of the image.
* @param height Variable containing height in pixels of the image.
*/
bool loadImageRGBA( const char* filename, float4** cpu, float4** gpu, int* width, int* height );
/**
* Save an image to disk
*/
bool saveImageRGBA( const char* filename, float4* cpu, int width, int height, float max_pixel=255.0f );
/**
* Load a color image from disk into CUDA memory.
* This function loads the image into shared CPU/GPU memory, using the functions from cudaMappedMemory.h
*
* @param filename Path to the image file on disk.
* @param cpu Pointer to CPU buffer allocated containing the image.
* @param gpu Pointer to CUDA device buffer residing on GPU containing image.
* @param width Variable containing width in pixels of the image.
* @param height Variable containing height in pixels of the image.
*/
bool loadImageRGB( const char* filename, float3** cpu, float3** gpu, int* width, int* height, const float3& mean=make_float3(0,0,0) );
/**
* Load a color image from disk into CUDA memory.
* This function loads the image into shared CPU/GPU memory, using the functions from cudaMappedMemory.h
*
* @param filename Path to the image file on disk.
* @param cpu Pointer to CPU buffer allocated containing the image.
* @param gpu Pointer to CUDA device buffer residing on GPU containing image.
* @param width Variable containing width in pixels of the image.
* @param height Variable containing height in pixels of the image.
*/
bool loadImageBGR( const char* filename, float3** cpu, float3** gpu, int* width, int* height, const float3& mean=make_float3(0,0,0) );
#endif