Nebula
Toggle main menu visibility
Loading...
Searching...
No Matches
image.h
Go to the documentation of this file.
1
#pragma once
2
//------------------------------------------------------------------------------
11
//------------------------------------------------------------------------------
12
#include "
ids/id.h
"
13
#include "
ids/idallocator.h
"
14
#include "
pixelformat.h
"
15
#include "
io/uri.h
"
16
namespace
CoreGraphics
17
{
18
19
ID_24_8_TYPE
(
ImageId
);
20
21
22
struct
ImageCreateInfoFile
23
{
24
IO::URI
path
;
25
bool
convertTo32Bit
;
26
};
27
28
struct
ImageCreateInfoData
29
{
30
CoreGraphics::PixelFormat
format
;
31
SizeT
width
,
height
,
depth
;
32
void
*
data
;
33
};
34
35
enum
ImageContainer
36
{
37
PNG
,
38
JPEG
,
39
TGA
,
40
HDR
41
};
42
43
enum
ImageChannelPrimitive
44
{
45
Bit8UInt
,
46
Bit16UInt
,
47
Bit16Float
,
48
Bit32UInt
,
49
Bit32Float
50
};
51
53
ImageId
CreateImage
(
const
ImageCreateInfoFile& info);
55
ImageId
CreateImage
(
const
ImageCreateInfoData& info);
57
ImageId
CreateImage
(
const
CoreGraphics::TextureId
tex,
CoreGraphics::PipelineStage
stage);
59
void
DestroyImage
(
const
ImageId
id
);
60
61
struct
ImageDimensions
62
{
63
SizeT
width
,
height
;
64
};
65
66
ImageDimensions
ImageGetDimensions
(
const
ImageId
id
);
67
69
const
ubyte
*
ImageGetBuffer
(
const
ImageId
id
);
71
const
SizeT
ImageGetPixelStride
(
const
ImageId
id
);
73
const
SizeT
ImageGetChannelStride
(
const
ImageId
id
);
75
void
ImageConvertPrimitive
(
const
ImageId
id
,
const
ImageChannelPrimitive
primitive,
bool
denormalize);
76
78
bool
ImageSaveToFile
(
const
ImageId
id
,
const
ImageContainer
container,
const
IO::URI
& path);
79
81
ImageChannelPrimitive
ImageGetChannelPrimitive
(
const
ImageId
id
);
82
83
struct
ImageLoadInfo
84
{
85
SizeT
width
,
height
,
channels
;
86
ImageChannelPrimitive
primitive
;
87
PixelFormat::Code
format
;
88
uint8_t
redOffset
,
greenOffset
,
blueOffset
,
alphaOffset
;
89
90
union
ImageData
91
{
92
unsigned
char
*
stbiData8
;
93
unsigned
short
*
stbiData16
;
94
unsigned
int
*
stbiData32
;
95
float
*
stbiDataFloat
;
96
}
data
;
97
};
98
99
typedef
Ids::IdAllocator
<
100
ImageLoadInfo
101
>
ImageAllocator
;
102
extern
ImageAllocator
imageAllocator
;
103
104
}
// namespace CoreGraphics
CoreGraphics::PixelFormat
Pixel format enumeration.
Definition
pixelformat.h:22
CoreGraphics::PixelFormat::Code
Code
enums
Definition
pixelformat.h:26
IO::URI
An URI object can split a Uniform Resource Identifier string into its components or build a string fr...
Definition
uri.h:67
Ids::IdAllocator
An ID allocator associates an id with a slice in an N number of arrays.
Definition
idallocator.h:39
idallocator.h
id.h
ID_24_8_TYPE
#define ID_24_8_TYPE(x)
Definition
id.h:132
CoreGraphics
Acceleration structures are used to enable ray tracing on the GPU by dividing the scene into a BVH.
Definition
accelerationstructure.h:24
CoreGraphics::ImageGetDimensions
ImageDimensions ImageGetDimensions(const ImageId id)
get image dimensions
Definition
image.cc:198
CoreGraphics::ImageGetBuffer
const ubyte * ImageGetBuffer(const ImageId id)
Get pointer to buffer.
Definition
image.cc:208
CoreGraphics::CreateImage
ImageId CreateImage(const ImageCreateInfoFile &info)
create image from file path
Definition
image.cc:68
CoreGraphics::ImageGetPixelStride
const SizeT ImageGetPixelStride(const ImageId id)
Get pixel stride in bytes.
Definition
image.cc:218
CoreGraphics::ImageAllocator
Ids::IdAllocator< ImageLoadInfo > ImageAllocator
Definition
image.h:101
CoreGraphics::DestroyImage
void DestroyImage(const ImageId id)
destroy image
Definition
image.cc:188
CoreGraphics::imageAllocator
ImageAllocator imageAllocator
Definition
image.cc:63
CoreGraphics::ImageGetChannelPrimitive
ImageChannelPrimitive ImageGetChannelPrimitive(const ImageId id)
get channel primitive
Definition
image.cc:421
CoreGraphics::ImageChannelPrimitive
ImageChannelPrimitive
Definition
image.h:44
CoreGraphics::Bit16UInt
@ Bit16UInt
Definition
image.h:46
CoreGraphics::Bit32UInt
@ Bit32UInt
Definition
image.h:48
CoreGraphics::Bit8UInt
@ Bit8UInt
Definition
image.h:45
CoreGraphics::Bit32Float
@ Bit32Float
Definition
image.h:49
CoreGraphics::Bit16Float
@ Bit16Float
Definition
image.h:47
CoreGraphics::ImageConvertPrimitive
void ImageConvertPrimitive(const ImageId id, const ImageChannelPrimitive primitive, bool denormalize)
Convert image primitive.
Definition
image.cc:288
CoreGraphics::ImageSaveToFile
bool ImageSaveToFile(const ImageId id, const ImageContainer container, const IO::URI &path)
Save image to file.
Definition
image.cc:385
CoreGraphics::ImageGetChannelStride
const SizeT ImageGetChannelStride(const ImageId id)
Get channel stride in bytes.
Definition
image.cc:229
CoreGraphics::ImageContainer
ImageContainer
Definition
image.h:36
CoreGraphics::JPEG
@ JPEG
Definition
image.h:38
CoreGraphics::HDR
@ HDR
Definition
image.h:40
CoreGraphics::TGA
@ TGA
Definition
image.h:39
CoreGraphics::PNG
@ PNG
Definition
image.h:37
CoreGraphics::PipelineStage
PipelineStage
Definition
config.h:192
pixelformat.h
CoreGraphics::ImageCreateInfoData
Definition
image.h:29
CoreGraphics::ImageCreateInfoData::format
CoreGraphics::PixelFormat format
Definition
image.h:30
CoreGraphics::ImageCreateInfoData::width
SizeT width
Definition
image.h:31
CoreGraphics::ImageCreateInfoData::data
void * data
Definition
image.h:32
CoreGraphics::ImageCreateInfoData::depth
SizeT depth
Definition
image.h:31
CoreGraphics::ImageCreateInfoData::height
SizeT height
Definition
image.h:31
CoreGraphics::ImageCreateInfoFile
Definition
image.h:23
CoreGraphics::ImageCreateInfoFile::path
IO::URI path
Definition
image.h:24
CoreGraphics::ImageCreateInfoFile::convertTo32Bit
bool convertTo32Bit
Definition
image.h:25
CoreGraphics::ImageDimensions
Definition
image.h:62
CoreGraphics::ImageDimensions::width
SizeT width
Definition
image.h:63
CoreGraphics::ImageDimensions::height
SizeT height
Definition
image.h:63
CoreGraphics::ImageId
Definition
image.h:19
CoreGraphics::ImageLoadInfo
Definition
image.h:84
CoreGraphics::ImageLoadInfo::blueOffset
uint8_t blueOffset
Definition
image.h:88
CoreGraphics::ImageLoadInfo::width
SizeT width
Definition
image.h:85
CoreGraphics::ImageLoadInfo::data
union CoreGraphics::ImageLoadInfo::ImageData data
CoreGraphics::ImageLoadInfo::channels
SizeT channels
Definition
image.h:85
CoreGraphics::ImageLoadInfo::alphaOffset
uint8_t alphaOffset
Definition
image.h:88
CoreGraphics::ImageLoadInfo::format
PixelFormat::Code format
Definition
image.h:87
CoreGraphics::ImageLoadInfo::primitive
ImageChannelPrimitive primitive
Definition
image.h:86
CoreGraphics::ImageLoadInfo::height
SizeT height
Definition
image.h:85
CoreGraphics::ImageLoadInfo::redOffset
uint8_t redOffset
Definition
image.h:88
CoreGraphics::ImageLoadInfo::greenOffset
uint8_t greenOffset
Definition
image.h:88
CoreGraphics::TextureId
texture type
Definition
texture.h:25
ubyte
unsigned char ubyte
Definition
types.h:36
SizeT
int SizeT
Definition
types.h:42
CoreGraphics::ImageLoadInfo::ImageData
Definition
image.h:91
CoreGraphics::ImageLoadInfo::ImageData::stbiData16
unsigned short * stbiData16
Definition
image.h:93
CoreGraphics::ImageLoadInfo::ImageData::stbiDataFloat
float * stbiDataFloat
Definition
image.h:95
CoreGraphics::ImageLoadInfo::ImageData::stbiData8
unsigned char * stbiData8
Definition
image.h:92
CoreGraphics::ImageLoadInfo::ImageData::stbiData32
unsigned int * stbiData32
Definition
image.h:94
uri.h
code
render
coregraphics
image.h
Generated on
for Nebula. Dark theme by
Tilen Majerle
. All rights reserved.