SGCT
master (487fac4)
Simple Graphics Cluster Toolkit
Toggle main menu visibility
Loading...
Searching...
No Matches
image.h
Go to the documentation of this file.
1
/*****************************************************************************************
2
* SGCT *
3
* Simple Graphics Cluster Toolkit *
4
* *
5
* Copyright (c) 2012-2026 *
6
* For conditions of distribution and use, see copyright notice in LICENSE.md *
7
****************************************************************************************/
8
9
#ifndef __SGCT__IMAGE__H__
10
#define __SGCT__IMAGE__H__
11
12
#include <sgct/sgctexports.h>
13
14
#include <
sgct/math.h
>
15
#include <filesystem>
16
17
namespace
sgct
{
18
19
class
SGCT_EXPORT
Image
{
20
public
:
21
Image
() =
default
;
22
~Image
();
23
24
void
allocateOrResizeData
();
25
void
load
(
const
std::filesystem::path& filename);
26
void
load
(
unsigned
char
*
data
,
int
length);
27
31
void
save
(
const
std::filesystem::path& filename);
32
33
unsigned
char
*
data
();
34
const
unsigned
char
*
data
()
const
;
35
int
channels
()
const
;
36
int
bytesPerChannel
()
const
;
37
ivec2
size
()
const
;
38
39
void
setSize
(
ivec2
size
);
40
void
setChannels
(
int
channels
);
41
void
setBytesPerChannel
(
int
bpc);
42
43
private
:
44
int
_nChannels = 0;
45
ivec2
_size =
ivec2
{ 0, 0 };
46
unsigned
int
_dataSize = 0;
47
int
_bytesPerChannel = 1;
48
unsigned
char
* _data =
nullptr
;
49
};
50
51
}
// namespace sgct
52
53
#endif
// __SGCT__IMAGE__H__
sgct::Image::setSize
void setSize(ivec2 size)
sgct::Image::channels
int channels() const
sgct::Image::setBytesPerChannel
void setBytesPerChannel(int bpc)
sgct::Image::Image
Image()=default
sgct::Image::allocateOrResizeData
void allocateOrResizeData()
sgct::Image::setChannels
void setChannels(int channels)
sgct::Image::bytesPerChannel
int bytesPerChannel() const
sgct::Image::load
void load(const std::filesystem::path &filename)
sgct::Image::load
void load(unsigned char *data, int length)
sgct::Image::size
ivec2 size() const
sgct::Image::data
unsigned char * data()
sgct::Image::save
void save(const std::filesystem::path &filename)
Save the buffer to file.
sgct::Image::data
const unsigned char * data() const
sgct::Image::~Image
~Image()
math.h
sgct
Definition
actions.h:16
sgct::ivec2
Definition
math.h:17
sgct
image.h
Generated by
1.18.0