Divide Framework
0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
ImageToolsFwd.h
Go to the documentation of this file.
1
/*
2
Copyright (c) 2018 DIVIDE-Studio
3
Copyright (c) 2009 Ionut Cava
4
5
This file is part of DIVIDE Framework.
6
7
Permission is hereby granted, free of charge, to any person obtaining a copy
8
of this software
9
and associated documentation files (the "Software"), to deal in the Software
10
without restriction,
11
including without limitation the rights to use, copy, modify, merge, publish,
12
distribute, sublicense,
13
and/or sell copies of the Software, and to permit persons to whom the
14
Software is furnished to do so,
15
subject to the following conditions:
16
17
The above copyright notice and this permission notice shall be included in
18
all copies or substantial portions of the Software.
19
20
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
IMPLIED,
22
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
23
PARTICULAR PURPOSE AND NONINFRINGEMENT.
24
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
25
DAMAGES OR OTHER LIABILITY,
26
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
27
IN CONNECTION WITH THE SOFTWARE
28
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
30
*/
31
32
#pragma once
33
#ifndef DVD_UTILITY_IMAGETOOLS_FWD_H
34
#define DVD_UTILITY_IMAGETOOLS_FWD_H
35
36
namespace
Divide
{
37
namespace
ImageTools {
38
39
void
OnStartup
(
bool
upperLeftOrigin);
40
void
OnShutdown
();
41
42
[[nodiscard]]
bool
UseUpperLeftOrigin
()
noexcept
;
43
44
enum class
MipMapFilter
:
U8
{
45
BOX
,
46
TRIANGLE
,
47
KAISER
,
48
COUNT
49
};
50
51
enum class
ImageOutputFormat
:
U8
{
52
BC1
,
//Will be BC1n for normal maps
53
BC1a
,
54
BC2
,
55
BC3
,
//Will be BC3n for normal maps
56
BC4
,
57
BC5
,
58
BC6
,
59
BC7
,
60
//BC3_RGBM, //Not supported
61
AUTO
,
// BC7 for textures, BC5 for normal maps, BC4 single channel images
62
COUNT
63
};
64
65
struct
ImportOptions
{
66
bool
_useDDSCache
=
true
;
67
bool
_waitForDDSConversion
=
false
;
68
bool
_skipMipMaps
=
false
;
69
bool
_isNormalMap
=
false
;
70
bool
_fastCompression
=
false
;
71
bool
_outputSRGB
=
false
;
72
bool
_alphaChannelTransparency
=
true
;
73
MipMapFilter
_mipFilter
=
MipMapFilter::KAISER
;
74
ImageOutputFormat
_outputFormat
=
ImageOutputFormat::AUTO
;
75
};
76
77
FWD_DECLARE_MANAGED_STRUCT
(
LayerData
);
78
79
80
enum class
SaveImageFormat
:
U8
{
81
PNG
,
82
BMP
,
83
TGA
,
84
//HDR, /// Use special function for this!
85
JPG
,
86
COUNT
87
};
88
90
bool
SaveImage
(
const
ResourcePath
& filename,
U16
width,
U16
height,
U8
numberOfComponents,
U8
bytesPerPixel,
const
bool
sourceIsBGR,
const
Byte
* imageData,
SaveImageFormat
format);
92
bool
SaveImageHDR
(
const
ResourcePath
& filename,
U16
width,
U16
height,
U8
numberOfComponents,
U8
bytesPerPixel,
const
bool
sourceIsBGR,
const
F32
* imageData);
93
94
}
//namespace ImageTools
95
}
//namespace Divide
96
97
#endif
//DVD_UTILITY_IMAGETOOLS_FWD_H
FWD_DECLARE_MANAGED_STRUCT
#define FWD_DECLARE_MANAGED_STRUCT(T)
Definition:
PlatformDefines.h:85
Divide::ImageTools::SaveImage
bool SaveImage(const ResourcePath &filename, U16 width, U16 height, U8 numberOfComponents, U8 bytesPerPixel, const bool sourceIsBGR, const Byte *imageData, SaveImageFormat format)
Save an image to file of the desired format. Only R/RG/RGB/RGBA 8 bits per pixel data is supported as...
Definition:
ImageTools.cpp:1416
Divide::ImageTools::UseUpperLeftOrigin
bool UseUpperLeftOrigin() noexcept
Definition:
ImageTools.cpp:202
Divide::ImageTools::OnStartup
void OnStartup(bool upperLeftOrigin)
Definition:
ImageTools.cpp:186
Divide::ImageTools::ImageOutputFormat
ImageOutputFormat
Definition:
ImageToolsFwd.h:51
Divide::ImageTools::ImageOutputFormat::BC1a
@ BC1a
Divide::ImageTools::ImageOutputFormat::BC2
@ BC2
Divide::ImageTools::ImageOutputFormat::BC6
@ BC6
Divide::ImageTools::ImageOutputFormat::BC1
@ BC1
Divide::ImageTools::ImageOutputFormat::BC3
@ BC3
Divide::ImageTools::ImageOutputFormat::BC7
@ BC7
Divide::ImageTools::ImageOutputFormat::BC5
@ BC5
Divide::ImageTools::ImageOutputFormat::AUTO
@ AUTO
Divide::ImageTools::ImageOutputFormat::BC4
@ BC4
Divide::ImageTools::OnShutdown
void OnShutdown()
Definition:
ImageTools.cpp:198
Divide::ImageTools::SaveImageFormat
SaveImageFormat
Definition:
ImageToolsFwd.h:80
Divide::ImageTools::SaveImageFormat::PNG
@ PNG
Divide::ImageTools::SaveImageFormat::TGA
@ TGA
Divide::ImageTools::SaveImageFormat::JPG
@ JPG
Divide::ImageTools::SaveImageFormat::BMP
@ BMP
Divide::ImageTools::MipMapFilter
MipMapFilter
Definition:
ImageToolsFwd.h:44
Divide::ImageTools::MipMapFilter::COUNT
@ COUNT
Divide::ImageTools::MipMapFilter::KAISER
@ KAISER
Divide::ImageTools::MipMapFilter::TRIANGLE
@ TRIANGLE
Divide::ImageTools::MipMapFilter::BOX
@ BOX
Divide::ImageTools::SaveImageHDR
bool SaveImageHDR(const ResourcePath &filename, U16 width, U16 height, U8 numberOfComponents, U8 bytesPerPixel, const bool sourceIsBGR, const F32 *imageData)
Save an HDR image to file of the desired format.
Definition:
ImageTools.cpp:1451
Divide
Handle console commands that start with a forward slash.
Definition:
AIProcessor.cpp:7
Divide::Byte
std::byte Byte
Definition:
PlatformDataTypes.h:97
Divide::U8
uint8_t U8
Definition:
PlatformDataTypes.h:44
Divide::F32
float F32
Definition:
PlatformDataTypes.h:82
Divide::U16
uint16_t U16
Definition:
PlatformDataTypes.h:45
Divide::ImageTools::ImportOptions
Definition:
ImageToolsFwd.h:65
Divide::ImageTools::ImportOptions::_isNormalMap
bool _isNormalMap
Definition:
ImageToolsFwd.h:69
Divide::ImageTools::ImportOptions::_useDDSCache
bool _useDDSCache
Definition:
ImageToolsFwd.h:66
Divide::ImageTools::ImportOptions::_fastCompression
bool _fastCompression
Definition:
ImageToolsFwd.h:70
Divide::ImageTools::ImportOptions::_alphaChannelTransparency
bool _alphaChannelTransparency
If false, the alpha channel represents arbitrary data (e.g. in splatmaps)
Definition:
ImageToolsFwd.h:72
Divide::ImageTools::ImportOptions::_waitForDDSConversion
bool _waitForDDSConversion
If false, we will load the src image and convert to DDS in the background. If true,...
Definition:
ImageToolsFwd.h:67
Divide::ImageTools::ImportOptions::_skipMipMaps
bool _skipMipMaps
Definition:
ImageToolsFwd.h:68
Divide::ImageTools::ImportOptions::_outputSRGB
bool _outputSRGB
Definition:
ImageToolsFwd.h:71
Divide::ImageTools::ImportOptions::_outputFormat
ImageOutputFormat _outputFormat
Definition:
ImageToolsFwd.h:74
Divide::ImageTools::ImportOptions::_mipFilter
MipMapFilter _mipFilter
Definition:
ImageToolsFwd.h:73
Divide::ImageTools::LayerData
Definition:
ImageTools.h:41
Divide::ResourcePath
Definition:
ResourcePath.h:47
Source
Utility
Headers
ImageToolsFwd.h
Generated on Fri May 17 2024 16:59:57 for Divide Framework by
1.9.6