Repository navigation
Expand file tree
/
Copy pathutils.h
More file actions
48 lines (39 loc) · 1.42 KB
/
Copy pathutils.h
File metadata and controls
48 lines (39 loc) · 1.42 KB
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
#pragma once
#include <cmath>
#include <cinttypes>
#include "colortwist.h"
#include "colortwist_config.h"
inline colortwist::StatusCode checkArgumentsRgb48(const void* pSrc, std::uint32_t width, int strideSrc, void* pDst, int strideDst, const float* twistMatrix)
{
if (pSrc == nullptr || pDst == nullptr || twistMatrix == nullptr)
{
return colortwist::StatusCode::InvalidPointer;
}
if (width * 3 * 2 > static_cast<std::uint32_t>(abs(strideSrc)) || width * 3 * 2 > static_cast<std::uint32_t>(abs(strideDst)))
{
return colortwist::StatusCode::InvalidStride;
}
return colortwist::StatusCode::OK;
}
inline colortwist::StatusCode checkArgumentsRgb24(const void* pSrc, std::uint32_t width, int strideSrc, void* pDst, int strideDst, const float* twistMatrix)
{
if (pSrc == nullptr || pDst == nullptr || twistMatrix == nullptr)
{
return colortwist::StatusCode::InvalidPointer;
}
if (width * 3 > static_cast<std::uint32_t>(abs(strideSrc)) || width * 3 > static_cast<std::uint32_t>(abs(strideDst)))
{
return colortwist::StatusCode::InvalidStride;
}
return colortwist::StatusCode::OK;
}
#if COLORTWISTLIB_HAS_INTEL_INTRINSICS
bool CheckWhetherCpuSupportsAVX2();
bool CheckWhetherCpuSupportsSSE41();
#endif
#if COLORTWISTLIB_HASNEON
bool CheckWhetherCpuSupportsNeon();
#endif
#if COLORTWISTLIB_HAS_RISCV_VECTOREXTENSIONS
bool CheckHasRiscvVectorExtensions();
#endif