@@ -49,7 +49,7 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<PlatformToolset>v145</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -9,10 +9,6 @@
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="stdafx.h">
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<PlatformToolset>v145</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -9,10 +9,6 @@
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="stdafx.h">
|
||||
|
||||
@@ -6,7 +6,9 @@ C4JRender RenderManager;
|
||||
|
||||
void C4JRender::Tick()
|
||||
{
|
||||
#if _DEBUG
|
||||
InternalRenderManager.CBuffTick();
|
||||
#endif
|
||||
}
|
||||
|
||||
void C4JRender::UpdateGamma(unsigned short usGamma)
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
// enable only if you know what you're doing
|
||||
// requires linking Minecraft.Client against Ws2_32.lib
|
||||
// stats are available at http://127.0.0.1:1338/
|
||||
|
||||
//#define ENABLE_PROFILING
|
||||
|
||||
#ifdef ENABLE_PROFILING
|
||||
#include "microprofile/microprofile.h"
|
||||
#define PROFILER_SCOPE(group, name, color) MICROPROFILE_SCOPEI(group, name, color);
|
||||
#else
|
||||
#define PROFILER_SCOPE(group, name, color) ((void)0);
|
||||
#endif
|
||||
@@ -49,7 +49,7 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<PlatformToolset>v145</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
@@ -123,7 +123,7 @@
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<AdditionalIncludeDirectories>libpng\;zlib\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>libpng\;zlib\;microprofile\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
</ClCompile>
|
||||
@@ -148,7 +148,7 @@
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<AdditionalIncludeDirectories>libpng\;zlib\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>libpng\;zlib\;microprofile\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>
|
||||
@@ -167,6 +167,10 @@
|
||||
<ClInclude Include="libpng\pnglibconf.h" />
|
||||
<ClInclude Include="libpng\pngpriv.h" />
|
||||
<ClInclude Include="libpng\pngstruct.h" />
|
||||
<ClInclude Include="microprofile\microprofile.h" />
|
||||
<ClInclude Include="microprofile\microprofile_html.h" />
|
||||
<ClInclude Include="microprofile\microprofile_icons.h" />
|
||||
<ClInclude Include="Profiler.h" />
|
||||
<ClInclude Include="PS_ForceLOD.h" />
|
||||
<ClInclude Include="PS_ScreenClear.h" />
|
||||
<ClInclude Include="PS_ScreenSpace.h" />
|
||||
@@ -329,6 +333,7 @@
|
||||
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
</ForcedIncludeFiles>
|
||||
</ClCompile>
|
||||
<ClCompile Include="microprofile\microprofile.cpp" />
|
||||
<ClCompile Include="RendererCBuff.cpp" />
|
||||
<ClCompile Include="RendererCore.cpp" />
|
||||
<ClCompile Include="RendererMatrix.cpp" />
|
||||
|
||||
@@ -9,9 +9,20 @@
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
<Filter Include="Header Files\zlib">
|
||||
<UniqueIdentifier>{e5716c14-38f4-49f7-bf1a-916fbc7613a8}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\libpng">
|
||||
<UniqueIdentifier>{0681221a-1efa-43e4-b0f7-0b525172e486}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\libpng">
|
||||
<UniqueIdentifier>{0629c87a-576d-4163-8c60-dad190ee97d0}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\microprofile">
|
||||
<UniqueIdentifier>{8be558c7-c6e6-4ef7-bfcb-83d29f079240}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\microprofile">
|
||||
<UniqueIdentifier>{6cbd8b95-ff51-42d2-a66f-282d3a11c042}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -21,33 +32,6 @@
|
||||
<ClInclude Include="4J_Render.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="libpng\png.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="libpng\pngconf.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="libpng\pngdebug.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="libpng\pnginfo.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="libpng\pngpriv.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="libpng\pngstruct.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="zlib\zlib.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="libpng\pnglibconf.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="zlib\zconf.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Renderer.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
@@ -87,6 +71,45 @@
|
||||
<ClInclude Include="PS_ScreenSpace.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="zlib\zconf.h">
|
||||
<Filter>Header Files\zlib</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="zlib\zlib.h">
|
||||
<Filter>Header Files\zlib</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="libpng\png.h">
|
||||
<Filter>Header Files\libpng</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="libpng\pngconf.h">
|
||||
<Filter>Header Files\libpng</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="libpng\pngdebug.h">
|
||||
<Filter>Header Files\libpng</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="libpng\pnginfo.h">
|
||||
<Filter>Header Files\libpng</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="libpng\pnglibconf.h">
|
||||
<Filter>Header Files\libpng</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="libpng\pngpriv.h">
|
||||
<Filter>Header Files\libpng</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="libpng\pngstruct.h">
|
||||
<Filter>Header Files\libpng</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="microprofile\microprofile.h">
|
||||
<Filter>Header Files\microprofile</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="microprofile\microprofile_html.h">
|
||||
<Filter>Header Files\microprofile</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="microprofile\microprofile_icons.h">
|
||||
<Filter>Header Files\microprofile</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Profiler.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
@@ -114,52 +137,55 @@
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="libpng\png.c">
|
||||
<Filter>Source Files</Filter>
|
||||
<Filter>Source Files\libpng</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="libpng\pngerror.c">
|
||||
<Filter>Source Files</Filter>
|
||||
<Filter>Source Files\libpng</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="libpng\pngget.c">
|
||||
<Filter>Source Files</Filter>
|
||||
<Filter>Source Files\libpng</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="libpng\pngmem.c">
|
||||
<Filter>Source Files</Filter>
|
||||
<Filter>Source Files\libpng</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="libpng\pngpread.c">
|
||||
<Filter>Source Files</Filter>
|
||||
<Filter>Source Files\libpng</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="libpng\pngread.c">
|
||||
<Filter>Source Files</Filter>
|
||||
<Filter>Source Files\libpng</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="libpng\pngrio.c">
|
||||
<Filter>Source Files</Filter>
|
||||
<Filter>Source Files\libpng</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="libpng\pngrtran.c">
|
||||
<Filter>Source Files</Filter>
|
||||
<Filter>Source Files\libpng</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="libpng\pngrutil.c">
|
||||
<Filter>Source Files</Filter>
|
||||
<Filter>Source Files\libpng</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="libpng\pngset.c">
|
||||
<Filter>Source Files</Filter>
|
||||
<Filter>Source Files\libpng</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="libpng\pngtest.c">
|
||||
<Filter>Source Files</Filter>
|
||||
<Filter>Source Files\libpng</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="libpng\pngtrans.c">
|
||||
<Filter>Source Files</Filter>
|
||||
<Filter>Source Files\libpng</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="libpng\pngwio.c">
|
||||
<Filter>Source Files</Filter>
|
||||
<Filter>Source Files\libpng</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="libpng\pngwrite.c">
|
||||
<Filter>Source Files</Filter>
|
||||
<Filter>Source Files\libpng</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="libpng\pngwtran.c">
|
||||
<Filter>Source Files</Filter>
|
||||
<Filter>Source Files\libpng</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="libpng\pngwutil.c">
|
||||
<Filter>Source Files</Filter>
|
||||
<Filter>Source Files\libpng</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="microprofile\microprofile.cpp">
|
||||
<Filter>Source Files\microprofile</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include "4J_Render.h"
|
||||
#include "Profiler.h"
|
||||
#include <cstdint>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
@@ -13,6 +14,7 @@
|
||||
#define STACK_TYPES 4
|
||||
#define STACK_SIZE 16
|
||||
#define MAX_MIP_LEVELS 5
|
||||
#define MAX_TEXTURES 512
|
||||
|
||||
#define NUM_COMMAND_HANDLES 0x800000
|
||||
#define MAX_COMMAND_BUFFERS 16000
|
||||
@@ -137,8 +139,6 @@ private:
|
||||
ID3D11SamplerState *GetManagedSamplerState();
|
||||
void DeleteInternalBuffer(int index);
|
||||
Renderer::Context &getContext();
|
||||
static D3D11_PRIMITIVE_TOPOLOGY *m_Topologies;
|
||||
static DXGI_FORMAT textureFormats[C4JRender::MAX_TEXTURE_FORMATS];
|
||||
public:
|
||||
struct Texture
|
||||
{
|
||||
@@ -332,12 +332,12 @@ public:
|
||||
DWORD stackPos[MATRIX_MODE_MODELVIEW_MAX];
|
||||
DWORD stackType;
|
||||
DWORD textureIdx;
|
||||
BYTE faceCullEnabled;
|
||||
BYTE depthTestEnabled;
|
||||
BYTE alphaTestEnabled;
|
||||
bool faceCullEnabled;
|
||||
bool depthTestEnabled;
|
||||
bool alphaTestEnabled;
|
||||
float alphaReference;
|
||||
BYTE depthWriteEnabled;
|
||||
BYTE fogEnabled;
|
||||
bool depthWriteEnabled;
|
||||
bool fogEnabled;
|
||||
float fogNearDistance;
|
||||
float fogFarDistance;
|
||||
float fogDensity;
|
||||
@@ -345,9 +345,9 @@ public:
|
||||
float fogColourBlue;
|
||||
float fogColourGreen;
|
||||
DWORD fogMode;
|
||||
BYTE lightingEnabled;
|
||||
BYTE lightEnabled[2];
|
||||
BYTE lightingDirty;
|
||||
bool lightingEnabled;
|
||||
bool lightEnabled[2];
|
||||
bool lightingDirty;
|
||||
DWORD forcedLOD;
|
||||
BYTE paddingAfterForceLOD[4];
|
||||
DirectX::XMFLOAT4 lightDirection[2];
|
||||
@@ -377,7 +377,7 @@ public:
|
||||
DWORD recordingBufferIndex;
|
||||
DWORD recordingVertexType;
|
||||
DWORD recordingPrimitiveType;
|
||||
BYTE deferredModeEnabled;
|
||||
bool deferredModeEnabled;
|
||||
std::vector<DeferredCBuff> deferredBuffers;
|
||||
D3D11_BLEND_DESC blendDesc;
|
||||
D3D11_DEPTH_STENCIL_DESC depthStencilDesc;
|
||||
@@ -386,13 +386,12 @@ public:
|
||||
};
|
||||
|
||||
static DWORD tlsIdx;
|
||||
static unsigned int s_auiWidths[MAX_MIP_LEVELS + 1];
|
||||
static unsigned int s_auiHeights[MAX_MIP_LEVELS + 1];
|
||||
static D3D11_INPUT_ELEMENT_DESC g_vertex_PTN_Elements_PF3_TF2_CB4_NB4_XW1[5];
|
||||
static D3D11_INPUT_ELEMENT_DESC g_vertex_PTN_Elements_Compressed[2];
|
||||
static D3D11_PRIMITIVE_TOPOLOGY g_topologies[C4JRender::PRIMITIVE_TYPE_COUNT];
|
||||
static int totalAlloc;
|
||||
static _RTL_CRITICAL_SECTION totalAllocCS;
|
||||
static DWORD s_auiWidths[];
|
||||
static DWORD s_auiHeights[];
|
||||
static DXGI_FORMAT textureFormats[];
|
||||
static D3D_PRIMITIVE_TOPOLOGY g_topologies[];
|
||||
static int totalAlloc;
|
||||
|
||||
float m_fClearColor[4];
|
||||
ID3D11Device *m_pDevice;
|
||||
@@ -444,8 +443,8 @@ public:
|
||||
std::unordered_map<int, ID3D11DepthStencilState *> managedDepthStencilStates;
|
||||
std::unordered_map<int, ID3D11SamplerState *> managedSamplerStates;
|
||||
std::unordered_map<int, ID3D11RasterizerState *> managedRasterizerStates;
|
||||
BYTE shouldScreenGrabNextFrame;
|
||||
BYTE suspended;
|
||||
bool m_bShouldScreenGrabNextFrame;
|
||||
bool m_bSuspended;
|
||||
BYTE paddingAfterSuspendState[2];
|
||||
};
|
||||
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
#pragma once
|
||||
#include "stdafx.h"
|
||||
#include "Renderer.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <new>
|
||||
|
||||
Renderer::CommandBuffer::CommandBuffer(bool full)
|
||||
: m_vertexBuffer(nullptr), m_vertexData(nullptr), m_vertexDataLength(0), m_commands(), m_allocated(0x1000), isActive(full ? 1 : 0)
|
||||
: m_vertexBuffer(NULL)
|
||||
, m_vertexData(NULL)
|
||||
, m_vertexDataLength(0)
|
||||
, m_commands()
|
||||
, m_allocated(0x1000)
|
||||
, isActive(full ? 1 : 0)
|
||||
{
|
||||
m_vertexData = std::malloc(m_allocated);
|
||||
m_vertexData = malloc(m_allocated);
|
||||
EnterCriticalSection(&Renderer::totalAllocCS);
|
||||
Renderer::totalAlloc += static_cast<int>(m_allocated);
|
||||
LeaveCriticalSection(&Renderer::totalAllocCS);
|
||||
@@ -20,11 +22,9 @@ Renderer::CommandBuffer::CommandBuffer(bool full)
|
||||
Renderer::CommandBuffer::~CommandBuffer()
|
||||
{
|
||||
if (m_vertexBuffer)
|
||||
{
|
||||
m_vertexBuffer->Release();
|
||||
}
|
||||
|
||||
std::free(m_vertexData);
|
||||
free(m_vertexData);
|
||||
|
||||
EnterCriticalSection(&Renderer::totalAllocCS);
|
||||
Renderer::totalAlloc -= static_cast<int>(m_allocated);
|
||||
@@ -38,7 +38,7 @@ void Renderer::CommandBuffer::EndRecording(ID3D11Device *device)
|
||||
if (m_vertexDataLength != 0)
|
||||
{
|
||||
D3D11_BUFFER_DESC desc = {};
|
||||
desc.ByteWidth = m_vertexDataLength;
|
||||
desc.ByteWidth = static_cast<UINT>(m_vertexDataLength);
|
||||
desc.Usage = D3D11_USAGE_IMMUTABLE;
|
||||
desc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
|
||||
|
||||
@@ -47,8 +47,8 @@ void Renderer::CommandBuffer::EndRecording(ID3D11Device *device)
|
||||
device->CreateBuffer(&desc, &data, &m_vertexBuffer);
|
||||
}
|
||||
|
||||
std::free(m_vertexData);
|
||||
m_vertexData = nullptr;
|
||||
free(m_vertexData);
|
||||
m_vertexData = NULL;
|
||||
}
|
||||
|
||||
std::uint64_t Renderer::CommandBuffer::GetAllocated()
|
||||
@@ -65,15 +65,17 @@ void Renderer::CommandBuffer::AddMatrix(const float *matrix)
|
||||
{
|
||||
Command command = {};
|
||||
command.m_command_type = COMMAND_ADD_MATRIX;
|
||||
std::memcpy(command.add_matrix.m_matrix, matrix, sizeof(command.add_matrix.m_matrix));
|
||||
memcpy(command.add_matrix.m_matrix, matrix, sizeof(command.add_matrix.m_matrix));
|
||||
m_commands.push_back(command);
|
||||
}
|
||||
|
||||
void Renderer::CommandBuffer::AddVertices(unsigned int stride, unsigned int count, void *dataIn, Renderer::Context &c)
|
||||
{
|
||||
PROFILER_SCOPE("Renderer::CommandBuffer::AddVertices", "AddVertices", MP_ORANGE)
|
||||
|
||||
if (c.matrixDirty[MATRIX_MODE_MODELVIEW_CBUFF])
|
||||
{
|
||||
this->AddMatrix(InternalRenderManager.MatrixGet(MATRIX_MODE_MODELVIEW_CBUFF));
|
||||
AddMatrix(InternalRenderManager.MatrixGet(MATRIX_MODE_MODELVIEW_CBUFF));
|
||||
c.matrixDirty[MATRIX_MODE_MODELVIEW_CBUFF] = false;
|
||||
}
|
||||
|
||||
@@ -92,7 +94,7 @@ void Renderer::CommandBuffer::AddVertices(unsigned int stride, unsigned int coun
|
||||
Renderer::totalAlloc -= static_cast<int>(m_allocated);
|
||||
LeaveCriticalSection(&Renderer::totalAllocCS);
|
||||
|
||||
m_allocated = ((m_vertexDataLength + (0x1000u - 1u)) & ~(0x1000u - 1u));
|
||||
m_allocated = ((m_vertexDataLength + (0x1000 - 1)) & ~(0x1000 - 1));
|
||||
m_vertexData = std::realloc(m_vertexData, m_allocated);
|
||||
|
||||
EnterCriticalSection(&Renderer::totalAllocCS);
|
||||
@@ -101,7 +103,7 @@ void Renderer::CommandBuffer::AddVertices(unsigned int stride, unsigned int coun
|
||||
}
|
||||
|
||||
const std::size_t byteCount = std::size_t(stride) * std::size_t(count);
|
||||
std::memcpy(static_cast<std::uint8_t *>(m_vertexData) + vertexOffset, dataIn, byteCount);
|
||||
memcpy(static_cast<std::uint8_t *>(m_vertexData) + vertexOffset, dataIn, byteCount);
|
||||
m_commands.push_back(command);
|
||||
}
|
||||
|
||||
@@ -243,36 +245,39 @@ void Renderer::CommandBuffer::SetFaceCull(bool enable)
|
||||
|
||||
void Renderer::CommandBuffer::Render(C4JRender::eVertexType vType, Renderer::Context &c, int primitiveType)
|
||||
{
|
||||
PROFILER_SCOPE("Renderer::CommandBuffer::Render", "Render", MP_ORANGE)
|
||||
|
||||
if (!m_vertexBuffer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int drawVertexType = vType;
|
||||
int shaderVertexType = drawVertexType;
|
||||
bool matrixOverride = false;
|
||||
|
||||
for (std::vector<Command>::const_iterator it = m_commands.begin(); it != m_commands.end(); ++it)
|
||||
for (const Command &command : m_commands)
|
||||
{
|
||||
const Command &command = *it;
|
||||
PROFILER_SCOPE("Renderer::CommandBuffer::Render", "ProcessCommand", MP_ORANGE)
|
||||
|
||||
switch (command.m_command_type)
|
||||
{
|
||||
case COMMAND_ADD_MATRIX:
|
||||
{
|
||||
if (drawVertexType == C4JRender::VERTEX_TYPE_COMPRESSED)
|
||||
{
|
||||
const float row[4] = {command.add_matrix.m_matrix[12], command.add_matrix.m_matrix[13], command.add_matrix.m_matrix[14],
|
||||
command.add_matrix.m_matrix[15]};
|
||||
const float row[4] = {
|
||||
command.add_matrix.m_matrix[12], command.add_matrix.m_matrix[13],
|
||||
command.add_matrix.m_matrix[14], command.add_matrix.m_matrix[15]
|
||||
};
|
||||
D3D11_MAPPED_SUBRESOURCE mappedAux0 = {};
|
||||
c.m_pDeviceContext->Map(c.m_compressedTranslationBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedAux0);
|
||||
std::memcpy(mappedAux0.pData, row, sizeof(row));
|
||||
memcpy(mappedAux0.pData, row, sizeof(row));
|
||||
c.m_pDeviceContext->Unmap(c.m_compressedTranslationBuffer, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
D3D11_MAPPED_SUBRESOURCE mappedMatrix1 = {};
|
||||
c.m_pDeviceContext->Map(c.m_localTransformMatrix, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedMatrix1);
|
||||
std::memcpy(mappedMatrix1.pData, command.add_matrix.m_matrix, sizeof(command.add_matrix.m_matrix));
|
||||
memcpy(mappedMatrix1.pData, command.add_matrix.m_matrix, sizeof(command.add_matrix.m_matrix));
|
||||
c.m_pDeviceContext->Unmap(c.m_localTransformMatrix, 0);
|
||||
matrixOverride = true;
|
||||
}
|
||||
@@ -300,7 +305,7 @@ void Renderer::CommandBuffer::Render(C4JRender::eVertexType vType, Renderer::Con
|
||||
|
||||
if (static_cast<DWORD>(drawVertexType) != InternalRenderManager.activeVertexType)
|
||||
{
|
||||
c.m_pDeviceContext->VSSetShader(InternalRenderManager.vertexShaderTable[shaderVertexType], nullptr, 0);
|
||||
c.m_pDeviceContext->VSSetShader(InternalRenderManager.vertexShaderTable[shaderVertexType], NULL, 0);
|
||||
c.m_pDeviceContext->IASetInputLayout(InternalRenderManager.inputLayoutTable[shaderVertexType]);
|
||||
InternalRenderManager.activeVertexType = drawVertexType;
|
||||
}
|
||||
@@ -310,12 +315,12 @@ void Renderer::CommandBuffer::Render(C4JRender::eVertexType vType, Renderer::Con
|
||||
bool drawIndexed = false;
|
||||
if (primitiveType == C4JRender::PRIMITIVE_TYPE_QUAD_LIST)
|
||||
{
|
||||
drawCount = (drawCount * 6u) / 4u;
|
||||
drawCount = (drawCount * 6) / 4;
|
||||
drawIndexed = true;
|
||||
}
|
||||
else if (primitiveType == C4JRender::PRIMITIVE_TYPE_TRIANGLE_FAN)
|
||||
{
|
||||
drawCount = (drawCount - 2u) * 3u;
|
||||
drawCount = (drawCount - 2) * 3;
|
||||
drawIndexed = true;
|
||||
}
|
||||
|
||||
@@ -325,13 +330,9 @@ void Renderer::CommandBuffer::Render(C4JRender::eVertexType vType, Renderer::Con
|
||||
c.m_pDeviceContext->IASetVertexBuffers(0, 1, &buffer, &stride, &offset);
|
||||
|
||||
if (drawIndexed)
|
||||
{
|
||||
c.m_pDeviceContext->DrawIndexed(drawCount, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
c.m_pDeviceContext->Draw(drawCount, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case COMMAND_BIND_TEXTURE:
|
||||
@@ -346,7 +347,7 @@ void Renderer::CommandBuffer::Render(C4JRender::eVertexType vType, Renderer::Con
|
||||
{
|
||||
D3D11_MAPPED_SUBRESOURCE mappedColour = {};
|
||||
c.m_pDeviceContext->Map(c.m_tintColorBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedColour);
|
||||
std::memcpy(mappedColour.pData, command.set_color.m_color, sizeof(command.set_color.m_color));
|
||||
memcpy(mappedColour.pData, command.set_color.m_color, sizeof(command.set_color.m_color));
|
||||
c.m_pDeviceContext->Unmap(c.m_tintColorBuffer, 0);
|
||||
break;
|
||||
}
|
||||
@@ -358,21 +359,21 @@ void Renderer::CommandBuffer::Render(C4JRender::eVertexType vType, Renderer::Con
|
||||
}
|
||||
case COMMAND_SET_DEPTH_MASK:
|
||||
{
|
||||
c.depthWriteEnabled = command.set_depth_mask.m_enable ? 1 : 0;
|
||||
c.depthWriteEnabled = command.set_depth_mask.m_enable;
|
||||
c.depthStencilDesc.DepthWriteMask = command.set_depth_mask.m_enable ? D3D11_DEPTH_WRITE_MASK_ALL : D3D11_DEPTH_WRITE_MASK_ZERO;
|
||||
c.m_pDeviceContext->OMSetDepthStencilState(InternalRenderManager.GetManagedDepthStencilState(), 0);
|
||||
break;
|
||||
}
|
||||
case COMMAND_SET_DEPTH_TEST:
|
||||
{
|
||||
c.depthTestEnabled = command.set_depth_test.m_enable ? 1 : 0;
|
||||
c.depthStencilDesc.DepthEnable = command.set_depth_test.m_enable ? TRUE : FALSE;
|
||||
c.depthTestEnabled = command.set_depth_test.m_enable;
|
||||
c.depthStencilDesc.DepthEnable = command.set_depth_test.m_enable;
|
||||
c.m_pDeviceContext->OMSetDepthStencilState(InternalRenderManager.GetManagedDepthStencilState(), 0);
|
||||
break;
|
||||
}
|
||||
case COMMAND_SET_LIGHTING_ENABLE:
|
||||
{
|
||||
c.lightingEnabled = command.set_lighting_enable.m_enable ? 1 : 0;
|
||||
c.lightingEnabled = command.set_lighting_enable.m_enable;
|
||||
break;
|
||||
}
|
||||
case COMMAND_SET_LIGHT_ENABLE:
|
||||
@@ -380,8 +381,8 @@ void Renderer::CommandBuffer::Render(C4JRender::eVertexType vType, Renderer::Con
|
||||
const int light = command.set_light_enable.m_light_index;
|
||||
if (light >= 0 && light < 2)
|
||||
{
|
||||
c.lightEnabled[light] = command.set_light_enable.m_enable ? 1 : 0;
|
||||
c.lightingDirty = 1;
|
||||
c.lightEnabled[light] = command.set_light_enable.m_enable;
|
||||
c.lightingDirty = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -394,7 +395,7 @@ void Renderer::CommandBuffer::Render(C4JRender::eVertexType vType, Renderer::Con
|
||||
c.lightDirection[light].y = command.set_light_direction.m_direction[1];
|
||||
c.lightDirection[light].z = command.set_light_direction.m_direction[2];
|
||||
c.lightDirection[light].w = command.set_light_direction.m_direction[3];
|
||||
c.lightingDirty = 1;
|
||||
c.lightingDirty = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -407,7 +408,7 @@ void Renderer::CommandBuffer::Render(C4JRender::eVertexType vType, Renderer::Con
|
||||
c.lightColour[light].y = command.set_light_colour.m_color[1];
|
||||
c.lightColour[light].z = command.set_light_colour.m_color[2];
|
||||
c.lightColour[light].w = 1.0f;
|
||||
c.lightingDirty = 1;
|
||||
c.lightingDirty = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -417,36 +418,36 @@ void Renderer::CommandBuffer::Render(C4JRender::eVertexType vType, Renderer::Con
|
||||
c.lightAmbientColour.y = command.set_light_ambient_colour.m_color[1];
|
||||
c.lightAmbientColour.z = command.set_light_ambient_colour.m_color[2];
|
||||
c.lightAmbientColour.w = 1.0f;
|
||||
c.lightingDirty = 1;
|
||||
c.lightingDirty = true;
|
||||
break;
|
||||
}
|
||||
case COMMAND_SET_BLEND_ENABLE:
|
||||
{
|
||||
c.blendDesc.RenderTarget[0].BlendEnable = command.set_blend_enable.m_enable ? TRUE : FALSE;
|
||||
c.blendDesc.RenderTarget[0].BlendEnable = command.set_blend_enable.m_enable;
|
||||
break;
|
||||
}
|
||||
case COMMAND_SET_BLEND_FUNC:
|
||||
{
|
||||
c.blendDesc.RenderTarget[0].SrcBlend = static_cast<D3D11_BLEND>(command.set_blend_func.m_src);
|
||||
c.blendDesc.RenderTarget[0].DestBlend = static_cast<D3D11_BLEND>(command.set_blend_func.m_dst);
|
||||
c.m_pDeviceContext->OMSetBlendState(InternalRenderManager.GetManagedBlendState(), c.blendFactor, 0xFFFFFFFFu);
|
||||
c.m_pDeviceContext->OMSetBlendState(InternalRenderManager.GetManagedBlendState(), c.blendFactor, 0xFFFFFFFF);
|
||||
break;
|
||||
}
|
||||
case COMMAND_SET_BLEND_FACTOR:
|
||||
{
|
||||
const unsigned int factor = command.set_blend_factor.m_blend_factor;
|
||||
c.blendFactor[0] = float((factor >> 0) & 0xFFu) / 255.0f;
|
||||
c.blendFactor[1] = float((factor >> 8) & 0xFFu) / 255.0f;
|
||||
c.blendFactor[2] = float((factor >> 16) & 0xFFu) / 255.0f;
|
||||
c.blendFactor[3] = float((factor >> 24) & 0xFFu) / 255.0f;
|
||||
c.m_pDeviceContext->OMSetBlendState(InternalRenderManager.GetManagedBlendState(), c.blendFactor, 0xFFFFFFFFu);
|
||||
c.blendFactor[0] = float((factor >> 0) & 0xFF) / 255.0f;
|
||||
c.blendFactor[1] = float((factor >> 8) & 0xFF) / 255.0f;
|
||||
c.blendFactor[2] = float((factor >> 16) & 0xFF) / 255.0f;
|
||||
c.blendFactor[3] = float((factor >> 24) & 0xFF) / 255.0f;
|
||||
c.m_pDeviceContext->OMSetBlendState(InternalRenderManager.GetManagedBlendState(), c.blendFactor, 0xFFFFFFFF);
|
||||
break;
|
||||
}
|
||||
case COMMAND_SET_FACE_CULL:
|
||||
{
|
||||
c.rasterizerDesc.CullMode = command.set_face_cull.m_enable ? D3D11_CULL_BACK : D3D11_CULL_NONE;
|
||||
c.m_pDeviceContext->RSSetState(InternalRenderManager.GetManagedRasterizerState());
|
||||
c.faceCullEnabled = command.set_face_cull.m_enable ? 1 : 0;
|
||||
c.faceCullEnabled = command.set_face_cull.m_enable;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -459,7 +460,7 @@ void Renderer::CommandBuffer::Render(C4JRender::eVertexType vType, Renderer::Con
|
||||
const DirectX::XMMATRIX identity = DirectX::XMMatrixIdentity();
|
||||
D3D11_MAPPED_SUBRESOURCE mappedIdentity = {};
|
||||
c.m_pDeviceContext->Map(c.m_localTransformMatrix, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedIdentity);
|
||||
std::memcpy(mappedIdentity.pData, &identity, sizeof(identity));
|
||||
memcpy(mappedIdentity.pData, &identity, sizeof(identity));
|
||||
c.m_pDeviceContext->Unmap(c.m_localTransformMatrix, 0);
|
||||
}
|
||||
}
|
||||
@@ -472,7 +473,7 @@ bool Renderer::CBuffCall(int index, bool full)
|
||||
const int commandIndex = m_commandHandleToIndex[index];
|
||||
if (commandIndex >= 0)
|
||||
{
|
||||
Renderer::Context &c = this->getContext();
|
||||
Renderer::Context &c = getContext();
|
||||
const std::uint8_t vertexType = m_commandVertexTypes[commandIndex];
|
||||
const std::uint8_t primitiveType = m_commandPrimitiveTypes[commandIndex];
|
||||
|
||||
@@ -482,7 +483,7 @@ bool Renderer::CBuffCall(int index, bool full)
|
||||
{
|
||||
D3D11_MAPPED_SUBRESOURCE mappedMatrix0 = {};
|
||||
c.m_pDeviceContext->Map(c.m_modelViewMatrix, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedMatrix0);
|
||||
std::memcpy(mappedMatrix0.pData, this->MatrixGet(MATRIX_MODE_MODELVIEW), sizeof(DirectX::XMMATRIX));
|
||||
memcpy(mappedMatrix0.pData, MatrixGet(MATRIX_MODE_MODELVIEW), sizeof(DirectX::XMMATRIX));
|
||||
c.m_pDeviceContext->Unmap(c.m_modelViewMatrix, 0);
|
||||
c.matrixDirty[MATRIX_MODE_MODELVIEW] = false;
|
||||
}
|
||||
@@ -491,7 +492,7 @@ bool Renderer::CBuffCall(int index, bool full)
|
||||
{
|
||||
D3D11_MAPPED_SUBRESOURCE mappedMatrix2 = {};
|
||||
c.m_pDeviceContext->Map(c.m_projectionMatrix, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedMatrix2);
|
||||
std::memcpy(mappedMatrix2.pData, this->MatrixGet(MATRIX_MODE_MODELVIEW_PROJECTION), sizeof(DirectX::XMMATRIX));
|
||||
memcpy(mappedMatrix2.pData, MatrixGet(MATRIX_MODE_MODELVIEW_PROJECTION), sizeof(DirectX::XMMATRIX));
|
||||
c.m_pDeviceContext->Unmap(c.m_projectionMatrix, 0);
|
||||
c.matrixDirty[MATRIX_MODE_MODELVIEW_PROJECTION] = false;
|
||||
}
|
||||
@@ -500,19 +501,19 @@ bool Renderer::CBuffCall(int index, bool full)
|
||||
{
|
||||
D3D11_MAPPED_SUBRESOURCE mappedMatrix3 = {};
|
||||
c.m_pDeviceContext->Map(c.m_textureMatrix, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedMatrix3);
|
||||
std::memcpy(mappedMatrix3.pData, this->MatrixGet(MATRIX_MODE_MODELVIEW_TEXTURE), sizeof(DirectX::XMMATRIX));
|
||||
memcpy(mappedMatrix3.pData, MatrixGet(MATRIX_MODE_MODELVIEW_TEXTURE), sizeof(DirectX::XMMATRIX));
|
||||
c.m_pDeviceContext->Unmap(c.m_textureMatrix, 0);
|
||||
c.matrixDirty[MATRIX_MODE_MODELVIEW_TEXTURE] = false;
|
||||
}
|
||||
|
||||
this->UpdateFogState();
|
||||
this->UpdateLightingState();
|
||||
this->UpdateViewportState();
|
||||
this->UpdateTexGenState();
|
||||
UpdateFogState();
|
||||
UpdateLightingState();
|
||||
UpdateViewportState();
|
||||
UpdateTexGenState();
|
||||
|
||||
if (vertexType != activeVertexType)
|
||||
{
|
||||
c.m_pDeviceContext->VSSetShader(vertexShaderTable[vertexType], nullptr, 0);
|
||||
c.m_pDeviceContext->VSSetShader(vertexShaderTable[vertexType], NULL, 0);
|
||||
c.m_pDeviceContext->IASetInputLayout(inputLayoutTable[vertexType]);
|
||||
activeVertexType = vertexType;
|
||||
}
|
||||
@@ -523,28 +524,24 @@ bool Renderer::CBuffCall(int index, bool full)
|
||||
const float forcedLod[4] = {static_cast<float>(static_cast<int>(c.forcedLOD)), 0.0f, 0.0f, 0.0f};
|
||||
D3D11_MAPPED_SUBRESOURCE mappedAux4 = {};
|
||||
c.m_pDeviceContext->Map(c.m_forcedLODBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedAux4);
|
||||
std::memcpy(mappedAux4.pData, forcedLod, sizeof(forcedLod));
|
||||
memcpy(mappedAux4.pData, forcedLod, sizeof(forcedLod));
|
||||
c.m_pDeviceContext->Unmap(c.m_forcedLODBuffer, 0);
|
||||
pixelType = C4JRender::PIXEL_SHADER_TYPE_FORCELOD;
|
||||
}
|
||||
|
||||
if (static_cast<DWORD>(pixelType) != activePixelType)
|
||||
{
|
||||
c.m_pDeviceContext->PSSetShader(pixelShaderTable[pixelType], nullptr, 0);
|
||||
c.m_pDeviceContext->PSSetShader(pixelShaderTable[pixelType], NULL, 0);
|
||||
activePixelType = pixelType;
|
||||
}
|
||||
|
||||
c.m_pDeviceContext->IASetPrimitiveTopology(m_Topologies[primitiveType]);
|
||||
c.m_pDeviceContext->IASetPrimitiveTopology(g_topologies[primitiveType]);
|
||||
|
||||
ID3D11Buffer *indexBuffer = nullptr;
|
||||
ID3D11Buffer *indexBuffer = NULL;
|
||||
if (primitiveType == C4JRender::PRIMITIVE_TYPE_QUAD_LIST)
|
||||
{
|
||||
indexBuffer = quadIndexBuffer;
|
||||
}
|
||||
else if (primitiveType == C4JRender::PRIMITIVE_TYPE_TRIANGLE_FAN)
|
||||
{
|
||||
indexBuffer = fanIndexBuffer;
|
||||
}
|
||||
|
||||
c.m_pDeviceContext->IASetIndexBuffer(indexBuffer, DXGI_FORMAT_R16_UINT, 0);
|
||||
}
|
||||
@@ -553,7 +550,7 @@ bool Renderer::CBuffCall(int index, bool full)
|
||||
|
||||
if (full)
|
||||
{
|
||||
this->MultWithStack(m_commandMatrices[commandIndex]);
|
||||
MultWithStack(m_commandMatrices[commandIndex]);
|
||||
c.matrixStacks[MATRIX_MODE_MODELVIEW_CBUFF][0] = DirectX::XMMatrixIdentity();
|
||||
c.matrixDirty[MATRIX_MODE_MODELVIEW_CBUFF] = true;
|
||||
}
|
||||
@@ -573,7 +570,7 @@ void Renderer::CBuffClear(int index)
|
||||
const int internalIndex = externalToInternal[index];
|
||||
if (internalIndex >= 0)
|
||||
{
|
||||
this->DeleteInternalBuffer(internalIndex);
|
||||
DeleteInternalBuffer(internalIndex);
|
||||
externalToInternal[index] = static_cast<std::int16_t>(-2);
|
||||
}
|
||||
|
||||
@@ -600,9 +597,7 @@ int Renderer::CBuffCreate(int count)
|
||||
}
|
||||
|
||||
if (cursor >= end)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
++first;
|
||||
++probe;
|
||||
@@ -618,14 +613,10 @@ int Renderer::CBuffCreate(int count)
|
||||
{
|
||||
const int allocationEnd = first + count;
|
||||
for (int i = first; i < allocationEnd; ++i)
|
||||
{
|
||||
m_commandHandleToIndex[i] = static_cast<std::int16_t>(-2);
|
||||
}
|
||||
|
||||
if (reservedRendererByte1)
|
||||
{
|
||||
reservedRendererDword1 = allocationEnd;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -639,28 +630,22 @@ int Renderer::CBuffCreate(int count)
|
||||
|
||||
void Renderer::CBuffDeferredModeEnd()
|
||||
{
|
||||
Renderer::Context &c = this->getContext();
|
||||
Renderer::Context &c = getContext();
|
||||
if (!c.deferredModeEnabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
EnterCriticalSection(&rtl_critical_section100);
|
||||
c.deferredModeEnabled = 0;
|
||||
c.deferredModeEnabled = false;
|
||||
|
||||
for (std::vector<Renderer::DeferredCBuff>::const_iterator it = c.deferredBuffers.begin(); it != c.deferredBuffers.end(); ++it)
|
||||
{
|
||||
const Renderer::DeferredCBuff &deferred = *it;
|
||||
const int existingIndex = m_commandHandleToIndex[deferred.m_vertex_index];
|
||||
if (existingIndex >= 0)
|
||||
{
|
||||
this->DeleteInternalBuffer(existingIndex);
|
||||
}
|
||||
DeleteInternalBuffer(existingIndex);
|
||||
|
||||
if (static_cast<int>(reservedRendererDword2 + reservedRendererDword3 + 10u) > MAX_COMMAND_BUFFERS)
|
||||
{
|
||||
if (static_cast<int>(reservedRendererDword2 + reservedRendererDword3 + 10) > MAX_COMMAND_BUFFERS)
|
||||
DebugBreak();
|
||||
}
|
||||
|
||||
const int internalSlot = reservedRendererDword2;
|
||||
++reservedRendererDword2;
|
||||
@@ -679,7 +664,7 @@ void Renderer::CBuffDeferredModeEnd()
|
||||
|
||||
void Renderer::CBuffDeferredModeStart()
|
||||
{
|
||||
this->getContext().deferredModeEnabled = 1;
|
||||
getContext().deferredModeEnabled = true;
|
||||
}
|
||||
|
||||
void Renderer::CBuffDelete(int first, int count)
|
||||
@@ -691,9 +676,7 @@ void Renderer::CBuffDelete(int first, int count)
|
||||
{
|
||||
const int internalIndex = m_commandHandleToIndex[i];
|
||||
if (internalIndex >= 0)
|
||||
{
|
||||
this->DeleteInternalBuffer(internalIndex);
|
||||
}
|
||||
DeleteInternalBuffer(internalIndex);
|
||||
|
||||
m_commandHandleToIndex[i] = static_cast<std::int16_t>(-1);
|
||||
}
|
||||
@@ -703,7 +686,7 @@ void Renderer::CBuffDelete(int first, int count)
|
||||
|
||||
void Renderer::CBuffEnd()
|
||||
{
|
||||
Renderer::Context &c = this->getContext();
|
||||
Renderer::Context &c = getContext();
|
||||
|
||||
assert(c.stackType == MATRIX_MODE_MODELVIEW_CBUFF);
|
||||
assert(c.stackPos[MATRIX_MODE_MODELVIEW_CBUFF] == 0);
|
||||
@@ -724,14 +707,10 @@ void Renderer::CBuffEnd()
|
||||
{
|
||||
const int existingIndex = m_commandHandleToIndex[c.recordingBufferIndex];
|
||||
if (existingIndex >= 0)
|
||||
{
|
||||
this->DeleteInternalBuffer(existingIndex);
|
||||
}
|
||||
DeleteInternalBuffer(existingIndex);
|
||||
|
||||
if (static_cast<int>(reservedRendererDword2 + reservedRendererDword3 + 10u) > MAX_COMMAND_BUFFERS)
|
||||
{
|
||||
if (static_cast<int>(reservedRendererDword2 + reservedRendererDword3 + 10) > MAX_COMMAND_BUFFERS)
|
||||
DebugBreak();
|
||||
}
|
||||
|
||||
const int internalSlot = reservedRendererDword2;
|
||||
++reservedRendererDword2;
|
||||
@@ -746,7 +725,7 @@ void Renderer::CBuffEnd()
|
||||
|
||||
c.stackType = MATRIX_MODE_MODELVIEW;
|
||||
c.commandBuffer->EndRecording(m_pDevice);
|
||||
c.commandBuffer = nullptr;
|
||||
c.commandBuffer = NULL;
|
||||
|
||||
LeaveCriticalSection(&rtl_critical_section100);
|
||||
}
|
||||
@@ -759,24 +738,20 @@ void Renderer::CBuffLockStaticCreations()
|
||||
int Renderer::CBuffSize(int index)
|
||||
{
|
||||
if (index == -1)
|
||||
{
|
||||
return totalAlloc < 0 ? 0 : totalAlloc;
|
||||
}
|
||||
|
||||
unsigned int size = 0;
|
||||
EnterCriticalSection(&rtl_critical_section100);
|
||||
const int commandIndex = m_commandHandleToIndex[index];
|
||||
if (commandIndex >= 0)
|
||||
{
|
||||
size = m_commandBuffers[commandIndex]->GetAllocated();
|
||||
}
|
||||
size = static_cast<unsigned int>(m_commandBuffers[commandIndex]->GetAllocated());
|
||||
LeaveCriticalSection(&rtl_critical_section100);
|
||||
return size;
|
||||
}
|
||||
|
||||
void Renderer::CBuffStart(int index, bool full)
|
||||
{
|
||||
Renderer::Context &c = this->getContext();
|
||||
Renderer::Context &c = getContext();
|
||||
c.commandBuffer = new (std::nothrow) Renderer::CommandBuffer(full);
|
||||
c.recordingBufferIndex = index;
|
||||
|
||||
@@ -797,10 +772,8 @@ void Renderer::CBuffTick()
|
||||
{
|
||||
Renderer::CommandBuffer *buffer = m_commandBuffers[i];
|
||||
if (buffer)
|
||||
{
|
||||
delete buffer;
|
||||
}
|
||||
m_commandBuffers[i] = nullptr;
|
||||
m_commandBuffers[i] = NULL;
|
||||
}
|
||||
|
||||
reservedRendererDword3 = 0;
|
||||
@@ -832,4 +805,4 @@ void Renderer::DeleteInternalBuffer(int index)
|
||||
}
|
||||
|
||||
LeaveCriticalSection(&rtl_critical_section100);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,18 +1,18 @@
|
||||
#pragma once
|
||||
#include "stdafx.h"
|
||||
#include "Renderer.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
const float *Renderer::MatrixGet(int type)
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
Context &c = getContext();
|
||||
const int depth = c.stackPos[type];
|
||||
return reinterpret_cast<const float *>(&c.matrixStacks[type][depth]);
|
||||
}
|
||||
|
||||
void Renderer::MatrixMode(int type)
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
Context &c = getContext();
|
||||
assert(type >= 0);
|
||||
assert(type < STACK_TYPES);
|
||||
c.stackType = type;
|
||||
@@ -22,25 +22,25 @@ void Renderer::MatrixMult(float *mat)
|
||||
{
|
||||
DirectX::XMMATRIX matrix;
|
||||
std::memcpy(&matrix, mat, sizeof(matrix));
|
||||
this->MultWithStack(matrix);
|
||||
MultWithStack(matrix);
|
||||
}
|
||||
|
||||
void Renderer::MatrixOrthogonal(float left, float right, float bottom, float top, float zNear, float zFar)
|
||||
{
|
||||
const DirectX::XMMATRIX matrix = DirectX::XMMatrixOrthographicOffCenterRH(left, right, bottom, top, zNear, zFar);
|
||||
this->MultWithStack(matrix);
|
||||
MultWithStack(matrix);
|
||||
}
|
||||
|
||||
void Renderer::MatrixPerspective(float fovy, float aspect, float zNear, float zFar)
|
||||
{
|
||||
const float fovRadians = fovy * (3.14159274f / 180.0f);
|
||||
const DirectX::XMMATRIX matrix = DirectX::XMMatrixPerspectiveFovRH(fovRadians, aspect, zNear, zFar);
|
||||
this->MultWithStack(matrix);
|
||||
MultWithStack(matrix);
|
||||
}
|
||||
|
||||
void Renderer::MatrixPop()
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
Context &c = getContext();
|
||||
|
||||
assert(c.stackPos[c.stackType] > 0);
|
||||
|
||||
@@ -51,7 +51,7 @@ void Renderer::MatrixPop()
|
||||
|
||||
void Renderer::MatrixPush()
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
Context &c = getContext();
|
||||
|
||||
assert(c.stackPos[c.stackType] < (STACK_SIZE - 1));
|
||||
|
||||
@@ -65,18 +65,18 @@ void Renderer::MatrixRotate(float angle, float x, float y, float z)
|
||||
{
|
||||
const DirectX::XMVECTOR axis = DirectX::XMVectorSet(x, y, z, 0.0f);
|
||||
const DirectX::XMMATRIX matrix = DirectX::XMMatrixRotationAxis(axis, angle);
|
||||
this->MultWithStack(matrix);
|
||||
MultWithStack(matrix);
|
||||
}
|
||||
|
||||
void Renderer::MatrixScale(float x, float y, float z)
|
||||
{
|
||||
const DirectX::XMMATRIX matrix = DirectX::XMMatrixScaling(x, y, z);
|
||||
this->MultWithStack(matrix);
|
||||
MultWithStack(matrix);
|
||||
}
|
||||
|
||||
void Renderer::MatrixSetIdentity()
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
Context &c = getContext();
|
||||
const int mode = c.stackType;
|
||||
const int depth = c.stackPos[mode];
|
||||
c.matrixStacks[mode][depth] = DirectX::XMMatrixIdentity();
|
||||
@@ -86,12 +86,12 @@ void Renderer::MatrixSetIdentity()
|
||||
void Renderer::MatrixTranslate(float x, float y, float z)
|
||||
{
|
||||
const DirectX::XMMATRIX matrix = DirectX::XMMatrixTranslation(x, y, z);
|
||||
this->MultWithStack(matrix);
|
||||
MultWithStack(matrix);
|
||||
}
|
||||
|
||||
void Renderer::MultWithStack(DirectX::XMMATRIX matrix)
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
Context &c = getContext();
|
||||
const int mode = c.stackType;
|
||||
const int depth = c.stackPos[mode];
|
||||
DirectX::XMMATRIX ¤t = c.matrixStacks[mode][depth];
|
||||
@@ -101,7 +101,7 @@ void Renderer::MultWithStack(DirectX::XMMATRIX matrix)
|
||||
|
||||
void Renderer::Set_matrixDirty()
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
Context &c = getContext();
|
||||
const DirectX::XMMATRIX identity = DirectX::XMMatrixIdentity();
|
||||
|
||||
c.matrixStacks[MATRIX_MODE_MODELVIEW][0] = identity;
|
||||
@@ -114,6 +114,6 @@ void Renderer::Set_matrixDirty()
|
||||
c.matrixDirty[MATRIX_MODE_MODELVIEW_TEXTURE] = true;
|
||||
c.matrixDirty[MATRIX_MODE_MODELVIEW_CBUFF] = true;
|
||||
|
||||
activeVertexType = 0xFFFFFFFFu;
|
||||
activePixelType = 0xFFFFFFFFu;
|
||||
activeVertexType = -1;
|
||||
activePixelType = -1;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#pragma once
|
||||
#include "stdafx.h"
|
||||
#include "Renderer.h"
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstring>
|
||||
#include <limits>
|
||||
|
||||
ID3D11BlendState *Renderer::GetManagedBlendState()
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
PROFILER_SCOPE("Renderer::GetManagedBlendState", "GetManagedBlendState", MP_ORCHID1)
|
||||
Context &c = getContext();
|
||||
const D3D11_RENDER_TARGET_BLEND_DESC &rtBlend = c.blendDesc.RenderTarget[0];
|
||||
|
||||
const int key = (rtBlend.BlendEnable ? 1 : 0) | ((static_cast<int>(rtBlend.SrcBlend) & 0x1F) << 1) |
|
||||
@@ -15,11 +15,9 @@ ID3D11BlendState *Renderer::GetManagedBlendState()
|
||||
|
||||
auto it = managedBlendStates.find(key);
|
||||
if (it != managedBlendStates.end())
|
||||
{
|
||||
return it->second;
|
||||
}
|
||||
|
||||
ID3D11BlendState *state = nullptr;
|
||||
ID3D11BlendState *state = NULL;
|
||||
m_pDevice->CreateBlendState(&c.blendDesc, &state);
|
||||
managedBlendStates.emplace(key, state);
|
||||
return state;
|
||||
@@ -27,18 +25,17 @@ ID3D11BlendState *Renderer::GetManagedBlendState()
|
||||
|
||||
ID3D11DepthStencilState *Renderer::GetManagedDepthStencilState()
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
PROFILER_SCOPE("Renderer::GetManagedBlendState", "GetManagedDepthStencilState", MP_ORCHID1)
|
||||
Context &c = getContext();
|
||||
|
||||
const int key = (c.depthStencilDesc.DepthEnable ? 2 : 0) | ((static_cast<int>(c.depthStencilDesc.DepthFunc) & 0x0F) << 2) |
|
||||
(c.depthStencilDesc.DepthWriteMask == D3D11_DEPTH_WRITE_MASK_ALL ? 1 : 0);
|
||||
|
||||
auto it = managedDepthStencilStates.find(key);
|
||||
if (it != managedDepthStencilStates.end())
|
||||
{
|
||||
return it->second;
|
||||
}
|
||||
|
||||
ID3D11DepthStencilState *state = nullptr;
|
||||
ID3D11DepthStencilState *state = NULL;
|
||||
m_pDevice->CreateDepthStencilState(&c.depthStencilDesc, &state);
|
||||
managedDepthStencilStates.emplace(key, state);
|
||||
return state;
|
||||
@@ -46,7 +43,8 @@ ID3D11DepthStencilState *Renderer::GetManagedDepthStencilState()
|
||||
|
||||
ID3D11RasterizerState *Renderer::GetManagedRasterizerState()
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
PROFILER_SCOPE("Renderer::GetManagedRasterizerState", "GetManagedRasterizerState", MP_ORCHID1)
|
||||
Context &c = getContext();
|
||||
|
||||
const int key = (static_cast<std::uint8_t>(c.rasterizerDesc.DepthBias)) |
|
||||
(static_cast<std::uint8_t>(static_cast<int>(c.rasterizerDesc.SlopeScaledDepthBias)) << 8) |
|
||||
@@ -54,11 +52,9 @@ ID3D11RasterizerState *Renderer::GetManagedRasterizerState()
|
||||
|
||||
auto it = managedRasterizerStates.find(key);
|
||||
if (it != managedRasterizerStates.end())
|
||||
{
|
||||
return it->second;
|
||||
}
|
||||
|
||||
ID3D11RasterizerState *state = nullptr;
|
||||
ID3D11RasterizerState *state = NULL;
|
||||
m_pDevice->CreateRasterizerState(&c.rasterizerDesc, &state);
|
||||
managedRasterizerStates.emplace(key, state);
|
||||
return state;
|
||||
@@ -66,14 +62,13 @@ ID3D11RasterizerState *Renderer::GetManagedRasterizerState()
|
||||
|
||||
ID3D11SamplerState *Renderer::GetManagedSamplerState()
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
PROFILER_SCOPE("Renderer::GetManagedSamplerState", "GetManagedSamplerState", MP_ORCHID1)
|
||||
Context &c = getContext();
|
||||
const int key = m_textures[c.textureIdx].samplerParams;
|
||||
|
||||
auto it = managedSamplerStates.find(key);
|
||||
if (it != managedSamplerStates.end())
|
||||
{
|
||||
return it->second;
|
||||
}
|
||||
|
||||
const bool clampU = (key & 0x01) != 0;
|
||||
const bool clampV = (key & 0x02) != 0;
|
||||
@@ -96,7 +91,7 @@ ID3D11SamplerState *Renderer::GetManagedSamplerState()
|
||||
desc.MinLOD = -(std::numeric_limits<float>::max)();
|
||||
desc.MaxLOD = (std::numeric_limits<float>::max)();
|
||||
|
||||
ID3D11SamplerState *state = nullptr;
|
||||
ID3D11SamplerState *state = NULL;
|
||||
m_pDevice->CreateSamplerState(&desc, &state);
|
||||
managedSamplerStates.emplace(key, state);
|
||||
return state;
|
||||
@@ -104,37 +99,37 @@ ID3D11SamplerState *Renderer::GetManagedSamplerState()
|
||||
|
||||
void Renderer::StateSetFogEnable(bool enable)
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
c.fogEnabled = enable ? 1 : 0;
|
||||
Context &c = getContext();
|
||||
c.fogEnabled = enable;
|
||||
}
|
||||
|
||||
void Renderer::StateSetFogMode(int mode)
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
Context &c = getContext();
|
||||
c.fogMode = mode;
|
||||
}
|
||||
|
||||
void Renderer::StateSetFogNearDistance(float dist)
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
Context &c = getContext();
|
||||
c.fogNearDistance = dist;
|
||||
}
|
||||
|
||||
void Renderer::StateSetFogFarDistance(float dist)
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
Context &c = getContext();
|
||||
c.fogFarDistance = dist;
|
||||
}
|
||||
|
||||
void Renderer::StateSetFogDensity(float density)
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
Context &c = getContext();
|
||||
c.fogDensity = density;
|
||||
}
|
||||
|
||||
void Renderer::StateSetFogColour(float red, float green, float blue)
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
Context &c = getContext();
|
||||
c.fogColourRed = red;
|
||||
c.fogColourBlue = blue;
|
||||
c.fogColourGreen = green;
|
||||
@@ -144,25 +139,23 @@ void Renderer::UpdateViewportState() {}
|
||||
|
||||
void Renderer::StateSetLightingEnable(bool enable)
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
if (c.commandBuffer != nullptr && c.commandBuffer->isActive != 0)
|
||||
Context &c = getContext();
|
||||
if (c.commandBuffer != NULL && c.commandBuffer->isActive != 0)
|
||||
{
|
||||
c.commandBuffer->SetLightingEnable(enable);
|
||||
return;
|
||||
}
|
||||
|
||||
c.lightingEnabled = enable ? 1 : 0;
|
||||
c.lightingEnabled = enable;
|
||||
}
|
||||
|
||||
void Renderer::StateSetLightColour(int light, float red, float green, float blue)
|
||||
{
|
||||
if (light >= 2)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Context &c = this->getContext();
|
||||
if (c.commandBuffer != nullptr && c.commandBuffer->isActive != 0)
|
||||
Context &c = getContext();
|
||||
if (c.commandBuffer != NULL && c.commandBuffer->isActive != 0)
|
||||
{
|
||||
c.commandBuffer->SetLightColour(light, red, green, blue);
|
||||
return;
|
||||
@@ -172,13 +165,13 @@ void Renderer::StateSetLightColour(int light, float red, float green, float blue
|
||||
c.lightColour[light].y = green;
|
||||
c.lightColour[light].z = blue;
|
||||
c.lightColour[light].w = 1.0f;
|
||||
c.lightingDirty = 1;
|
||||
c.lightingDirty = true;
|
||||
}
|
||||
|
||||
void Renderer::StateSetLightAmbientColour(float red, float green, float blue)
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
if (c.commandBuffer != nullptr && c.commandBuffer->isActive != 0)
|
||||
Context &c = getContext();
|
||||
if (c.commandBuffer != NULL && c.commandBuffer->isActive != 0)
|
||||
{
|
||||
c.commandBuffer->SetLightAmbientColour(red, green, blue);
|
||||
return;
|
||||
@@ -188,31 +181,29 @@ void Renderer::StateSetLightAmbientColour(float red, float green, float blue)
|
||||
c.lightAmbientColour.y = green;
|
||||
c.lightAmbientColour.z = blue;
|
||||
c.lightAmbientColour.w = 1.0f;
|
||||
c.lightingDirty = 1;
|
||||
c.lightingDirty = true;
|
||||
}
|
||||
|
||||
void Renderer::StateSetLightEnable(int light, bool enable)
|
||||
{
|
||||
if (light >= 2)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Context &c = this->getContext();
|
||||
if (c.commandBuffer != nullptr && c.commandBuffer->isActive != 0)
|
||||
Context &c = getContext();
|
||||
if (c.commandBuffer != NULL && c.commandBuffer->isActive != 0)
|
||||
{
|
||||
c.commandBuffer->SetLightEnable(light, enable);
|
||||
return;
|
||||
}
|
||||
|
||||
c.lightEnabled[light] = enable ? 1 : 0;
|
||||
c.lightingDirty = 1;
|
||||
c.lightEnabled[light] = enable;
|
||||
c.lightingDirty = true;
|
||||
}
|
||||
|
||||
void Renderer::StateSetColour(float r, float g, float b, float a)
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
if (c.commandBuffer != nullptr && c.commandBuffer->isActive != 0)
|
||||
Context &c = getContext();
|
||||
if (c.commandBuffer != NULL && c.commandBuffer->isActive != 0)
|
||||
{
|
||||
c.commandBuffer->SetColor(r, g, b, a);
|
||||
return;
|
||||
@@ -229,35 +220,35 @@ void Renderer::StateSetColour(float r, float g, float b, float a)
|
||||
|
||||
void Renderer::StateSetDepthMask(bool enable)
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
if (c.commandBuffer != nullptr && c.commandBuffer->isActive != 0)
|
||||
Context &c = getContext();
|
||||
if (c.commandBuffer != NULL && c.commandBuffer->isActive != 0)
|
||||
{
|
||||
c.commandBuffer->SetDepthMask(enable);
|
||||
return;
|
||||
}
|
||||
|
||||
c.depthStencilDesc.DepthWriteMask = enable ? D3D11_DEPTH_WRITE_MASK_ALL : D3D11_DEPTH_WRITE_MASK_ZERO;
|
||||
c.m_pDeviceContext->OMSetDepthStencilState(this->GetManagedDepthStencilState(), 0);
|
||||
c.depthWriteEnabled = enable ? 1 : 0;
|
||||
c.m_pDeviceContext->OMSetDepthStencilState(GetManagedDepthStencilState(), 0);
|
||||
c.depthWriteEnabled = enable;
|
||||
}
|
||||
|
||||
void Renderer::StateSetBlendEnable(bool enable)
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
if (c.commandBuffer != nullptr && c.commandBuffer->isActive != 0)
|
||||
Context &c = getContext();
|
||||
if (c.commandBuffer != NULL && c.commandBuffer->isActive != 0)
|
||||
{
|
||||
c.commandBuffer->SetBlendEnable(enable);
|
||||
return;
|
||||
}
|
||||
|
||||
c.blendDesc.RenderTarget[0].BlendEnable = enable ? TRUE : FALSE;
|
||||
c.m_pDeviceContext->OMSetBlendState(this->GetManagedBlendState(), c.blendFactor, 0xFFFFFFFFu);
|
||||
c.blendDesc.RenderTarget[0].BlendEnable = enable;
|
||||
c.m_pDeviceContext->OMSetBlendState(GetManagedBlendState(), c.blendFactor, 0xFFFFFFFF);
|
||||
}
|
||||
|
||||
void Renderer::StateSetBlendFunc(int src, int dst)
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
if (c.commandBuffer != nullptr && c.commandBuffer->isActive != 0)
|
||||
Context &c = getContext();
|
||||
if (c.commandBuffer != NULL && c.commandBuffer->isActive != 0)
|
||||
{
|
||||
c.commandBuffer->SetBlendFunc(src, dst);
|
||||
return;
|
||||
@@ -265,29 +256,29 @@ void Renderer::StateSetBlendFunc(int src, int dst)
|
||||
|
||||
c.blendDesc.RenderTarget[0].SrcBlend = static_cast<D3D11_BLEND>(src);
|
||||
c.blendDesc.RenderTarget[0].DestBlend = static_cast<D3D11_BLEND>(dst);
|
||||
c.m_pDeviceContext->OMSetBlendState(this->GetManagedBlendState(), c.blendFactor, 0xFFFFFFFFu);
|
||||
c.m_pDeviceContext->OMSetBlendState(GetManagedBlendState(), c.blendFactor, 0xFFFFFFFF);
|
||||
}
|
||||
|
||||
void Renderer::StateSetBlendFactor(unsigned int colour)
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
if (c.commandBuffer != nullptr && c.commandBuffer->isActive != 0)
|
||||
Context &c = getContext();
|
||||
if (c.commandBuffer != NULL && c.commandBuffer->isActive != 0)
|
||||
{
|
||||
c.commandBuffer->SetBlendFactor(colour);
|
||||
return;
|
||||
}
|
||||
|
||||
const float scale = 255.0f;
|
||||
c.blendFactor[0] = static_cast<float>((colour >> 0) & 0xFFu) / scale;
|
||||
c.blendFactor[1] = static_cast<float>((colour >> 8) & 0xFFu) / scale;
|
||||
c.blendFactor[2] = static_cast<float>((colour >> 16) & 0xFFu) / scale;
|
||||
c.blendFactor[3] = static_cast<float>((colour >> 24) & 0xFFu) / scale;
|
||||
c.m_pDeviceContext->OMSetBlendState(this->GetManagedBlendState(), c.blendFactor, 0xFFFFFFFFu);
|
||||
c.blendFactor[0] = static_cast<float>((colour >> 0) & 0xFF) / scale;
|
||||
c.blendFactor[1] = static_cast<float>((colour >> 8) & 0xFF) / scale;
|
||||
c.blendFactor[2] = static_cast<float>((colour >> 16) & 0xFF) / scale;
|
||||
c.blendFactor[3] = static_cast<float>((colour >> 24) & 0xFF) / scale;
|
||||
c.m_pDeviceContext->OMSetBlendState(GetManagedBlendState(), c.blendFactor, 0xFFFFFFFF);
|
||||
}
|
||||
|
||||
void Renderer::StateSetAlphaFunc(int, float param)
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
Context &c = getContext();
|
||||
c.alphaReference = param;
|
||||
|
||||
const float alpha[4] = {0.0f, 0.0f, 0.0f, c.alphaTestEnabled ? c.alphaReference : 0.0f};
|
||||
@@ -299,51 +290,47 @@ void Renderer::StateSetAlphaFunc(int, float param)
|
||||
|
||||
void Renderer::StateSetDepthFunc(int func)
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
if (c.commandBuffer != nullptr && c.commandBuffer->isActive != 0)
|
||||
Context &c = getContext();
|
||||
if (c.commandBuffer != NULL && c.commandBuffer->isActive != 0)
|
||||
{
|
||||
c.commandBuffer->SetDepthFunc(func);
|
||||
return;
|
||||
}
|
||||
|
||||
c.depthStencilDesc.DepthFunc = static_cast<D3D11_COMPARISON_FUNC>(func);
|
||||
c.m_pDeviceContext->OMSetDepthStencilState(this->GetManagedDepthStencilState(), 0);
|
||||
c.m_pDeviceContext->OMSetDepthStencilState(GetManagedDepthStencilState(), 0);
|
||||
}
|
||||
|
||||
void Renderer::StateSetFaceCull(bool enable)
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
if (c.commandBuffer != nullptr && c.commandBuffer->isActive != 0)
|
||||
Context &c = getContext();
|
||||
if (c.commandBuffer != NULL && c.commandBuffer->isActive != 0)
|
||||
{
|
||||
c.commandBuffer->SetFaceCull(enable);
|
||||
return;
|
||||
}
|
||||
|
||||
c.rasterizerDesc.CullMode = enable ? D3D11_CULL_BACK : D3D11_CULL_NONE;
|
||||
c.m_pDeviceContext->RSSetState(this->GetManagedRasterizerState());
|
||||
c.faceCullEnabled = enable ? 1 : 0;
|
||||
c.m_pDeviceContext->RSSetState(GetManagedRasterizerState());
|
||||
c.faceCullEnabled = enable;
|
||||
}
|
||||
|
||||
void Renderer::StateSetFaceCullCW(bool enable)
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
Context &c = getContext();
|
||||
if (c.faceCullEnabled)
|
||||
{
|
||||
c.rasterizerDesc.CullMode = enable ? D3D11_CULL_BACK : D3D11_CULL_FRONT;
|
||||
}
|
||||
else
|
||||
{
|
||||
c.rasterizerDesc.CullMode = D3D11_CULL_NONE;
|
||||
}
|
||||
|
||||
c.m_pDeviceContext->RSSetState(this->GetManagedRasterizerState());
|
||||
c.m_pDeviceContext->RSSetState(GetManagedRasterizerState());
|
||||
}
|
||||
|
||||
void Renderer::StateSetLineWidth(float) {}
|
||||
|
||||
void Renderer::StateSetWriteEnable(bool red, bool green, bool blue, bool alpha)
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
Context &c = getContext();
|
||||
|
||||
std::uint8_t mask = 0;
|
||||
mask |= red ? 0x1 : 0;
|
||||
@@ -352,27 +339,27 @@ void Renderer::StateSetWriteEnable(bool red, bool green, bool blue, bool alpha)
|
||||
mask |= alpha ? 0x8 : 0;
|
||||
|
||||
c.blendDesc.RenderTarget[0].RenderTargetWriteMask = mask;
|
||||
c.m_pDeviceContext->OMSetBlendState(this->GetManagedBlendState(), c.blendFactor, 0xFFFFFFFFu);
|
||||
c.m_pDeviceContext->OMSetBlendState(GetManagedBlendState(), c.blendFactor, 0xFFFFFFFF);
|
||||
}
|
||||
|
||||
void Renderer::StateSetDepthTestEnable(bool enable)
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
if (c.commandBuffer != nullptr && c.commandBuffer->isActive != 0)
|
||||
Context &c = getContext();
|
||||
if (c.commandBuffer != NULL && c.commandBuffer->isActive != 0)
|
||||
{
|
||||
c.commandBuffer->SetDepthTestEnable(enable);
|
||||
return;
|
||||
}
|
||||
|
||||
c.depthStencilDesc.DepthEnable = enable ? TRUE : FALSE;
|
||||
c.m_pDeviceContext->OMSetDepthStencilState(this->GetManagedDepthStencilState(), 0);
|
||||
c.depthTestEnabled = enable ? 1 : 0;
|
||||
c.depthStencilDesc.DepthEnable = enable;
|
||||
c.m_pDeviceContext->OMSetDepthStencilState(GetManagedDepthStencilState(), 0);
|
||||
c.depthTestEnabled = enable;
|
||||
}
|
||||
|
||||
void Renderer::StateSetAlphaTestEnable(bool enable)
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
c.alphaTestEnabled = enable ? 1 : 0;
|
||||
Context &c = getContext();
|
||||
c.alphaTestEnabled = enable;
|
||||
|
||||
const float alpha[4] = {0.0f, 0.0f, 0.0f, enable ? c.alphaReference : 0.0f};
|
||||
D3D11_MAPPED_SUBRESOURCE mapped = {};
|
||||
@@ -383,17 +370,18 @@ void Renderer::StateSetAlphaTestEnable(bool enable)
|
||||
|
||||
void Renderer::StateSetDepthSlopeAndBias(float slope, float bias)
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
Context &c = getContext();
|
||||
|
||||
const float scale = 65536.0f;
|
||||
c.rasterizerDesc.DepthBias = static_cast<int>(bias * scale);
|
||||
c.rasterizerDesc.SlopeScaledDepthBias = slope * scale;
|
||||
c.m_pDeviceContext->RSSetState(this->GetManagedRasterizerState());
|
||||
c.m_pDeviceContext->RSSetState(GetManagedRasterizerState());
|
||||
}
|
||||
|
||||
void Renderer::UpdateFogState()
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
PROFILER_SCOPE("Renderer::UpdateFogState", "UpdateFogState", MP_ORCHID1)
|
||||
Context &c = getContext();
|
||||
ID3D11DeviceContext *d3d11 = c.m_pDeviceContext;
|
||||
|
||||
float fogParams[4] = {};
|
||||
@@ -426,7 +414,7 @@ void Renderer::UpdateFogState()
|
||||
|
||||
void Renderer::StateSetVertexTextureUV(float u, float v)
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
Context &c = getContext();
|
||||
const float texgen[4] = {u - 1.0f, v - 1.0f, 0.0f, 0.0f};
|
||||
|
||||
D3D11_MAPPED_SUBRESOURCE mapped = {};
|
||||
@@ -437,7 +425,8 @@ void Renderer::StateSetVertexTextureUV(float u, float v)
|
||||
|
||||
void Renderer::UpdateTexGenState()
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
PROFILER_SCOPE("Renderer::UpdateTexGenState", "UpdateTexGenState", MP_ORCHID1)
|
||||
Context &c = getContext();
|
||||
|
||||
D3D11_MAPPED_SUBRESOURCE mapped = {};
|
||||
c.m_pDeviceContext->Map(c.m_texGenMatricesBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mapped);
|
||||
@@ -447,7 +436,8 @@ void Renderer::UpdateTexGenState()
|
||||
|
||||
void Renderer::UpdateLightingState()
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
PROFILER_SCOPE("Renderer::UpdateLightingState", "UpdateLightingState", MP_ORCHID1)
|
||||
Context &c = getContext();
|
||||
if (!c.lightingDirty || !c.lightingEnabled)
|
||||
{
|
||||
return;
|
||||
@@ -471,18 +461,16 @@ void Renderer::UpdateLightingState()
|
||||
std::memcpy(mapped.pData, c.lightDirection, lightingBytes);
|
||||
c.m_pDeviceContext->Unmap(c.m_lightingStateBuffer, 0);
|
||||
|
||||
c.lightingDirty = 0;
|
||||
c.lightingDirty = false;
|
||||
}
|
||||
|
||||
void Renderer::StateSetLightDirection(int light, float x, float y, float z)
|
||||
{
|
||||
if (light >= 2)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Context &c = this->getContext();
|
||||
if (c.commandBuffer != nullptr && c.commandBuffer->isActive != 0)
|
||||
Context &c = getContext();
|
||||
if (c.commandBuffer != NULL && c.commandBuffer->isActive != 0)
|
||||
{
|
||||
c.commandBuffer->SetLightDirection(light, x, y, z);
|
||||
return;
|
||||
@@ -495,12 +483,12 @@ void Renderer::StateSetLightDirection(int light, float x, float y, float z)
|
||||
const DirectX::XMVECTOR normalized = DirectX::XMVector3Normalize(transformed);
|
||||
|
||||
DirectX::XMStoreFloat4(&c.lightDirection[light], normalized);
|
||||
c.lightingDirty = 1;
|
||||
c.lightingDirty = true;
|
||||
}
|
||||
|
||||
void Renderer::StateSetViewport(C4JRender::eViewportType viewportType)
|
||||
{
|
||||
this->getContext();
|
||||
getContext();
|
||||
m_ViewportType = viewportType;
|
||||
|
||||
const float fullWidth = static_cast<float>(backBufferWidth);
|
||||
@@ -569,14 +557,14 @@ void Renderer::StateSetEnableViewportClipPlanes(bool) {}
|
||||
|
||||
void Renderer::StateSetTexGenCol(int col, float x, float y, float z, float w, bool eyeSpace)
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
Context &c = getContext();
|
||||
|
||||
DirectX::XMVECTOR plane = DirectX::XMVectorSet(x, y, z, w);
|
||||
if (eyeSpace)
|
||||
{
|
||||
DirectX::XMFLOAT4X4 modelView;
|
||||
std::memset(&modelView, 0, sizeof(modelView));
|
||||
std::memcpy(&modelView, this->MatrixGet(MATRIX_MODE_MODELVIEW), sizeof(modelView));
|
||||
std::memcpy(&modelView, MatrixGet(MATRIX_MODE_MODELVIEW), sizeof(modelView));
|
||||
|
||||
DirectX::XMVECTOR determinant = DirectX::XMVectorZero();
|
||||
const DirectX::XMMATRIX inverse = DirectX::XMMatrixInverse(&determinant, DirectX::XMLoadFloat4x4(&modelView));
|
||||
@@ -604,35 +592,33 @@ void Renderer::StateSetTexGenCol(int col, float x, float y, float z, float w, bo
|
||||
|
||||
void Renderer::StateSetStencil(D3D11_COMPARISON_FUNC function, uint8_t stencil_ref, uint8_t stencil_func_mask, uint8_t stencil_write_mask)
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
Context &c = getContext();
|
||||
|
||||
D3D11_DEPTH_STENCIL_DESC desc = c.depthStencilDesc;
|
||||
desc.StencilEnable = TRUE;
|
||||
desc.StencilEnable = true;
|
||||
desc.StencilReadMask = stencil_func_mask;
|
||||
desc.StencilWriteMask = stencil_write_mask;
|
||||
desc.FrontFace.StencilFunc = function;
|
||||
desc.BackFace.StencilFunc = function;
|
||||
|
||||
ID3D11DepthStencilState *state = nullptr;
|
||||
ID3D11DepthStencilState *state = NULL;
|
||||
m_pDevice->CreateDepthStencilState(&desc, &state);
|
||||
m_pDeviceContext->OMSetDepthStencilState(state, stencil_ref);
|
||||
if (state != nullptr)
|
||||
{
|
||||
state->Release();
|
||||
}
|
||||
if (state != NULL) state->Release();
|
||||
}
|
||||
|
||||
void Renderer::StateSetForceLOD(int LOD)
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
Context &c = getContext();
|
||||
c.forcedLOD = LOD;
|
||||
}
|
||||
|
||||
void Renderer::StateUpdate()
|
||||
{
|
||||
Context &c = this->getContext();
|
||||
this->StateSetFaceCull(c.faceCullEnabled != 0);
|
||||
this->StateSetDepthMask(c.depthWriteEnabled != 0);
|
||||
this->StateSetDepthTestEnable(c.depthTestEnabled != 0);
|
||||
this->StateSetAlphaTestEnable(c.alphaTestEnabled != 0);
|
||||
PROFILER_SCOPE("Renderer::StateUpdate", "StateUpdate", MP_ORCHID1)
|
||||
Context &c = getContext();
|
||||
StateSetFaceCull(c.faceCullEnabled);
|
||||
StateSetDepthMask(c.depthWriteEnabled);
|
||||
StateSetDepthTestEnable(c.depthTestEnabled);
|
||||
StateSetAlphaTestEnable(c.alphaTestEnabled);
|
||||
}
|
||||
|
||||
@@ -1,372 +1,326 @@
|
||||
#pragma once
|
||||
#include "stdafx.h"
|
||||
#include "Renderer.h"
|
||||
#include "libpng/png.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <limits>
|
||||
#include <new>
|
||||
unsigned char* dataStart;
|
||||
unsigned char *dataCurr;
|
||||
unsigned char *dataEnd;
|
||||
|
||||
DXGI_FORMAT Renderer::textureFormats[C4JRender::MAX_TEXTURE_FORMATS] = {
|
||||
DXGI_FORMAT_B8G8R8A8_UNORM,
|
||||
};
|
||||
DXGI_FORMAT Renderer::textureFormats[] = { DXGI_FORMAT_B8G8R8A8_UNORM };
|
||||
|
||||
void user_write_data_init(unsigned char* pBuffer, int size)
|
||||
{
|
||||
dataStart = pBuffer;
|
||||
dataCurr = pBuffer;
|
||||
dataEnd = pBuffer + size;
|
||||
}
|
||||
|
||||
int user_write_data_bytes_written()
|
||||
{
|
||||
return static_cast<int>(dataCurr - dataStart);
|
||||
}
|
||||
|
||||
void user_write_data(png_struct_def* png_ptr, unsigned char* src, size_t length)
|
||||
{
|
||||
int bytesToWrite = static_cast<int>(dataEnd - dataCurr);
|
||||
if (static_cast<int>(length) < bytesToWrite)
|
||||
bytesToWrite = static_cast<int>(length);
|
||||
|
||||
memcpy(dataCurr, src, bytesToWrite);
|
||||
dataCurr += bytesToWrite;
|
||||
}
|
||||
|
||||
void user_flush_data(png_struct_def* png_ptr)
|
||||
{
|
||||
// TODO(3UR): this is for a different platform? it's empty in Render_PC.lib but not Render.lib
|
||||
}
|
||||
|
||||
int Renderer::TextureCreate()
|
||||
{
|
||||
int i = 0;
|
||||
for (; ; i++)
|
||||
PROFILER_SCOPE("Renderer::TextureCreate", "TextureCreate", MP_PURPLE4)
|
||||
for (int i = 0; i < MAX_TEXTURES; i++)
|
||||
{
|
||||
assert(i < 512);
|
||||
|
||||
if (!m_textures[i].allocated)
|
||||
{
|
||||
break;
|
||||
m_textures[i].texture = NULL;
|
||||
m_textures[i].allocated = true;
|
||||
m_textures[i].mipLevels = 1;
|
||||
m_textures[i].textureFormat = 0;
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
m_textures[i].texture = nullptr;
|
||||
m_textures[i].allocated = true;
|
||||
m_textures[i].mipLevels = 1;
|
||||
m_textures[i].samplerParams = 0;
|
||||
return i;
|
||||
}
|
||||
|
||||
void Renderer::TextureSetTextureLevels(int levels)
|
||||
{
|
||||
const int textureIdx = this->getContext().textureIdx;
|
||||
|
||||
assert(levels <= MAX_MIP_LEVELS);
|
||||
|
||||
m_textures[textureIdx].mipLevels = levels;
|
||||
}
|
||||
|
||||
int Renderer::TextureGetTextureLevels()
|
||||
{
|
||||
const int textureIdx = this->getContext().textureIdx;
|
||||
return m_textures[textureIdx].mipLevels;
|
||||
}
|
||||
|
||||
void Renderer::TextureSetParam(int param, int value)
|
||||
{
|
||||
Texture &texture = m_textures[this->getContext().textureIdx];
|
||||
|
||||
switch (param)
|
||||
{
|
||||
case GL_TEXTURE_MIN_FILTER:
|
||||
texture.samplerParams &= ~4u;
|
||||
if (value == 1)
|
||||
{
|
||||
texture.samplerParams |= 4u;
|
||||
}
|
||||
break;
|
||||
case GL_TEXTURE_MAG_FILTER:
|
||||
texture.samplerParams &= ~8u;
|
||||
if (value == 1)
|
||||
{
|
||||
texture.samplerParams |= 8u;
|
||||
}
|
||||
break;
|
||||
case GL_TEXTURE_WRAP_S:
|
||||
texture.samplerParams &= ~1u;
|
||||
if (value == 0)
|
||||
{
|
||||
texture.samplerParams |= 1u;
|
||||
}
|
||||
break;
|
||||
case GL_TEXTURE_WRAP_T:
|
||||
case 5: // GL_TEXTURE_WRAP_R, but this renderer only supports 2D textures, so treat it as GL_TEXTURE_WRAP_T
|
||||
texture.samplerParams &= ~2u;
|
||||
if (value == 0)
|
||||
{
|
||||
texture.samplerParams |= 2u;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Renderer::TextureDynamicUpdateStart() {}
|
||||
|
||||
void Renderer::TextureDynamicUpdateEnd() {}
|
||||
|
||||
void Renderer::TextureData(int width, int height, void *data, int level, C4JRender::eTextureFormat format)
|
||||
{
|
||||
Renderer::Context &c = this->getContext();
|
||||
|
||||
assert(m_textures[c.textureIdx].allocated);
|
||||
assert((level > 0) || (m_textures[c.textureIdx].texture == NULL));
|
||||
|
||||
Texture &texture = m_textures[c.textureIdx];
|
||||
texture.textureFormat = format;
|
||||
|
||||
if (level == 0)
|
||||
{
|
||||
D3D11_TEXTURE2D_DESC desc = {};
|
||||
desc.Width = width;
|
||||
desc.Height = height;
|
||||
desc.MipLevels = texture.mipLevels;
|
||||
desc.ArraySize = 1;
|
||||
desc.Format = textureFormats[format];
|
||||
desc.SampleDesc.Count = 1;
|
||||
desc.Usage = D3D11_USAGE_DEFAULT;
|
||||
desc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
|
||||
|
||||
HRESULT hr = 0;
|
||||
hr = m_pDevice->CreateTexture2D(&desc, nullptr, &texture.texture);
|
||||
assert(hr >= 0);
|
||||
|
||||
hr = m_pDevice->CreateShaderResourceView(texture.texture, nullptr, &texture.view);
|
||||
assert(hr >= 0);
|
||||
}
|
||||
|
||||
const UINT rowPitch = width * 4u;
|
||||
const UINT depthPitch = width * height * 4u;
|
||||
c.m_pDeviceContext->UpdateSubresource(texture.texture, level, nullptr, data, rowPitch, depthPitch);
|
||||
}
|
||||
|
||||
void Renderer::TextureDataUpdate(int xoffset, int yoffset, int width, int height, void *data, int level)
|
||||
{
|
||||
Renderer::Context &c = this->getContext();
|
||||
Texture &texture = m_textures[c.textureIdx];
|
||||
|
||||
D3D11_BOX box = {};
|
||||
box.left = xoffset;
|
||||
box.right = xoffset + width;
|
||||
box.top = yoffset;
|
||||
box.bottom = yoffset + height;
|
||||
box.front = 0;
|
||||
box.back = 1;
|
||||
|
||||
D3D11_TEXTURE2D_DESC desc = {};
|
||||
texture.texture->GetDesc(&desc);
|
||||
|
||||
const UINT rowPitch = width * 4u;
|
||||
const UINT depthPitch = width * height * 4u;
|
||||
c.m_pDeviceContext->UpdateSubresource(texture.texture, level, &box, data, rowPitch, depthPitch);
|
||||
return -1;
|
||||
}
|
||||
|
||||
void Renderer::TextureFree(int idx)
|
||||
{
|
||||
Texture &texture = m_textures[idx];
|
||||
texture.texture->Release();
|
||||
texture.view->Release();
|
||||
texture.view = nullptr;
|
||||
texture.allocated = false;
|
||||
texture.texture = nullptr;
|
||||
}
|
||||
|
||||
void Renderer::TextureGetStats() {}
|
||||
|
||||
ID3D11ShaderResourceView *Renderer::TextureGetTexture(int idx)
|
||||
{
|
||||
if (idx < 0 || idx > 0x1FF)
|
||||
PROFILER_SCOPE("Renderer::TextureFree", "TextureFree", MP_PURPLE4)
|
||||
if (m_textures[idx].texture)
|
||||
{
|
||||
return nullptr;
|
||||
m_textures[idx].texture->Release();
|
||||
m_textures[idx].texture = NULL;
|
||||
}
|
||||
|
||||
const Texture &texture = m_textures[idx];
|
||||
if (!texture.allocated)
|
||||
if (m_textures[idx].view)
|
||||
{
|
||||
return nullptr;
|
||||
m_textures[idx].view->Release();
|
||||
m_textures[idx].view = NULL;
|
||||
}
|
||||
|
||||
return texture.view;
|
||||
m_textures[idx].allocated = false;
|
||||
}
|
||||
|
||||
void Renderer::TextureBind(int idx)
|
||||
{
|
||||
int textureIndex = idx;
|
||||
if (textureIndex == -1)
|
||||
{
|
||||
textureIndex = defaultTextureIndex;
|
||||
}
|
||||
PROFILER_SCOPE("Renderer::TextureBind", "TextureBind", MP_PURPLE4)
|
||||
if (idx == -1)
|
||||
idx = defaultTextureIndex;
|
||||
|
||||
Renderer::Context &c = this->getContext();
|
||||
Context& c = getContext();
|
||||
|
||||
if (c.commandBuffer && c.commandBuffer->isActive)
|
||||
{
|
||||
c.commandBuffer->BindTexture(textureIndex);
|
||||
}
|
||||
c.commandBuffer->BindTexture(idx);
|
||||
|
||||
c.textureIdx = textureIndex;
|
||||
ID3D11ShaderResourceView *const view = m_textures[textureIndex].view;
|
||||
c.m_pDeviceContext->PSSetShaderResources(0, 1, &view);
|
||||
this->UpdateTextureState(false);
|
||||
c.textureIdx = idx;
|
||||
c.m_pDeviceContext->PSSetShaderResources(0, 1, &m_textures[idx].view);
|
||||
|
||||
UpdateTextureState(false);
|
||||
}
|
||||
|
||||
void Renderer::TextureBindVertex(int idx)
|
||||
{
|
||||
int textureIndex = idx;
|
||||
if (textureIndex == -1)
|
||||
{
|
||||
textureIndex = defaultTextureIndex;
|
||||
}
|
||||
PROFILER_SCOPE("Renderer::TextureBindVertex", "TextureBindVertex", MP_PURPLE4)
|
||||
if (idx == -1)
|
||||
idx = defaultTextureIndex;
|
||||
|
||||
Renderer::Context &c = this->getContext();
|
||||
c.textureIdx = textureIndex;
|
||||
Context& c = getContext();
|
||||
|
||||
ID3D11ShaderResourceView *const view = m_textures[textureIndex].view;
|
||||
c.m_pDeviceContext->VSSetShaderResources(0, 1, &view);
|
||||
this->UpdateTextureState(true);
|
||||
c.textureIdx = idx;
|
||||
c.m_pDeviceContext->VSSetShaderResources(0, 1, &m_textures[idx].view);
|
||||
|
||||
UpdateTextureState(true);
|
||||
}
|
||||
|
||||
void Renderer::UpdateTextureState(bool vertexSampler)
|
||||
void Renderer::TextureSetTextureLevels(int levels)
|
||||
{
|
||||
Renderer::Context &c = this->getContext();
|
||||
ID3D11SamplerState *sampler = this->GetManagedSamplerState();
|
||||
Context& c = getContext();
|
||||
m_textures[c.textureIdx].mipLevels = levels;
|
||||
}
|
||||
|
||||
if (vertexSampler)
|
||||
int Renderer::TextureGetTextureLevels()
|
||||
{
|
||||
Context& c = getContext();
|
||||
return m_textures[c.textureIdx].mipLevels;
|
||||
}
|
||||
|
||||
void Renderer::TextureData(int width, int height, void* data, int level, C4JRender::eTextureFormat format)
|
||||
{
|
||||
PROFILER_SCOPE("Renderer::TextureData", "TextureData", MP_PURPLE4)
|
||||
Context& c = getContext();
|
||||
int idx = c.textureIdx;
|
||||
|
||||
m_textures[idx].textureFormat = format;
|
||||
|
||||
if (level == 0)
|
||||
{
|
||||
c.m_pDeviceContext->VSSetSamplers(0, 1, &sampler);
|
||||
D3D11_TEXTURE2D_DESC desc;
|
||||
desc.Width = width;
|
||||
desc.Height = height;
|
||||
desc.MipLevels = m_textures[idx].mipLevels;
|
||||
desc.ArraySize = 1;
|
||||
desc.Format = textureFormats[format];
|
||||
desc.SampleDesc.Count = 1;
|
||||
desc.SampleDesc.Quality = 0;
|
||||
desc.Usage = D3D11_USAGE_DEFAULT;
|
||||
desc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
|
||||
desc.CPUAccessFlags = 0;
|
||||
desc.MiscFlags = 0;
|
||||
|
||||
m_pDevice->CreateTexture2D(&desc, NULL, &m_textures[idx].texture);
|
||||
m_pDevice->CreateShaderResourceView(m_textures[idx].texture, NULL, &m_textures[idx].view);
|
||||
}
|
||||
|
||||
c.m_pDeviceContext->UpdateSubresource(
|
||||
m_textures[idx].texture,
|
||||
level,
|
||||
NULL,
|
||||
data,
|
||||
static_cast<UINT>(width * 4),
|
||||
static_cast<UINT>(width * height * 4)
|
||||
);
|
||||
}
|
||||
|
||||
void Renderer::TextureDataUpdate(int xoffset, int yoffset, int width, int height, void* data, int level)
|
||||
{
|
||||
PROFILER_SCOPE("Renderer::TextureDataUpdate", "TextureDataUpdate", MP_PURPLE4)
|
||||
Context& c = getContext();
|
||||
int idx = c.textureIdx;
|
||||
|
||||
D3D11_TEXTURE2D_DESC desc;
|
||||
m_textures[idx].texture->GetDesc(&desc);
|
||||
|
||||
D3D11_BOX box;
|
||||
box.left = xoffset;
|
||||
box.top = yoffset;
|
||||
box.right = xoffset + width;
|
||||
box.bottom = yoffset + height;
|
||||
box.front = 0;
|
||||
box.back = 1;
|
||||
|
||||
c.m_pDeviceContext->UpdateSubresource(
|
||||
m_textures[idx].texture,
|
||||
level,
|
||||
&box,
|
||||
data,
|
||||
static_cast<UINT>(width * 4),
|
||||
static_cast<UINT>(width * height * 4)
|
||||
);
|
||||
}
|
||||
|
||||
void Renderer::TextureSetParam(int param, int value)
|
||||
{
|
||||
Context& c = getContext();
|
||||
int idx = c.textureIdx;
|
||||
|
||||
switch (param)
|
||||
{
|
||||
case GL_TEXTURE_MIN_FILTER:
|
||||
m_textures[idx].samplerParams &= ~4u;
|
||||
if (value == GL_LINEAR)
|
||||
m_textures[idx].samplerParams |= 4u;
|
||||
break;
|
||||
case GL_TEXTURE_MAG_FILTER:
|
||||
m_textures[idx].samplerParams &= ~8u;
|
||||
if (value == GL_LINEAR)
|
||||
m_textures[idx].samplerParams |= 8u;
|
||||
break;
|
||||
case GL_TEXTURE_WRAP_S:
|
||||
m_textures[idx].samplerParams &= ~1u;
|
||||
if (value == GL_CLAMP)
|
||||
m_textures[idx].samplerParams |= 1u;
|
||||
break;
|
||||
case GL_TEXTURE_WRAP_T:
|
||||
m_textures[idx].samplerParams &= ~2u;
|
||||
if (value == GL_CLAMP)
|
||||
m_textures[idx].samplerParams |= 2u;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Renderer::TextureDynamicUpdateStart()
|
||||
{
|
||||
// TODO(3UR): this is for a different platform? it's empty in Render_PC.lib but not Render.lib
|
||||
}
|
||||
|
||||
void Renderer::TextureDynamicUpdateEnd()
|
||||
{
|
||||
// TODO(3UR): this is for a different platform? it's empty in Render_PC.lib but not Render.lib
|
||||
}
|
||||
|
||||
void Renderer::UpdateTextureState(bool bVertex)
|
||||
{
|
||||
Context& c = getContext();
|
||||
ID3D11SamplerState* pSampler = GetManagedSamplerState();
|
||||
|
||||
if (bVertex)
|
||||
c.m_pDeviceContext->VSSetSamplers(0, 1, &pSampler);
|
||||
else
|
||||
{
|
||||
c.m_pDeviceContext->PSSetSamplers(0, 1, &sampler);
|
||||
}
|
||||
c.m_pDeviceContext->PSSetSamplers(0, 1, &pSampler);
|
||||
}
|
||||
|
||||
HRESULT Renderer::LoadTextureData(const char *szFilename, D3DXIMAGE_INFO *pSrcInfo, int **ppDataOut)
|
||||
HRESULT Renderer::LoadTextureData(const char* szFilename, D3DXIMAGE_INFO* pSrcInfo, int** ppDataOut)
|
||||
{
|
||||
if (!szFilename || !pSrcInfo || !ppDataOut)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
*ppDataOut = nullptr;
|
||||
|
||||
PROFILER_SCOPE("Renderer::LoadTextureData_File", "LoadTextureData_File", MP_PURPLE4)
|
||||
png_image image;
|
||||
std::memset(&image, 0, sizeof(image));
|
||||
memset(&image, 0, sizeof(image));
|
||||
image.version = PNG_IMAGE_VERSION;
|
||||
|
||||
if (!png_image_begin_read_from_file(&image, szFilename))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (image.width == 0 || image.height == 0)
|
||||
{
|
||||
png_image_free(&image);
|
||||
return -1;
|
||||
}
|
||||
// TODO(3UR): why crash?
|
||||
//if ((image.format & 3u) > 1)
|
||||
// return -1;
|
||||
|
||||
image.format = PNG_FORMAT_RGBA;
|
||||
const png_alloc_size_t pixelCount = png_alloc_size_t(image.width) * png_alloc_size_t(image.height);
|
||||
if (pixelCount == 0 || pixelCount > (std::numeric_limits<size_t>::max)() / sizeof(int))
|
||||
{
|
||||
png_image_free(&image);
|
||||
|
||||
*ppDataOut = new int[image.width * image.height];
|
||||
if (!*ppDataOut || !png_image_finish_read(&image, NULL, *ppDataOut, 0, NULL))
|
||||
return -1;
|
||||
}
|
||||
|
||||
int *output = new (std::nothrow) int[size_t(pixelCount)];
|
||||
|
||||
if (!output)
|
||||
{
|
||||
png_image_free(&image);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!png_image_finish_read(&image, nullptr, output, 0, nullptr))
|
||||
{
|
||||
delete[] output;
|
||||
png_image_free(&image);
|
||||
return -1;
|
||||
}
|
||||
|
||||
*ppDataOut = output;
|
||||
pSrcInfo->Width = image.width;
|
||||
pSrcInfo->Height = image.height;
|
||||
png_image_free(&image);
|
||||
return 0;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT Renderer::LoadTextureData(BYTE *pbData, DWORD dwBytes, D3DXIMAGE_INFO *pSrcInfo, int **ppDataOut)
|
||||
HRESULT Renderer::LoadTextureData(BYTE* pbData, DWORD dwBytes, D3DXIMAGE_INFO* pSrcInfo, int** ppDataOut)
|
||||
{
|
||||
if (!pbData || dwBytes == 0 || !pSrcInfo || !ppDataOut)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
*ppDataOut = nullptr;
|
||||
|
||||
PROFILER_SCOPE("Renderer::LoadTextureData_Memory", "LoadTextureData_Memory", MP_PURPLE4)
|
||||
png_image image;
|
||||
std::memset(&image, 0, sizeof(image));
|
||||
memset(&image, 0, sizeof(image));
|
||||
image.version = PNG_IMAGE_VERSION;
|
||||
if (!png_image_begin_read_from_memory(&image, pbData, dwBytes))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (image.width == 0 || image.height == 0)
|
||||
{
|
||||
png_image_free(&image);
|
||||
if (!png_image_begin_read_from_memory(&image, pbData, dwBytes))
|
||||
return -1;
|
||||
}
|
||||
|
||||
// TODO(3UR): why crash?
|
||||
//if ((image.format & 3u) > 1)
|
||||
// return -1;
|
||||
|
||||
image.format = PNG_FORMAT_RGBA;
|
||||
const png_alloc_size_t pixelCount = png_alloc_size_t(image.width) * png_alloc_size_t(image.height);
|
||||
if (pixelCount == 0 || pixelCount > (std::numeric_limits<size_t>::max)() / sizeof(int))
|
||||
{
|
||||
png_image_free(&image);
|
||||
|
||||
*ppDataOut = new int[image.width * image.height];
|
||||
if (!*ppDataOut || !png_image_finish_read(&image, NULL, *ppDataOut, 0, NULL))
|
||||
return -1;
|
||||
}
|
||||
|
||||
int *output = new (std::nothrow) int[size_t(pixelCount)];
|
||||
|
||||
if (!output)
|
||||
{
|
||||
png_image_free(&image);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!png_image_finish_read(&image, nullptr, output, 0, nullptr))
|
||||
{
|
||||
delete[] output;
|
||||
png_image_free(&image);
|
||||
return -1;
|
||||
}
|
||||
|
||||
*ppDataOut = output;
|
||||
pSrcInfo->Width = image.width;
|
||||
pSrcInfo->Height = image.height;
|
||||
png_image_free(&image);
|
||||
return 0;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT Renderer::SaveTextureData(const char *szFilename, D3DXIMAGE_INFO *pSrcInfo, int *ppDataOut)
|
||||
HRESULT Renderer::SaveTextureData(const char* szFilename, D3DXIMAGE_INFO* pSrcInfo, int* ppDataOut)
|
||||
{
|
||||
png_image image = {};
|
||||
image.version = PNG_IMAGE_VERSION;
|
||||
PROFILER_SCOPE("Renderer::SaveTextureData", "SaveTextureData", MP_PURPLE4)
|
||||
png_image image;
|
||||
memset(&image, 0, sizeof(image));
|
||||
image.width = pSrcInfo->Width;
|
||||
image.height = pSrcInfo->Height;
|
||||
image.version = PNG_IMAGE_VERSION;
|
||||
image.format = PNG_FORMAT_RGBA;
|
||||
|
||||
png_image_write_to_file(&image, szFilename, 0, ppDataOut, 0, nullptr);
|
||||
return 0;
|
||||
png_image_write_to_file(&image, szFilename, 0, ppDataOut, 0, NULL);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT Renderer::SaveTextureDataToMemory(void *pOutput, int outputCapacity, int *outputLength, int width, int height, int *ppDataIn)
|
||||
HRESULT Renderer::SaveTextureDataToMemory(void* pOutput, int outputCapacity, int* outputLength, int width, int height, int* ppDataIn)
|
||||
{
|
||||
if (!pOutput || outputCapacity <= 0 || !outputLength || width <= 0 || height <= 0 || !ppDataIn)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
PROFILER_SCOPE("Renderer::SaveTextureDataToMemory", "SaveTextureDataToMemory", MP_PURPLE4)
|
||||
png_image image;
|
||||
std::memset(&image, 0, sizeof(image));
|
||||
image.version = PNG_IMAGE_VERSION;
|
||||
memset(&image, 0, sizeof(image));
|
||||
image.width = width;
|
||||
image.height = height;
|
||||
image.version = PNG_IMAGE_VERSION;
|
||||
image.format = PNG_FORMAT_RGBA;
|
||||
|
||||
png_alloc_size_t memoryBytes = static_cast<png_alloc_size_t>(outputCapacity);
|
||||
if (!png_image_write_to_memory(&image, pOutput, &memoryBytes, 0, ppDataIn, 0, nullptr))
|
||||
{
|
||||
*outputLength = 0;
|
||||
png_image_free(&image);
|
||||
return -1;
|
||||
}
|
||||
dataEnd = (BYTE*)pOutput + outputCapacity;
|
||||
dataStart = (BYTE*)pOutput;
|
||||
dataCurr = (BYTE*)pOutput;
|
||||
|
||||
*outputLength = static_cast<int>(memoryBytes);
|
||||
png_image_free(&image);
|
||||
return 0;
|
||||
png_image_write_to_stdio(&image, NULL, 0, ppDataIn, 0, NULL, user_write_data, user_flush_data);
|
||||
|
||||
*outputLength = static_cast<int>(dataCurr - dataStart);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void Renderer::TextureGetStats()
|
||||
{
|
||||
// TODO(3UR): this is for a different platform? it's empty in Render_PC.lib but not Render.lib
|
||||
}
|
||||
|
||||
ID3D11ShaderResourceView* Renderer::TextureGetTexture(int idx)
|
||||
{
|
||||
if ((unsigned int)idx <= 511)
|
||||
{
|
||||
if (m_textures[idx].allocated)
|
||||
return m_textures[idx].view;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@@ -1,59 +1,51 @@
|
||||
#pragma once
|
||||
#include "stdafx.h"
|
||||
#include "Renderer.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
D3D11_PRIMITIVE_TOPOLOGY *Renderer::m_Topologies = nullptr;
|
||||
|
||||
void Renderer::DrawVertexBuffer(C4JRender::ePrimitiveType PrimitiveType, int count, ID3D11Buffer *buffer, C4JRender::eVertexType vType,
|
||||
C4JRender::ePixelShaderType psType)
|
||||
{
|
||||
Renderer::Context &c = this->getContext();
|
||||
PROFILER_SCOPE("Renderer::DrawVertexBuffer", "DrawVertexBuffer", MP_RED2)
|
||||
Renderer::Context &c = getContext();
|
||||
ID3D11DeviceContext *d3d11 = c.m_pDeviceContext;
|
||||
|
||||
int drawCount = count;
|
||||
bool indexed = false;
|
||||
this->DrawVertexSetup(vType, psType, PrimitiveType, &drawCount, &indexed);
|
||||
this->StateUpdate();
|
||||
|
||||
PROFILER_SCOPE("Renderer::DrawVertexBuffer", "DrawVertexSetup", MP_RED2)
|
||||
DrawVertexSetup(vType, psType, PrimitiveType, &drawCount, &indexed);
|
||||
StateUpdate();
|
||||
|
||||
const UINT stride = vertexStrideTable[vType];
|
||||
const UINT offset = 0;
|
||||
d3d11->IASetVertexBuffers(0, 1, &buffer, &stride, &offset);
|
||||
|
||||
if (indexed)
|
||||
{
|
||||
d3d11->DrawIndexed(drawCount, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
d3d11->Draw(count, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void Renderer::DrawVertexSetup(C4JRender::eVertexType vType, C4JRender::ePixelShaderType psType, C4JRender::ePrimitiveType PrimitiveType, int *count,
|
||||
bool *indexed)
|
||||
{
|
||||
Renderer::Context &c = this->getContext();
|
||||
PROFILER_SCOPE("Renderer::DrawVertexSetup", "DrawVertexSetup", MP_RED2)
|
||||
Renderer::Context &c = getContext();
|
||||
ID3D11DeviceContext *d3d11 = c.m_pDeviceContext;
|
||||
|
||||
C4JRender::eVertexType effectiveVertexType = vType;
|
||||
if (effectiveVertexType == C4JRender::VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 && c.lightingEnabled)
|
||||
{
|
||||
effectiveVertexType = C4JRender::VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_LIT;
|
||||
}
|
||||
|
||||
if (effectiveVertexType != activeVertexType)
|
||||
{
|
||||
d3d11->VSSetShader(vertexShaderTable[effectiveVertexType], nullptr, 0);
|
||||
d3d11->VSSetShader(vertexShaderTable[effectiveVertexType], NULL, 0);
|
||||
d3d11->IASetInputLayout(inputLayoutTable[effectiveVertexType]);
|
||||
activeVertexType = effectiveVertexType;
|
||||
}
|
||||
|
||||
if (psType != activePixelType)
|
||||
{
|
||||
d3d11->PSSetShader(pixelShaderTable[psType], nullptr, 0);
|
||||
d3d11->PSSetShader(pixelShaderTable[psType], NULL, 0);
|
||||
activePixelType = psType;
|
||||
}
|
||||
|
||||
@@ -62,7 +54,7 @@ void Renderer::DrawVertexSetup(C4JRender::eVertexType vType, C4JRender::ePixelSh
|
||||
if (c.matrixDirty[MATRIX_MODE_MODELVIEW])
|
||||
{
|
||||
d3d11->Map(c.m_modelViewMatrix, 0, D3D11_MAP_WRITE_DISCARD, 0, &mapped);
|
||||
std::memcpy(mapped.pData, this->MatrixGet(MATRIX_MODE_MODELVIEW), sizeof(DirectX::XMMATRIX));
|
||||
memcpy(mapped.pData, MatrixGet(MATRIX_MODE_MODELVIEW), sizeof(DirectX::XMMATRIX));
|
||||
d3d11->Unmap(c.m_modelViewMatrix, 0);
|
||||
c.matrixDirty[MATRIX_MODE_MODELVIEW] = false;
|
||||
}
|
||||
@@ -70,7 +62,7 @@ void Renderer::DrawVertexSetup(C4JRender::eVertexType vType, C4JRender::ePixelSh
|
||||
if (c.matrixDirty[MATRIX_MODE_MODELVIEW_PROJECTION])
|
||||
{
|
||||
d3d11->Map(c.m_projectionMatrix, 0, D3D11_MAP_WRITE_DISCARD, 0, &mapped);
|
||||
std::memcpy(mapped.pData, this->MatrixGet(MATRIX_MODE_MODELVIEW_PROJECTION), sizeof(DirectX::XMMATRIX));
|
||||
memcpy(mapped.pData, MatrixGet(MATRIX_MODE_MODELVIEW_PROJECTION), sizeof(DirectX::XMMATRIX));
|
||||
d3d11->Unmap(c.m_projectionMatrix, 0);
|
||||
c.matrixDirty[MATRIX_MODE_MODELVIEW_PROJECTION] = false;
|
||||
}
|
||||
@@ -78,17 +70,17 @@ void Renderer::DrawVertexSetup(C4JRender::eVertexType vType, C4JRender::ePixelSh
|
||||
if (c.matrixDirty[MATRIX_MODE_MODELVIEW_TEXTURE])
|
||||
{
|
||||
d3d11->Map(c.m_textureMatrix, 0, D3D11_MAP_WRITE_DISCARD, 0, &mapped);
|
||||
std::memcpy(mapped.pData, this->MatrixGet(MATRIX_MODE_MODELVIEW_TEXTURE), sizeof(DirectX::XMMATRIX));
|
||||
memcpy(mapped.pData, MatrixGet(MATRIX_MODE_MODELVIEW_TEXTURE), sizeof(DirectX::XMMATRIX));
|
||||
d3d11->Unmap(c.m_textureMatrix, 0);
|
||||
c.matrixDirty[MATRIX_MODE_MODELVIEW_TEXTURE] = false;
|
||||
}
|
||||
|
||||
this->UpdateFogState();
|
||||
this->UpdateViewportState();
|
||||
this->UpdateLightingState();
|
||||
this->UpdateTexGenState();
|
||||
UpdateFogState();
|
||||
UpdateViewportState();
|
||||
UpdateLightingState();
|
||||
UpdateTexGenState();
|
||||
|
||||
d3d11->IASetPrimitiveTopology(m_Topologies[PrimitiveType]);
|
||||
d3d11->IASetPrimitiveTopology(g_topologies[PrimitiveType]);
|
||||
|
||||
if (PrimitiveType == C4JRender::PRIMITIVE_TYPE_QUAD_LIST)
|
||||
{
|
||||
@@ -106,24 +98,23 @@ void Renderer::DrawVertexSetup(C4JRender::eVertexType vType, C4JRender::ePixelSh
|
||||
return;
|
||||
}
|
||||
|
||||
d3d11->IASetIndexBuffer(nullptr, DXGI_FORMAT_R16_UINT, 0);
|
||||
d3d11->IASetIndexBuffer(NULL, DXGI_FORMAT_R16_UINT, 0);
|
||||
*indexed = false;
|
||||
}
|
||||
|
||||
void Renderer::DrawVertices(C4JRender::ePrimitiveType PrimitiveType, int count, void *vertices, C4JRender::eVertexType vType,
|
||||
C4JRender::ePixelShaderType psType)
|
||||
{
|
||||
Renderer::Context &c = this->getContext();
|
||||
PROFILER_SCOPE("Renderer::DrawVertices", "DrawVertices", MP_RED2)
|
||||
Renderer::Context &c = getContext();
|
||||
ID3D11DeviceContext *d3d11 = c.m_pDeviceContext;
|
||||
Renderer::CommandBuffer *commandBuffer = c.commandBuffer;
|
||||
|
||||
if (commandBuffer != nullptr)
|
||||
if (commandBuffer != NULL)
|
||||
{
|
||||
C4JRender::eVertexType effectiveVertexType = vType;
|
||||
if (effectiveVertexType == C4JRender::VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 && c.lightingEnabled)
|
||||
{
|
||||
effectiveVertexType = C4JRender::VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_LIT;
|
||||
}
|
||||
|
||||
c.recordingPrimitiveType = PrimitiveType;
|
||||
c.recordingVertexType = effectiveVertexType;
|
||||
@@ -134,43 +125,37 @@ void Renderer::DrawVertices(C4JRender::ePrimitiveType PrimitiveType, int count,
|
||||
|
||||
int drawCount = count;
|
||||
bool indexed = false;
|
||||
this->DrawVertexSetup(vType, psType, PrimitiveType, &drawCount, &indexed);
|
||||
|
||||
PROFILER_SCOPE("Renderer::DrawVertices", "DrawVertexSetup", MP_RED2)
|
||||
DrawVertexSetup(vType, psType, PrimitiveType, &drawCount, &indexed);
|
||||
|
||||
const UINT stride = vertexStrideTable[vType];
|
||||
const UINT vertexBytes = stride * static_cast<UINT>(count);
|
||||
|
||||
assert(vertexBytes <= Context::VERTEX_BUFFER_SIZE);
|
||||
|
||||
if (c.dynamicVertexOffset + vertexBytes > Context::VERTEX_BUFFER_SIZE)
|
||||
{
|
||||
c.dynamicVertexOffset = 0;
|
||||
}
|
||||
UINT vertexOffset = c.dynamicVertexOffset;
|
||||
if (vertexOffset + vertexBytes > Context::VERTEX_BUFFER_SIZE)
|
||||
vertexOffset = 0;
|
||||
|
||||
D3D11_MAPPED_SUBRESOURCE mapped = {};
|
||||
const D3D11_MAP mapType = c.dynamicVertexOffset == 0 ? D3D11_MAP_WRITE_DISCARD : D3D11_MAP_WRITE_NO_OVERWRITE;
|
||||
const D3D11_MAP mapType = vertexOffset == 0 ? D3D11_MAP_WRITE_DISCARD : D3D11_MAP_WRITE_NO_OVERWRITE;
|
||||
const HRESULT hr = d3d11->Map(c.dynamicVertexBuffer, 0, mapType, 0, &mapped);
|
||||
if (hr != 0)
|
||||
{
|
||||
std::printf("ERROR: 0x%x\n", static_cast<unsigned int>(hr));
|
||||
}
|
||||
if (FAILED(hr))
|
||||
printf("ERROR: 0x%x\n", static_cast<unsigned int>(hr));
|
||||
|
||||
std::memcpy(static_cast<std::uint8_t *>(mapped.pData) + c.dynamicVertexOffset, vertices, vertexBytes);
|
||||
memcpy(reinterpret_cast<std::uint8_t *>(mapped.pData) + vertexOffset, vertices, vertexBytes);
|
||||
d3d11->Unmap(c.dynamicVertexBuffer, 0);
|
||||
|
||||
this->StateUpdate();
|
||||
StateUpdate();
|
||||
|
||||
ID3D11Buffer *dynamicBuffer = c.dynamicVertexBuffer;
|
||||
const UINT vertexOffset = c.dynamicVertexOffset;
|
||||
d3d11->IASetVertexBuffers(0, 1, &dynamicBuffer, &stride, &vertexOffset);
|
||||
|
||||
if (indexed)
|
||||
{
|
||||
d3d11->DrawIndexed(drawCount, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
d3d11->Draw(count, 0);
|
||||
}
|
||||
|
||||
c.dynamicVertexOffset += vertexBytes;
|
||||
c.dynamicVertexOffset = vertexOffset + vertexBytes;
|
||||
}
|
||||
|
||||
+1391
-1137
File diff suppressed because it is too large
Load Diff
+1072
-1293
File diff suppressed because it is too large
Load Diff
@@ -1,17 +1,19 @@
|
||||
/* pngconf.h - machine-configurable file for libpng
|
||||
|
||||
/* pngconf.h - machine configurable file for libpng
|
||||
*
|
||||
* libpng version 1.6.55
|
||||
* libpng version 1.6.2 - April 25, 2013
|
||||
*
|
||||
* Copyright (c) 2018-2026 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
* and license in png.h
|
||||
*
|
||||
* Any machine specific code is near the front of this file, so if you
|
||||
*/
|
||||
|
||||
/* Any machine specific code is near the front of this file, so if you
|
||||
* are configuring libpng for a machine, you may want to read the section
|
||||
* starting here down to where it starts to typedef png_color, png_text,
|
||||
* and png_info.
|
||||
@@ -20,6 +22,26 @@
|
||||
#ifndef PNGCONF_H
|
||||
#define PNGCONF_H
|
||||
|
||||
/* To do: Do all of this in scripts/pnglibconf.dfa */
|
||||
#ifdef PNG_SAFE_LIMITS_SUPPORTED
|
||||
# ifdef PNG_USER_WIDTH_MAX
|
||||
# undef PNG_USER_WIDTH_MAX
|
||||
# define PNG_USER_WIDTH_MAX 1000000L
|
||||
# endif
|
||||
# ifdef PNG_USER_HEIGHT_MAX
|
||||
# undef PNG_USER_HEIGHT_MAX
|
||||
# define PNG_USER_HEIGHT_MAX 1000000L
|
||||
# endif
|
||||
# ifdef PNG_USER_CHUNK_MALLOC_MAX
|
||||
# undef PNG_USER_CHUNK_MALLOC_MAX
|
||||
# define PNG_USER_CHUNK_MALLOC_MAX 4000000L
|
||||
# endif
|
||||
# ifdef PNG_USER_CHUNK_CACHE_MAX
|
||||
# undef PNG_USER_CHUNK_CACHE_MAX
|
||||
# define PNG_USER_CHUNK_CACHE_MAX 128
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef PNG_BUILDING_SYMBOL_TABLE /* else includes may cause problems */
|
||||
|
||||
/* From libpng 1.6.0 libpng requires an ANSI X3.159-1989 ("ISOC90") compliant C
|
||||
@@ -57,13 +79,14 @@
|
||||
|
||||
#endif /* PNG_BUILDING_SYMBOL_TABLE */
|
||||
|
||||
/* Prior to 1.6.0, it was possible to turn off 'const' in declarations,
|
||||
* using PNG_NO_CONST. This is no longer supported.
|
||||
/* Prior to 1.6.0 it was possible to turn off 'const' in declarations using
|
||||
* PNG_NO_CONST; this is no longer supported except for data declarations which
|
||||
* apparently still cause problems in 2011 on some compilers.
|
||||
*/
|
||||
#define PNG_CONST const /* backward compatibility only */
|
||||
|
||||
/* This controls optimization of the reading of 16-bit and 32-bit
|
||||
* values from PNG files. It can be set on a per-app-file basis: it
|
||||
/* This controls optimization of the reading of 16 and 32 bit values
|
||||
* from PNG files. It can be set on a per-app-file basis - it
|
||||
* just changes whether a macro is used when the function is called.
|
||||
* The library builder sets the default; if read functions are not
|
||||
* built into the library the macro implementation is forced on.
|
||||
@@ -87,7 +110,7 @@
|
||||
|
||||
/* The PNGARG macro was used in versions of libpng prior to 1.6.0 to protect
|
||||
* against legacy (pre ISOC90) compilers that did not understand function
|
||||
* prototypes. [Deprecated.]
|
||||
* prototypes. It is not required for modern C compilers.
|
||||
*/
|
||||
#ifndef PNGARG
|
||||
# define PNGARG(arglist) arglist
|
||||
@@ -126,7 +149,7 @@
|
||||
*
|
||||
* These cases only differ if the operating system does not use the C
|
||||
* calling convention, at present this just means the above cases
|
||||
* (x86 DOS/Windows systems) and, even then, this does not apply to
|
||||
* (x86 DOS/Windows sytems) and, even then, this does not apply to
|
||||
* Cygwin running on those systems.
|
||||
*
|
||||
* Note that the value must be defined in pnglibconf.h so that what
|
||||
@@ -179,35 +202,35 @@
|
||||
* compiler-specific macros to the values required to change the calling
|
||||
* conventions of the various functions.
|
||||
*/
|
||||
#if defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || \
|
||||
defined(__CYGWIN__)
|
||||
#if defined(_Windows) || defined(_WINDOWS) || defined(WIN32) ||\
|
||||
defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
|
||||
/* Windows system (DOS doesn't support DLLs). Includes builds under Cygwin or
|
||||
* MinGW on any architecture currently supported by Windows. Also includes
|
||||
* Watcom builds but these need special treatment because they are not
|
||||
* compatible with GCC or Visual C because of different calling conventions.
|
||||
*/
|
||||
# if PNG_API_RULE == 2
|
||||
/* If this line results in an error, either because __watcall is not
|
||||
* understood or because of a redefine just below you cannot use *this*
|
||||
* build of the library with the compiler you are using. *This* build was
|
||||
* build using Watcom and applications must also be built using Watcom!
|
||||
*/
|
||||
/* If this line results in an error, either because __watcall is not
|
||||
* understood or because of a redefine just below you cannot use *this*
|
||||
* build of the library with the compiler you are using. *This* build was
|
||||
* build using Watcom and applications must also be built using Watcom!
|
||||
*/
|
||||
# define PNGCAPI __watcall
|
||||
# endif
|
||||
|
||||
# if defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 800))
|
||||
# define PNGCAPI __cdecl
|
||||
# if PNG_API_RULE == 1
|
||||
/* If this line results in an error __stdcall is not understood and
|
||||
* PNG_API_RULE should not have been set to '1'.
|
||||
*/
|
||||
/* If this line results in an error __stdcall is not understood and
|
||||
* PNG_API_RULE should not have been set to '1'.
|
||||
*/
|
||||
# define PNGAPI __stdcall
|
||||
# endif
|
||||
# else
|
||||
/* An older compiler, or one not detected (erroneously) above,
|
||||
* if necessary override on the command line to get the correct
|
||||
* variants for the compiler.
|
||||
*/
|
||||
/* An older compiler, or one not detected (erroneously) above,
|
||||
* if necessary override on the command line to get the correct
|
||||
* variants for the compiler.
|
||||
*/
|
||||
# ifndef PNGCAPI
|
||||
# define PNGCAPI _cdecl
|
||||
# endif
|
||||
@@ -215,25 +238,36 @@
|
||||
# define PNGAPI _stdcall
|
||||
# endif
|
||||
# endif /* compiler/api */
|
||||
|
||||
/* NOTE: PNGCBAPI always defaults to PNGCAPI. */
|
||||
|
||||
# if defined(PNGAPI) && !defined(PNG_USER_PRIVATEBUILD)
|
||||
# error PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed
|
||||
# error "PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed"
|
||||
# endif
|
||||
|
||||
# define PNG_DLL_EXPORT __declspec(dllexport)
|
||||
# ifndef PNG_DLL_IMPORT
|
||||
# define PNG_DLL_IMPORT __declspec(dllimport)
|
||||
# endif
|
||||
# if (defined(_MSC_VER) && _MSC_VER < 800) ||\
|
||||
(defined(__BORLANDC__) && __BORLANDC__ < 0x500)
|
||||
/* older Borland and MSC
|
||||
* compilers used '__export' and required this to be after
|
||||
* the type.
|
||||
*/
|
||||
# ifndef PNG_EXPORT_TYPE
|
||||
# define PNG_EXPORT_TYPE(type) type PNG_IMPEXP
|
||||
# endif
|
||||
# define PNG_DLL_EXPORT __export
|
||||
# else /* newer compiler */
|
||||
# define PNG_DLL_EXPORT __declspec(dllexport)
|
||||
# ifndef PNG_DLL_IMPORT
|
||||
# define PNG_DLL_IMPORT __declspec(dllimport)
|
||||
# endif
|
||||
# endif /* compiler */
|
||||
|
||||
#else /* !Windows */
|
||||
# if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)
|
||||
# define PNGAPI _System
|
||||
# else /* !Windows/x86 && !OS/2 */
|
||||
/* Use the defaults, or define PNG*API on the command line (but
|
||||
* this will have to be done for every compile!)
|
||||
*/
|
||||
/* Use the defaults, or define PNG*API on the command line (but
|
||||
* this will have to be done for every compile!)
|
||||
*/
|
||||
# endif /* other system, !OS/2 */
|
||||
#endif /* !Windows/x86 */
|
||||
|
||||
@@ -254,7 +288,7 @@
|
||||
*/
|
||||
#ifndef PNG_IMPEXP
|
||||
# if defined(PNG_USE_DLL) && defined(PNG_DLL_IMPORT)
|
||||
/* This forces use of a DLL, disallowing static linking */
|
||||
/* This forces use of a DLL, disallowing static linking */
|
||||
# define PNG_IMPEXP PNG_DLL_IMPORT
|
||||
# endif
|
||||
|
||||
@@ -282,11 +316,11 @@
|
||||
* table entries, so we discard it here. See the .dfn files in the
|
||||
* scripts directory.
|
||||
*/
|
||||
|
||||
#ifndef PNG_EXPORTA
|
||||
# define PNG_EXPORTA(ordinal, type, name, args, attributes) \
|
||||
PNG_FUNCTION(PNG_EXPORT_TYPE(type), (PNGAPI name), args, \
|
||||
PNG_LINKAGE_API attributes)
|
||||
|
||||
# define PNG_EXPORTA(ordinal, type, name, args, attributes)\
|
||||
PNG_FUNCTION(PNG_EXPORT_TYPE(type),(PNGAPI name),PNGARG(args), \
|
||||
extern attributes)
|
||||
#endif
|
||||
|
||||
/* ANSI-C (C90) does not permit a macro to be invoked with an empty argument,
|
||||
@@ -294,7 +328,7 @@
|
||||
*/
|
||||
#define PNG_EMPTY /*empty list*/
|
||||
|
||||
#define PNG_EXPORT(ordinal, type, name, args) \
|
||||
#define PNG_EXPORT(ordinal, type, name, args)\
|
||||
PNG_EXPORTA(ordinal, type, name, args, PNG_EMPTY)
|
||||
|
||||
/* Use PNG_REMOVED to comment out a removed interface. */
|
||||
@@ -303,7 +337,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef PNG_CALLBACK
|
||||
# define PNG_CALLBACK(type, name, args) type (PNGCBAPI name) args
|
||||
# define PNG_CALLBACK(type, name, args) type (PNGCBAPI name) PNGARG(args)
|
||||
#endif
|
||||
|
||||
/* Support for compiler specific function attributes. These are used
|
||||
@@ -326,33 +360,7 @@
|
||||
* version 1.2.41. Disabling these removes the warnings but may also produce
|
||||
* less efficient code.
|
||||
*/
|
||||
# if defined(__clang__) && defined(__has_attribute)
|
||||
/* Clang defines both __clang__ and __GNUC__. Check __clang__ first. */
|
||||
# if !defined(PNG_USE_RESULT) && __has_attribute(__warn_unused_result__)
|
||||
# define PNG_USE_RESULT __attribute__((__warn_unused_result__))
|
||||
# endif
|
||||
# if !defined(PNG_NORETURN) && __has_attribute(__noreturn__)
|
||||
# define PNG_NORETURN __attribute__((__noreturn__))
|
||||
# endif
|
||||
# if !defined(PNG_ALLOCATED) && __has_attribute(__malloc__)
|
||||
# define PNG_ALLOCATED __attribute__((__malloc__))
|
||||
# endif
|
||||
# if !defined(PNG_DEPRECATED) && __has_attribute(__deprecated__)
|
||||
# define PNG_DEPRECATED __attribute__((__deprecated__))
|
||||
# endif
|
||||
# if !defined(PNG_PRIVATE)
|
||||
# ifdef __has_extension
|
||||
# if __has_extension(attribute_unavailable_with_message)
|
||||
# define PNG_PRIVATE __attribute__((__unavailable__(\
|
||||
"This function is not exported by libpng.")))
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# ifndef PNG_RESTRICT
|
||||
# define PNG_RESTRICT __restrict
|
||||
# endif
|
||||
|
||||
# elif defined(__GNUC__)
|
||||
# if defined(__GNUC__)
|
||||
# ifndef PNG_USE_RESULT
|
||||
# define PNG_USE_RESULT __attribute__((__warn_unused_result__))
|
||||
# endif
|
||||
@@ -375,12 +383,12 @@
|
||||
__attribute__((__deprecated__))
|
||||
# endif
|
||||
# endif
|
||||
# if ((__GNUC__ > 3) || !defined(__GNUC_MINOR__) || (__GNUC_MINOR__ >= 1))
|
||||
# if ((__GNUC__ != 3) || !defined(__GNUC_MINOR__) || (__GNUC_MINOR__ >= 1))
|
||||
# ifndef PNG_RESTRICT
|
||||
# define PNG_RESTRICT __restrict
|
||||
# endif
|
||||
# endif /* __GNUC__.__GNUC_MINOR__ > 3.0 */
|
||||
# endif /* __GNUC__ >= 3 */
|
||||
# endif /* __GNUC__ == 3.0 */
|
||||
# endif /* __GNUC__ >= 3 */
|
||||
|
||||
# elif defined(_MSC_VER) && (_MSC_VER >= 1300)
|
||||
# ifndef PNG_USE_RESULT
|
||||
@@ -410,7 +418,7 @@
|
||||
# ifndef PNG_RESTRICT
|
||||
# define PNG_RESTRICT __restrict
|
||||
# endif
|
||||
# endif
|
||||
# endif /* _MSC_VER */
|
||||
#endif /* PNG_PEDANTIC_WARNINGS */
|
||||
|
||||
#ifndef PNG_DEPRECATED
|
||||
@@ -431,7 +439,6 @@
|
||||
#ifndef PNG_RESTRICT
|
||||
# define PNG_RESTRICT /* The C99 "restrict" feature */
|
||||
#endif
|
||||
|
||||
#ifndef PNG_FP_EXPORT /* A floating point API. */
|
||||
# ifdef PNG_FLOATING_POINT_SUPPORTED
|
||||
# define PNG_FP_EXPORT(ordinal, type, name, args)\
|
||||
@@ -467,7 +474,7 @@
|
||||
#if CHAR_BIT == 8 && UCHAR_MAX == 255
|
||||
typedef unsigned char png_byte;
|
||||
#else
|
||||
# error libpng requires 8-bit bytes
|
||||
# error "libpng requires 8 bit bytes"
|
||||
#endif
|
||||
|
||||
#if INT_MIN == -32768 && INT_MAX == 32767
|
||||
@@ -475,7 +482,7 @@
|
||||
#elif SHRT_MIN == -32768 && SHRT_MAX == 32767
|
||||
typedef short png_int_16;
|
||||
#else
|
||||
# error libpng requires a signed 16-bit integer type
|
||||
# error "libpng requires a signed 16 bit type"
|
||||
#endif
|
||||
|
||||
#if UINT_MAX == 65535
|
||||
@@ -483,7 +490,7 @@
|
||||
#elif USHRT_MAX == 65535
|
||||
typedef unsigned short png_uint_16;
|
||||
#else
|
||||
# error libpng requires an unsigned 16-bit integer type
|
||||
# error "libpng requires an unsigned 16 bit type"
|
||||
#endif
|
||||
|
||||
#if INT_MIN < -2147483646 && INT_MAX > 2147483646
|
||||
@@ -491,21 +498,19 @@
|
||||
#elif LONG_MIN < -2147483646 && LONG_MAX > 2147483646
|
||||
typedef long int png_int_32;
|
||||
#else
|
||||
# error libpng requires a signed 32-bit (or longer) integer type
|
||||
# error "libpng requires a signed 32 bit (or more) type"
|
||||
#endif
|
||||
|
||||
#if UINT_MAX > 4294967294U
|
||||
#if UINT_MAX > 4294967294
|
||||
typedef unsigned int png_uint_32;
|
||||
#elif ULONG_MAX > 4294967294U
|
||||
#elif ULONG_MAX > 4294967294
|
||||
typedef unsigned long int png_uint_32;
|
||||
#else
|
||||
# error libpng requires an unsigned 32-bit (or longer) integer type
|
||||
# error "libpng requires an unsigned 32 bit (or more) type"
|
||||
#endif
|
||||
|
||||
/* Prior to 1.6.0, it was possible to disable the use of size_t and ptrdiff_t.
|
||||
* From 1.6.0 onwards, an ISO C90 compiler, as well as a standard-compliant
|
||||
* behavior of sizeof and ptrdiff_t are required.
|
||||
* The legacy typedefs are provided here for backwards compatibility.
|
||||
/* Prior to 1.6.0 it was possible to disable the use of size_t, 1.6.0, however,
|
||||
* requires an ISOC90 compiler and relies on consistent behavior of sizeof.
|
||||
*/
|
||||
typedef size_t png_size_t;
|
||||
typedef ptrdiff_t png_ptrdiff_t;
|
||||
@@ -526,12 +531,13 @@ typedef ptrdiff_t png_ptrdiff_t;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* png_alloc_size_t is guaranteed to be no smaller than size_t, and no smaller
|
||||
* than png_uint_32. Casts from size_t or png_uint_32 to png_alloc_size_t are
|
||||
* not necessary; in fact, it is recommended not to use them at all, so that
|
||||
* the compiler can complain when something turns out to be problematic.
|
||||
/* png_alloc_size_t is guaranteed to be no smaller than png_size_t, and no
|
||||
* smaller than png_uint_32. Casts from png_size_t or png_uint_32 to
|
||||
* png_alloc_size_t are not necessary; in fact, it is recommended not to use
|
||||
* them at all so that the compiler can complain when something turns out to be
|
||||
* problematic.
|
||||
*
|
||||
* Casts in the other direction (from png_alloc_size_t to size_t or
|
||||
* Casts in the other direction (from png_alloc_size_t to png_size_t or
|
||||
* png_uint_32) should be explicitly applied; however, we do not expect to
|
||||
* encounter practical situations that require such conversions.
|
||||
*
|
||||
@@ -541,7 +547,7 @@ typedef ptrdiff_t png_ptrdiff_t;
|
||||
#ifdef PNG_SMALL_SIZE_T
|
||||
typedef png_uint_32 png_alloc_size_t;
|
||||
#else
|
||||
typedef size_t png_alloc_size_t;
|
||||
typedef png_size_t png_alloc_size_t;
|
||||
#endif
|
||||
|
||||
/* Prior to 1.6.0 libpng offered limited support for Microsoft C compiler
|
||||
@@ -577,8 +583,12 @@ typedef char * png_charp;
|
||||
typedef const char * png_const_charp;
|
||||
typedef png_fixed_point * png_fixed_point_p;
|
||||
typedef const png_fixed_point * png_const_fixed_point_p;
|
||||
typedef size_t * png_size_tp;
|
||||
typedef const size_t * png_const_size_tp;
|
||||
typedef png_size_t * png_size_tp;
|
||||
typedef const png_size_t * png_const_size_tp;
|
||||
|
||||
#ifdef PNG_STDIO_SUPPORTED
|
||||
typedef FILE * png_FILE_p;
|
||||
#endif
|
||||
|
||||
#ifdef PNG_FLOATING_POINT_SUPPORTED
|
||||
typedef double * png_doublep;
|
||||
@@ -601,15 +611,6 @@ typedef double * * png_doublepp;
|
||||
/* Pointers to pointers to pointers; i.e., pointer to array */
|
||||
typedef char * * * png_charppp;
|
||||
|
||||
#ifdef PNG_STDIO_SUPPORTED
|
||||
/* With PNG_STDIO_SUPPORTED it was possible to use I/O streams that were
|
||||
* not necessarily stdio FILE streams, to allow building Windows applications
|
||||
* before Win32 and Windows CE applications before WinCE 3.0, but that kind
|
||||
* of support has long been discontinued.
|
||||
*/
|
||||
typedef FILE * png_FILE_p; /* [Deprecated] */
|
||||
#endif
|
||||
|
||||
#endif /* PNG_BUILDING_SYMBOL_TABLE */
|
||||
|
||||
#endif /* PNGCONF_H */
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
/* pngdebug.h - internal debugging macros for libpng
|
||||
|
||||
/* pngdebug.h - Debugging macros for libpng, also used in pngtest.c
|
||||
*
|
||||
* Copyright (c) 2018-2025 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2013 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*
|
||||
* Last changed in libpng 1.5.0 [January 6, 2011]
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
* and license in png.h
|
||||
*/
|
||||
|
||||
#ifndef PNGPRIV_H
|
||||
# error This file must not be included by applications; please include <png.h>
|
||||
#endif
|
||||
|
||||
/* Define PNG_DEBUG at compile time for debugging information. Higher
|
||||
* numbers for PNG_DEBUG mean more debugging information. This has
|
||||
* only been added since version 0.95 so it is not implemented throughout
|
||||
@@ -27,7 +25,7 @@
|
||||
* (actually ((void)0)).
|
||||
*
|
||||
* level: level of detail of message, starting at 0. A level 'n'
|
||||
* message is preceded by 'n' 3-space indentations (not implemented
|
||||
* message is preceded by 'n' tab characters (not implemented
|
||||
* on Microsoft compilers unless PNG_DEBUG_FILE is also
|
||||
* defined, to allow debug DLL compilation with no standard IO).
|
||||
* message: a printf(3) style text string. A trailing '\n' is added
|
||||
@@ -38,6 +36,9 @@
|
||||
#define PNGDEBUG_H
|
||||
/* These settings control the formatting of messages in png.c and pngerror.c */
|
||||
/* Moved to pngdebug.h at 1.5.0 */
|
||||
# ifndef PNG_LITERAL_SHARP
|
||||
# define PNG_LITERAL_SHARP 0x23
|
||||
# endif
|
||||
# ifndef PNG_LITERAL_LEFT_SQUARE_BRACKET
|
||||
# define PNG_LITERAL_LEFT_SQUARE_BRACKET 0x5b
|
||||
# endif
|
||||
@@ -76,29 +77,32 @@
|
||||
# endif /* PNG_DEBUG_FILE */
|
||||
|
||||
# if (PNG_DEBUG > 1)
|
||||
/* Note: ["%s"m PNG_STRING_NEWLINE] probably does not work on
|
||||
* non-ISO compilers
|
||||
*/
|
||||
# ifdef __STDC__
|
||||
# ifndef png_debug
|
||||
# define png_debug(l,m) \
|
||||
do { \
|
||||
int num_tabs=l; \
|
||||
fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? " " : \
|
||||
(num_tabs==2 ? " " : (num_tabs>2 ? " " : "")))); \
|
||||
fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
|
||||
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":"")))); \
|
||||
} while (0)
|
||||
# endif
|
||||
# ifndef png_debug1
|
||||
# define png_debug1(l,m,p1) \
|
||||
do { \
|
||||
int num_tabs=l; \
|
||||
fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? " " : \
|
||||
(num_tabs==2 ? " " : (num_tabs>2 ? " " : ""))),p1); \
|
||||
fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
|
||||
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1); \
|
||||
} while (0)
|
||||
# endif
|
||||
# ifndef png_debug2
|
||||
# define png_debug2(l,m,p1,p2) \
|
||||
do { \
|
||||
int num_tabs=l; \
|
||||
fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? " " : \
|
||||
(num_tabs==2 ? " " : (num_tabs>2 ? " " : ""))),p1,p2);\
|
||||
fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
|
||||
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1,p2); \
|
||||
} while (0)
|
||||
# endif
|
||||
# else /* __STDC __ */
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
|
||||
/* pngerror.c - stub functions for i/o and memory allocation
|
||||
*
|
||||
* Copyright (c) 2018-2025 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Last changed in libpng 1.6.1 [March 28, 2013]
|
||||
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
@@ -19,15 +20,14 @@
|
||||
|
||||
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
|
||||
|
||||
static PNG_FUNCTION(void /* PRIVATE */,
|
||||
png_default_error,(png_const_structrp png_ptr, png_const_charp error_message),
|
||||
PNG_NORETURN);
|
||||
static PNG_FUNCTION(void, png_default_error,PNGARG((png_const_structrp png_ptr,
|
||||
png_const_charp error_message)),PNG_NORETURN);
|
||||
|
||||
#ifdef PNG_WARNINGS_SUPPORTED
|
||||
static void /* PRIVATE */
|
||||
png_default_warning(png_const_structrp png_ptr,
|
||||
png_const_charp warning_message);
|
||||
#endif /* WARNINGS */
|
||||
png_default_warning PNGARG((png_const_structrp png_ptr,
|
||||
png_const_charp warning_message));
|
||||
#endif /* PNG_WARNINGS_SUPPORTED */
|
||||
|
||||
/* This function is called whenever there is a fatal error. This function
|
||||
* should not be changed. If there is a need to handle errors differently,
|
||||
@@ -37,8 +37,48 @@ png_default_warning(png_const_structrp png_ptr,
|
||||
#ifdef PNG_ERROR_TEXT_SUPPORTED
|
||||
PNG_FUNCTION(void,PNGAPI
|
||||
png_error,(png_const_structrp png_ptr, png_const_charp error_message),
|
||||
PNG_NORETURN)
|
||||
PNG_NORETURN)
|
||||
{
|
||||
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
|
||||
char msg[16];
|
||||
if (png_ptr != NULL)
|
||||
{
|
||||
if (png_ptr->flags&
|
||||
(PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT))
|
||||
{
|
||||
if (*error_message == PNG_LITERAL_SHARP)
|
||||
{
|
||||
/* Strip "#nnnn " from beginning of error message. */
|
||||
int offset;
|
||||
for (offset = 1; offset<15; offset++)
|
||||
if (error_message[offset] == ' ')
|
||||
break;
|
||||
|
||||
if (png_ptr->flags&PNG_FLAG_STRIP_ERROR_TEXT)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < offset - 1; i++)
|
||||
msg[i] = error_message[i + 1];
|
||||
msg[i - 1] = '\0';
|
||||
error_message = msg;
|
||||
}
|
||||
|
||||
else
|
||||
error_message += offset;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if (png_ptr->flags&PNG_FLAG_STRIP_ERROR_TEXT)
|
||||
{
|
||||
msg[0] = '0';
|
||||
msg[1] = '\0';
|
||||
error_message = msg;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (png_ptr != NULL && png_ptr->error_fn != NULL)
|
||||
(*(png_ptr->error_fn))(png_constcast(png_structrp,png_ptr),
|
||||
error_message);
|
||||
@@ -49,8 +89,7 @@ png_error,(png_const_structrp png_ptr, png_const_charp error_message),
|
||||
}
|
||||
#else
|
||||
PNG_FUNCTION(void,PNGAPI
|
||||
png_err,(png_const_structrp png_ptr),
|
||||
PNG_NORETURN)
|
||||
png_err,(png_const_structrp png_ptr),PNG_NORETURN)
|
||||
{
|
||||
/* Prior to 1.5.2 the error_fn received a NULL pointer, expressed
|
||||
* erroneously as '\0', instead of the empty string "". This was
|
||||
@@ -64,14 +103,14 @@ png_err,(png_const_structrp png_ptr),
|
||||
use the default handler, which will not return. */
|
||||
png_default_error(png_ptr, "");
|
||||
}
|
||||
#endif /* ERROR_TEXT */
|
||||
#endif /* PNG_ERROR_TEXT_SUPPORTED */
|
||||
|
||||
/* Utility to safely appends strings to a buffer. This never errors out so
|
||||
* error checking is not required in the caller.
|
||||
*/
|
||||
size_t
|
||||
png_safecat(png_charp buffer, size_t bufsize, size_t pos,
|
||||
png_const_charp string)
|
||||
png_const_charp string)
|
||||
{
|
||||
if (buffer != NULL && pos < bufsize)
|
||||
{
|
||||
@@ -92,7 +131,7 @@ png_safecat(png_charp buffer, size_t bufsize, size_t pos,
|
||||
*/
|
||||
png_charp
|
||||
png_format_number(png_const_charp start, png_charp end, int format,
|
||||
png_alloc_size_t number)
|
||||
png_alloc_size_t number)
|
||||
{
|
||||
int count = 0; /* number of digits output */
|
||||
int mincount = 1; /* minimum number required */
|
||||
@@ -113,7 +152,7 @@ png_format_number(png_const_charp start, png_charp end, int format,
|
||||
case PNG_NUMBER_FORMAT_fixed:
|
||||
/* Needs five digits (the fraction) */
|
||||
mincount = 5;
|
||||
if (output != 0 || number % 10 != 0)
|
||||
if (output || number % 10 != 0)
|
||||
{
|
||||
*--end = digits[number % 10];
|
||||
output = 1;
|
||||
@@ -124,7 +163,7 @@ png_format_number(png_const_charp start, png_charp end, int format,
|
||||
case PNG_NUMBER_FORMAT_02u:
|
||||
/* Expects at least 2 digits. */
|
||||
mincount = 2;
|
||||
/* FALLTHROUGH */
|
||||
/* FALL THROUGH */
|
||||
|
||||
case PNG_NUMBER_FORMAT_u:
|
||||
*--end = digits[number % 10];
|
||||
@@ -134,7 +173,7 @@ png_format_number(png_const_charp start, png_charp end, int format,
|
||||
case PNG_NUMBER_FORMAT_02x:
|
||||
/* This format expects at least two digits */
|
||||
mincount = 2;
|
||||
/* FALLTHROUGH */
|
||||
/* FALL THROUGH */
|
||||
|
||||
case PNG_NUMBER_FORMAT_x:
|
||||
*--end = digits[number & 0xf];
|
||||
@@ -150,13 +189,13 @@ png_format_number(png_const_charp start, png_charp end, int format,
|
||||
++count;
|
||||
|
||||
/* Float a fixed number here: */
|
||||
if ((format == PNG_NUMBER_FORMAT_fixed) && (count == 5) && (end > start))
|
||||
if (format == PNG_NUMBER_FORMAT_fixed) if (count == 5) if (end > start)
|
||||
{
|
||||
/* End of the fraction, but maybe nothing was output? In that case
|
||||
* drop the decimal point. If the number is a true zero handle that
|
||||
* here.
|
||||
*/
|
||||
if (output != 0)
|
||||
if (output)
|
||||
*--end = '.';
|
||||
else if (number == 0) /* and !output */
|
||||
*--end = '0';
|
||||
@@ -177,9 +216,24 @@ void PNGAPI
|
||||
png_warning(png_const_structrp png_ptr, png_const_charp warning_message)
|
||||
{
|
||||
int offset = 0;
|
||||
if (png_ptr != NULL)
|
||||
{
|
||||
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
|
||||
if (png_ptr->flags&
|
||||
(PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT))
|
||||
#endif
|
||||
{
|
||||
if (*warning_message == PNG_LITERAL_SHARP)
|
||||
{
|
||||
for (offset = 1; offset < 15; offset++)
|
||||
if (warning_message[offset] == ' ')
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (png_ptr != NULL && png_ptr->warning_fn != NULL)
|
||||
(*(png_ptr->warning_fn))(png_constcast(png_structrp,png_ptr),
|
||||
warning_message + offset);
|
||||
warning_message + offset);
|
||||
else
|
||||
png_default_warning(png_ptr, warning_message + offset);
|
||||
}
|
||||
@@ -191,7 +245,7 @@ png_warning(png_const_structrp png_ptr, png_const_charp warning_message)
|
||||
*/
|
||||
void
|
||||
png_warning_parameter(png_warning_parameters p, int number,
|
||||
png_const_charp string)
|
||||
png_const_charp string)
|
||||
{
|
||||
if (number > 0 && number <= PNG_WARNING_PARAMETER_COUNT)
|
||||
(void)png_safecat(p[number-1], (sizeof p[number-1]), 0, string);
|
||||
@@ -199,19 +253,19 @@ png_warning_parameter(png_warning_parameters p, int number,
|
||||
|
||||
void
|
||||
png_warning_parameter_unsigned(png_warning_parameters p, int number, int format,
|
||||
png_alloc_size_t value)
|
||||
png_alloc_size_t value)
|
||||
{
|
||||
char buffer[PNG_NUMBER_BUFFER_SIZE] = {0};
|
||||
char buffer[PNG_NUMBER_BUFFER_SIZE];
|
||||
png_warning_parameter(p, number, PNG_FORMAT_NUMBER(buffer, format, value));
|
||||
}
|
||||
|
||||
void
|
||||
png_warning_parameter_signed(png_warning_parameters p, int number, int format,
|
||||
png_int_32 value)
|
||||
png_int_32 value)
|
||||
{
|
||||
png_alloc_size_t u;
|
||||
png_charp str;
|
||||
char buffer[PNG_NUMBER_BUFFER_SIZE] = {0};
|
||||
char buffer[PNG_NUMBER_BUFFER_SIZE];
|
||||
|
||||
/* Avoid overflow by doing the negate in a png_alloc_size_t: */
|
||||
u = (png_alloc_size_t)value;
|
||||
@@ -228,7 +282,7 @@ png_warning_parameter_signed(png_warning_parameters p, int number, int format,
|
||||
|
||||
void
|
||||
png_formatted_warning(png_const_structrp png_ptr, png_warning_parameters p,
|
||||
png_const_charp message)
|
||||
png_const_charp message)
|
||||
{
|
||||
/* The internal buffer is just 192 bytes - enough for all our messages,
|
||||
* overflow doesn't happen because this code checks! If someone figures
|
||||
@@ -301,13 +355,13 @@ png_formatted_warning(png_const_structrp png_ptr, png_warning_parameters p,
|
||||
*/
|
||||
png_warning(png_ptr, msg);
|
||||
}
|
||||
#endif /* WARNINGS */
|
||||
#endif /* PNG_WARNINGS_SUPPORTED */
|
||||
|
||||
#ifdef PNG_BENIGN_ERRORS_SUPPORTED
|
||||
void PNGAPI
|
||||
png_benign_error(png_const_structrp png_ptr, png_const_charp error_message)
|
||||
{
|
||||
if ((png_ptr->flags & PNG_FLAG_BENIGN_ERRORS_WARN) != 0)
|
||||
if (png_ptr->flags & PNG_FLAG_BENIGN_ERRORS_WARN)
|
||||
{
|
||||
# ifdef PNG_READ_SUPPORTED
|
||||
if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0 &&
|
||||
@@ -328,57 +382,44 @@ png_benign_error(png_const_structrp png_ptr, png_const_charp error_message)
|
||||
# endif
|
||||
png_error(png_ptr, error_message);
|
||||
}
|
||||
|
||||
# ifndef PNG_ERROR_TEXT_SUPPORTED
|
||||
PNG_UNUSED(error_message)
|
||||
# endif
|
||||
}
|
||||
|
||||
void /* PRIVATE */
|
||||
png_app_warning(png_const_structrp png_ptr, png_const_charp error_message)
|
||||
{
|
||||
if ((png_ptr->flags & PNG_FLAG_APP_WARNINGS_WARN) != 0)
|
||||
png_warning(png_ptr, error_message);
|
||||
else
|
||||
png_error(png_ptr, error_message);
|
||||
|
||||
# ifndef PNG_ERROR_TEXT_SUPPORTED
|
||||
PNG_UNUSED(error_message)
|
||||
# endif
|
||||
if (png_ptr->flags & PNG_FLAG_APP_WARNINGS_WARN)
|
||||
png_warning(png_ptr, error_message);
|
||||
else
|
||||
png_error(png_ptr, error_message);
|
||||
}
|
||||
|
||||
void /* PRIVATE */
|
||||
png_app_error(png_const_structrp png_ptr, png_const_charp error_message)
|
||||
{
|
||||
if ((png_ptr->flags & PNG_FLAG_APP_ERRORS_WARN) != 0)
|
||||
png_warning(png_ptr, error_message);
|
||||
else
|
||||
png_error(png_ptr, error_message);
|
||||
|
||||
# ifndef PNG_ERROR_TEXT_SUPPORTED
|
||||
PNG_UNUSED(error_message)
|
||||
# endif
|
||||
if (png_ptr->flags & PNG_FLAG_APP_ERRORS_WARN)
|
||||
png_warning(png_ptr, error_message);
|
||||
else
|
||||
png_error(png_ptr, error_message);
|
||||
}
|
||||
#endif /* BENIGN_ERRORS */
|
||||
|
||||
#define PNG_MAX_ERROR_TEXT 196 /* Currently limited by profile_error in png.c */
|
||||
#if defined(PNG_WARNINGS_SUPPORTED) || \
|
||||
(defined(PNG_READ_SUPPORTED) && defined(PNG_ERROR_TEXT_SUPPORTED))
|
||||
/* These utilities are used internally to build an error message that relates
|
||||
* to the current chunk. The chunk name comes from png_ptr->chunk_name,
|
||||
* which is used to prefix the message. The message is limited in length
|
||||
* to 63 bytes. The name characters are output as hex digits wrapped in []
|
||||
* this is used to prefix the message. The message is limited in length
|
||||
* to 63 bytes, the name characters are output as hex digits wrapped in []
|
||||
* if the character is invalid.
|
||||
*/
|
||||
#define isnonalpha(c) ((c) < 65 || (c) > 122 || ((c) > 90 && (c) < 97))
|
||||
static const char png_digit[16] = {
|
||||
static PNG_CONST char png_digit[16] = {
|
||||
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
|
||||
'A', 'B', 'C', 'D', 'E', 'F'
|
||||
};
|
||||
|
||||
#define PNG_MAX_ERROR_TEXT 196 /* Currently limited be profile_error in png.c */
|
||||
#if defined(PNG_WARNINGS_SUPPORTED) || defined(PNG_ERROR_TEXT_SUPPORTED)
|
||||
static void /* PRIVATE */
|
||||
png_format_buffer(png_const_structrp png_ptr, png_charp buffer,
|
||||
png_const_charp error_message)
|
||||
png_format_buffer(png_const_structrp png_ptr, png_charp buffer, png_const_charp
|
||||
error_message)
|
||||
{
|
||||
png_uint_32 chunk_name = png_ptr->chunk_name;
|
||||
int iout = 0, ishift = 24;
|
||||
@@ -388,7 +429,7 @@ png_format_buffer(png_const_structrp png_ptr, png_charp buffer,
|
||||
int c = (int)(chunk_name >> ishift) & 0xff;
|
||||
|
||||
ishift -= 8;
|
||||
if (isnonalpha(c) != 0)
|
||||
if (isnonalpha(c))
|
||||
{
|
||||
buffer[iout++] = PNG_LITERAL_LEFT_SQUARE_BRACKET;
|
||||
buffer[iout++] = png_digit[(c & 0xf0) >> 4];
|
||||
@@ -419,12 +460,12 @@ png_format_buffer(png_const_structrp png_ptr, png_charp buffer,
|
||||
buffer[iout] = '\0';
|
||||
}
|
||||
}
|
||||
#endif /* WARNINGS || ERROR_TEXT */
|
||||
#endif /* PNG_WARNINGS_SUPPORTED || PNG_ERROR_TEXT_SUPPORTED */
|
||||
|
||||
#if defined(PNG_READ_SUPPORTED) && defined(PNG_ERROR_TEXT_SUPPORTED)
|
||||
PNG_FUNCTION(void,PNGAPI
|
||||
png_chunk_error,(png_const_structrp png_ptr, png_const_charp error_message),
|
||||
PNG_NORETURN)
|
||||
PNG_NORETURN)
|
||||
{
|
||||
char msg[18+PNG_MAX_ERROR_TEXT];
|
||||
if (png_ptr == NULL)
|
||||
@@ -436,7 +477,7 @@ png_chunk_error,(png_const_structrp png_ptr, png_const_charp error_message),
|
||||
png_error(png_ptr, msg);
|
||||
}
|
||||
}
|
||||
#endif /* READ && ERROR_TEXT */
|
||||
#endif /* PNG_READ_SUPPORTED && PNG_ERROR_TEXT_SUPPORTED */
|
||||
|
||||
#ifdef PNG_WARNINGS_SUPPORTED
|
||||
void PNGAPI
|
||||
@@ -452,39 +493,31 @@ png_chunk_warning(png_const_structrp png_ptr, png_const_charp warning_message)
|
||||
png_warning(png_ptr, msg);
|
||||
}
|
||||
}
|
||||
#endif /* WARNINGS */
|
||||
#endif /* PNG_WARNINGS_SUPPORTED */
|
||||
|
||||
#ifdef PNG_READ_SUPPORTED
|
||||
#ifdef PNG_BENIGN_ERRORS_SUPPORTED
|
||||
void PNGAPI
|
||||
png_chunk_benign_error(png_const_structrp png_ptr,
|
||||
png_const_charp error_message)
|
||||
png_chunk_benign_error(png_const_structrp png_ptr, png_const_charp
|
||||
error_message)
|
||||
{
|
||||
if ((png_ptr->flags & PNG_FLAG_BENIGN_ERRORS_WARN) != 0)
|
||||
if (png_ptr->flags & PNG_FLAG_BENIGN_ERRORS_WARN)
|
||||
png_chunk_warning(png_ptr, error_message);
|
||||
|
||||
else
|
||||
png_chunk_error(png_ptr, error_message);
|
||||
|
||||
# ifndef PNG_ERROR_TEXT_SUPPORTED
|
||||
PNG_UNUSED(error_message)
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
#endif /* READ */
|
||||
#endif /* PNG_READ_SUPPORTED */
|
||||
|
||||
void /* PRIVATE */
|
||||
png_chunk_report(png_const_structrp png_ptr, png_const_charp message, int error)
|
||||
{
|
||||
# ifndef PNG_WARNINGS_SUPPORTED
|
||||
PNG_UNUSED(message)
|
||||
# endif
|
||||
|
||||
/* This is always supported, but for just read or just write it
|
||||
* unconditionally does the right thing.
|
||||
*/
|
||||
# if defined(PNG_READ_SUPPORTED) && defined(PNG_WRITE_SUPPORTED)
|
||||
if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0)
|
||||
if (png_ptr->mode & PNG_IS_READ_STRUCT)
|
||||
# endif
|
||||
|
||||
# ifdef PNG_READ_SUPPORTED
|
||||
@@ -498,7 +531,7 @@ png_chunk_report(png_const_structrp png_ptr, png_const_charp message, int error)
|
||||
# endif
|
||||
|
||||
# if defined(PNG_READ_SUPPORTED) && defined(PNG_WRITE_SUPPORTED)
|
||||
else if ((png_ptr->mode & PNG_IS_READ_STRUCT) == 0)
|
||||
else if (!(png_ptr->mode & PNG_IS_READ_STRUCT))
|
||||
# endif
|
||||
|
||||
# ifdef PNG_WRITE_SUPPORTED
|
||||
@@ -515,21 +548,19 @@ png_chunk_report(png_const_structrp png_ptr, png_const_charp message, int error)
|
||||
#ifdef PNG_ERROR_TEXT_SUPPORTED
|
||||
#ifdef PNG_FLOATING_POINT_SUPPORTED
|
||||
PNG_FUNCTION(void,
|
||||
png_fixed_error,(png_const_structrp png_ptr, png_const_charp name),
|
||||
PNG_NORETURN)
|
||||
png_fixed_error,(png_const_structrp png_ptr, png_const_charp name),PNG_NORETURN)
|
||||
{
|
||||
# define fixed_message "fixed point overflow in "
|
||||
# define fixed_message_ln ((sizeof fixed_message)-1)
|
||||
unsigned int iin;
|
||||
int iin;
|
||||
char msg[fixed_message_ln+PNG_MAX_ERROR_TEXT];
|
||||
memcpy(msg, fixed_message, fixed_message_ln);
|
||||
iin = 0;
|
||||
if (name != NULL)
|
||||
while (iin < (PNG_MAX_ERROR_TEXT-1) && name[iin] != 0)
|
||||
{
|
||||
msg[fixed_message_ln + iin] = name[iin];
|
||||
++iin;
|
||||
}
|
||||
if (name != NULL) while (iin < (PNG_MAX_ERROR_TEXT-1) && name[iin] != 0)
|
||||
{
|
||||
msg[fixed_message_ln + iin] = name[iin];
|
||||
++iin;
|
||||
}
|
||||
msg[fixed_message_ln + iin] = 0;
|
||||
png_error(png_ptr, msg);
|
||||
}
|
||||
@@ -567,7 +598,7 @@ png_set_longjmp_fn(png_structrp png_ptr, png_longjmp_ptr longjmp_fn,
|
||||
else
|
||||
{
|
||||
png_ptr->jmp_buf_ptr = png_voidcast(jmp_buf *,
|
||||
png_malloc_warn(png_ptr, jmp_buf_size));
|
||||
png_malloc_warn(png_ptr, jmp_buf_size));
|
||||
|
||||
if (png_ptr->jmp_buf_ptr == NULL)
|
||||
return NULL; /* new NULL return on OOM */
|
||||
@@ -656,12 +687,45 @@ png_free_jmpbuf(png_structrp png_ptr)
|
||||
*/
|
||||
static PNG_FUNCTION(void /* PRIVATE */,
|
||||
png_default_error,(png_const_structrp png_ptr, png_const_charp error_message),
|
||||
PNG_NORETURN)
|
||||
PNG_NORETURN)
|
||||
{
|
||||
#ifdef PNG_CONSOLE_IO_SUPPORTED
|
||||
fprintf(stderr, "libpng error: %s", error_message ? error_message :
|
||||
"undefined");
|
||||
fprintf(stderr, PNG_STRING_NEWLINE);
|
||||
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
|
||||
/* Check on NULL only added in 1.5.4 */
|
||||
if (error_message != NULL && *error_message == PNG_LITERAL_SHARP)
|
||||
{
|
||||
/* Strip "#nnnn " from beginning of error message. */
|
||||
int offset;
|
||||
char error_number[16];
|
||||
for (offset = 0; offset<15; offset++)
|
||||
{
|
||||
error_number[offset] = error_message[offset + 1];
|
||||
if (error_message[offset] == ' ')
|
||||
break;
|
||||
}
|
||||
|
||||
if ((offset > 1) && (offset < 15))
|
||||
{
|
||||
error_number[offset - 1] = '\0';
|
||||
fprintf(stderr, "libpng error no. %s: %s",
|
||||
error_number, error_message + offset + 1);
|
||||
fprintf(stderr, PNG_STRING_NEWLINE);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "libpng error: %s, offset=%d",
|
||||
error_message, offset);
|
||||
fprintf(stderr, PNG_STRING_NEWLINE);
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
fprintf(stderr, "libpng error: %s", error_message ? error_message :
|
||||
"undefined");
|
||||
fprintf(stderr, PNG_STRING_NEWLINE);
|
||||
}
|
||||
#else
|
||||
PNG_UNUSED(error_message) /* Make compiler happy */
|
||||
#endif
|
||||
@@ -669,24 +733,14 @@ png_default_error,(png_const_structrp png_ptr, png_const_charp error_message),
|
||||
}
|
||||
|
||||
PNG_FUNCTION(void,PNGAPI
|
||||
png_longjmp,(png_const_structrp png_ptr, int val),
|
||||
PNG_NORETURN)
|
||||
png_longjmp,(png_const_structrp png_ptr, int val),PNG_NORETURN)
|
||||
{
|
||||
#ifdef PNG_SETJMP_SUPPORTED
|
||||
if (png_ptr != NULL && png_ptr->longjmp_fn != NULL &&
|
||||
png_ptr->jmp_buf_ptr != NULL)
|
||||
if (png_ptr && png_ptr->longjmp_fn && png_ptr->jmp_buf_ptr)
|
||||
png_ptr->longjmp_fn(*png_ptr->jmp_buf_ptr, val);
|
||||
#else
|
||||
PNG_UNUSED(png_ptr)
|
||||
PNG_UNUSED(val)
|
||||
#endif
|
||||
|
||||
/* If control reaches this point, png_longjmp() must not return. The only
|
||||
* choice is to terminate the whole process (or maybe the thread); to do
|
||||
* this the ANSI-C abort() function is used unless a different method is
|
||||
* implemented by overriding the default configuration setting for
|
||||
* PNG_ABORT().
|
||||
*/
|
||||
/* Here if not setjmp support or if png_ptr is null. */
|
||||
PNG_ABORT();
|
||||
}
|
||||
|
||||
@@ -700,14 +754,46 @@ static void /* PRIVATE */
|
||||
png_default_warning(png_const_structrp png_ptr, png_const_charp warning_message)
|
||||
{
|
||||
#ifdef PNG_CONSOLE_IO_SUPPORTED
|
||||
fprintf(stderr, "libpng warning: %s", warning_message);
|
||||
fprintf(stderr, PNG_STRING_NEWLINE);
|
||||
# ifdef PNG_ERROR_NUMBERS_SUPPORTED
|
||||
if (*warning_message == PNG_LITERAL_SHARP)
|
||||
{
|
||||
int offset;
|
||||
char warning_number[16];
|
||||
for (offset = 0; offset < 15; offset++)
|
||||
{
|
||||
warning_number[offset] = warning_message[offset + 1];
|
||||
if (warning_message[offset] == ' ')
|
||||
break;
|
||||
}
|
||||
|
||||
if ((offset > 1) && (offset < 15))
|
||||
{
|
||||
warning_number[offset + 1] = '\0';
|
||||
fprintf(stderr, "libpng warning no. %s: %s",
|
||||
warning_number, warning_message + offset);
|
||||
fprintf(stderr, PNG_STRING_NEWLINE);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "libpng warning: %s",
|
||||
warning_message);
|
||||
fprintf(stderr, PNG_STRING_NEWLINE);
|
||||
}
|
||||
}
|
||||
else
|
||||
# endif
|
||||
|
||||
{
|
||||
fprintf(stderr, "libpng warning: %s", warning_message);
|
||||
fprintf(stderr, PNG_STRING_NEWLINE);
|
||||
}
|
||||
#else
|
||||
PNG_UNUSED(warning_message) /* Make compiler happy */
|
||||
#endif
|
||||
PNG_UNUSED(png_ptr) /* Make compiler happy */
|
||||
}
|
||||
#endif /* WARNINGS */
|
||||
#endif /* PNG_WARNINGS_SUPPORTED */
|
||||
|
||||
/* This function is called when the application wants to use another method
|
||||
* of handling errors and warnings. Note that the error function MUST NOT
|
||||
@@ -741,7 +827,7 @@ png_get_error_ptr(png_const_structrp png_ptr)
|
||||
if (png_ptr == NULL)
|
||||
return NULL;
|
||||
|
||||
return (png_voidp)png_ptr->error_ptr;
|
||||
return ((png_voidp)png_ptr->error_ptr);
|
||||
}
|
||||
|
||||
|
||||
@@ -749,8 +835,12 @@ png_get_error_ptr(png_const_structrp png_ptr)
|
||||
void PNGAPI
|
||||
png_set_strip_error_numbers(png_structrp png_ptr, png_uint_32 strip_mode)
|
||||
{
|
||||
PNG_UNUSED(png_ptr)
|
||||
PNG_UNUSED(strip_mode)
|
||||
if (png_ptr != NULL)
|
||||
{
|
||||
png_ptr->flags &=
|
||||
((~(PNG_FLAG_STRIP_ERROR_NUMBERS |
|
||||
PNG_FLAG_STRIP_ERROR_TEXT))&strip_mode);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -760,11 +850,11 @@ png_set_strip_error_numbers(png_structrp png_ptr, png_uint_32 strip_mode)
|
||||
* possible to implement without setjmp support just so long as there is some
|
||||
* way to handle the error return here:
|
||||
*/
|
||||
PNG_FUNCTION(void /* PRIVATE */, (PNGCBAPI
|
||||
png_safe_error),(png_structp png_nonconst_ptr, png_const_charp error_message),
|
||||
PNG_NORETURN)
|
||||
PNG_FUNCTION(void /* PRIVATE */,
|
||||
png_safe_error,(png_structp png_nonconst_ptr, png_const_charp error_message),
|
||||
PNG_NORETURN)
|
||||
{
|
||||
png_const_structrp png_ptr = png_nonconst_ptr;
|
||||
const png_const_structrp png_ptr = png_nonconst_ptr;
|
||||
png_imagep image = png_voidcast(png_imagep, png_ptr->error_ptr);
|
||||
|
||||
/* An error is always logged here, overwriting anything (typically a warning)
|
||||
@@ -785,7 +875,7 @@ png_safe_error),(png_structp png_nonconst_ptr, png_const_charp error_message),
|
||||
/* Missing longjmp buffer, the following is to help debugging: */
|
||||
{
|
||||
size_t pos = png_safecat(image->message, (sizeof image->message), 0,
|
||||
"bad longjmp: ");
|
||||
"bad longjmp: ");
|
||||
png_safecat(image->message, (sizeof image->message), pos,
|
||||
error_message);
|
||||
}
|
||||
@@ -796,10 +886,10 @@ png_safe_error),(png_structp png_nonconst_ptr, png_const_charp error_message),
|
||||
}
|
||||
|
||||
#ifdef PNG_WARNINGS_SUPPORTED
|
||||
void /* PRIVATE */ PNGCBAPI
|
||||
void /* PRIVATE */
|
||||
png_safe_warning(png_structp png_nonconst_ptr, png_const_charp warning_message)
|
||||
{
|
||||
png_const_structrp png_ptr = png_nonconst_ptr;
|
||||
const png_const_structrp png_ptr = png_nonconst_ptr;
|
||||
png_imagep image = png_voidcast(png_imagep, png_ptr->error_ptr);
|
||||
|
||||
/* A warning is only logged if there is no prior warning or error. */
|
||||
@@ -812,39 +902,31 @@ png_safe_warning(png_structp png_nonconst_ptr, png_const_charp warning_message)
|
||||
#endif
|
||||
|
||||
int /* PRIVATE */
|
||||
png_safe_execute(png_imagep image, int (*function)(png_voidp), png_voidp arg)
|
||||
png_safe_execute(png_imagep image_in, int (*function)(png_voidp), png_voidp arg)
|
||||
{
|
||||
const png_voidp saved_error_buf = image->opaque->error_buf;
|
||||
volatile png_imagep image = image_in;
|
||||
volatile int result;
|
||||
volatile png_voidp saved_error_buf;
|
||||
jmp_buf safe_jmpbuf;
|
||||
|
||||
/* Safely execute function(arg), with png_error returning back here. */
|
||||
if (setjmp(safe_jmpbuf) == 0)
|
||||
/* Safely execute function(arg) with png_error returning to this function. */
|
||||
saved_error_buf = image->opaque->error_buf;
|
||||
result = setjmp(safe_jmpbuf) == 0;
|
||||
|
||||
if (result)
|
||||
{
|
||||
int result;
|
||||
|
||||
image->opaque->error_buf = safe_jmpbuf;
|
||||
result = function(arg);
|
||||
image->opaque->error_buf = saved_error_buf;
|
||||
|
||||
if (result)
|
||||
return 1; /* success */
|
||||
}
|
||||
|
||||
/* The function failed either because of a caught png_error and a regular
|
||||
* return of false above or because of an uncaught png_error from the
|
||||
* function itself. Ensure that the error_buf is always set back to the
|
||||
* value saved above:
|
||||
*/
|
||||
image->opaque->error_buf = saved_error_buf;
|
||||
|
||||
/* On the final false return, when about to return control to the caller, the
|
||||
* image is freed (png_image_free does this check but it is duplicated here
|
||||
* for clarity:
|
||||
*/
|
||||
if (saved_error_buf == NULL)
|
||||
/* And do the cleanup prior to any failure return. */
|
||||
if (!result)
|
||||
png_image_free(image);
|
||||
|
||||
return 0; /* failure */
|
||||
return result;
|
||||
}
|
||||
#endif /* SIMPLIFIED READ || SIMPLIFIED_WRITE */
|
||||
#endif /* READ || WRITE */
|
||||
#endif /* SIMPLIFIED READ/WRITE */
|
||||
#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,29 +1,54 @@
|
||||
/* pnginfo.h - internal structures for libpng
|
||||
|
||||
/* pnginfo.h - header file for PNG reference library
|
||||
*
|
||||
* Copyright (c) 2018-2025 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2013,2018 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*
|
||||
* Last changed in libpng 1.6.1 [March 28, 2013]
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
* and license in png.h
|
||||
*/
|
||||
|
||||
#ifndef PNGPRIV_H
|
||||
# error This file must not be included by applications; please include <png.h>
|
||||
#endif
|
||||
|
||||
/* INTERNAL, PRIVATE definition of a PNG.
|
||||
/* png_info is a structure that holds the information in a PNG file so
|
||||
* that the application can find out the characteristics of the image.
|
||||
* If you are reading the file, this structure will tell you what is
|
||||
* in the PNG file. If you are writing the file, fill in the information
|
||||
* you want to put into the PNG file, using png_set_*() functions, then
|
||||
* call png_write_info().
|
||||
*
|
||||
* png_info is a modifiable description of a PNG datastream. The fields inside
|
||||
* this structure are accessed through png_get_<CHUNK>() functions and modified
|
||||
* using png_set_<CHUNK>() functions.
|
||||
* The names chosen should be very close to the PNG specification, so
|
||||
* consult that document for information about the meaning of each field.
|
||||
*
|
||||
* Some functions in libpng do directly access members of png_info. However,
|
||||
* this should be avoided. png_struct objects contain members which hold
|
||||
* caches, sometimes optimised, of the values from png_info objects, and
|
||||
* png_info is not passed to the functions which read and write image data.
|
||||
* With libpng < 0.95, it was only possible to directly set and read the
|
||||
* the values in the png_info_struct, which meant that the contents and
|
||||
* order of the values had to remain fixed. With libpng 0.95 and later,
|
||||
* however, there are now functions that abstract the contents of
|
||||
* png_info_struct from the application, so this makes it easier to use
|
||||
* libpng with dynamic libraries, and even makes it possible to use
|
||||
* libraries that don't have all of the libpng ancillary chunk-handing
|
||||
* functionality. In libpng-1.5.0 this was moved into a separate private
|
||||
* file that is not visible to applications.
|
||||
*
|
||||
* The following members may have allocated storage attached that should be
|
||||
* cleaned up before the structure is discarded: palette, trans, text,
|
||||
* pcal_purpose, pcal_units, pcal_params, hist, iccp_name, iccp_profile,
|
||||
* splt_palettes, scal_unit, row_pointers, and unknowns. By default, these
|
||||
* are automatically freed when the info structure is deallocated, if they were
|
||||
* allocated internally by libpng. This behavior can be changed by means
|
||||
* of the png_data_freer() function.
|
||||
*
|
||||
* More allocation details: all the chunk-reading functions that
|
||||
* change these members go through the corresponding png_set_*
|
||||
* functions. A function to clear these members is available: see
|
||||
* png_free_data(). The png_set_* functions do not depend on being
|
||||
* able to point info structure members to any of the storage they are
|
||||
* passed (they make their own copies), EXCEPT that the png_set_text
|
||||
* functions use the same storage passed to them in the text_ptr or
|
||||
* itxt_ptr structure argument, and the png_set_rows and png_set_unknowns
|
||||
* functions do not make their own copies.
|
||||
*/
|
||||
#ifndef PNGINFO_H
|
||||
#define PNGINFO_H
|
||||
@@ -31,10 +56,10 @@
|
||||
struct png_info_def
|
||||
{
|
||||
/* The following are necessary for every PNG file */
|
||||
png_uint_32 width; /* width of image in pixels (from IHDR) */
|
||||
png_uint_32 height; /* height of image in pixels (from IHDR) */
|
||||
png_uint_32 valid; /* valid chunk data (see PNG_INFO_ below) */
|
||||
size_t rowbytes; /* bytes needed to hold an untransformed row */
|
||||
png_uint_32 width; /* width of image in pixels (from IHDR) */
|
||||
png_uint_32 height; /* height of image in pixels (from IHDR) */
|
||||
png_uint_32 valid; /* valid chunk data (see PNG_INFO_ below) */
|
||||
png_size_t rowbytes; /* bytes needed to hold an untransformed row */
|
||||
png_colorp palette; /* array of color values (valid & PNG_INFO_PLTE) */
|
||||
png_uint_16 num_palette; /* number of color entries in "palette" (PLTE) */
|
||||
png_uint_16 num_trans; /* number of transparent palette color (tRNS) */
|
||||
@@ -63,12 +88,18 @@ struct png_info_def
|
||||
* and initialize the appropriate fields below.
|
||||
*/
|
||||
|
||||
#ifdef PNG_cICP_SUPPORTED
|
||||
/* cICP chunk data */
|
||||
png_byte cicp_colour_primaries;
|
||||
png_byte cicp_transfer_function;
|
||||
png_byte cicp_matrix_coefficients;
|
||||
png_byte cicp_video_full_range_flag;
|
||||
#if defined(PNG_COLORSPACE_SUPPORTED) || defined(PNG_GAMMA_SUPPORTED)
|
||||
/* png_colorspace only contains 'flags' if neither GAMMA or COLORSPACE are
|
||||
* defined. When COLORSPACE is switched on all the colorspace-defining
|
||||
* chunks should be enabled, when GAMMA is switched on all the gamma-defining
|
||||
* chunks should be enabled. If this is not done it becomes possible to read
|
||||
* inconsistent PNG files and assign a probably incorrect interpretation to
|
||||
* the information. (In other words, by carefully choosing which chunks to
|
||||
* recognize the system configuration can select an interpretation for PNG
|
||||
* files containing ambiguous data and this will result in inconsistent
|
||||
* behavior between different libpng builds!)
|
||||
*/
|
||||
png_colorspace colorspace;
|
||||
#endif
|
||||
|
||||
#ifdef PNG_iCCP_SUPPORTED
|
||||
@@ -78,24 +109,6 @@ struct png_info_def
|
||||
png_uint_32 iccp_proflen; /* ICC profile data length */
|
||||
#endif
|
||||
|
||||
#ifdef PNG_cLLI_SUPPORTED
|
||||
png_uint_32 maxCLL; /* cd/m2 (nits) * 10,000 */
|
||||
png_uint_32 maxFALL;
|
||||
#endif
|
||||
|
||||
#ifdef PNG_mDCV_SUPPORTED
|
||||
png_uint_16 mastering_red_x; /* CIE (xy) x * 50,000 */
|
||||
png_uint_16 mastering_red_y;
|
||||
png_uint_16 mastering_green_x;
|
||||
png_uint_16 mastering_green_y;
|
||||
png_uint_16 mastering_blue_x;
|
||||
png_uint_16 mastering_blue_y;
|
||||
png_uint_16 mastering_white_x;
|
||||
png_uint_16 mastering_white_y;
|
||||
png_uint_32 mastering_maxDL; /* cd/m2 (nits) * 10,000 */
|
||||
png_uint_32 mastering_minDL;
|
||||
#endif
|
||||
|
||||
#ifdef PNG_TEXT_SUPPORTED
|
||||
/* The tEXt, and zTXt chunks contain human-readable textual data in
|
||||
* uncompressed, compressed, and optionally compressed forms, respectively.
|
||||
@@ -108,7 +121,7 @@ struct png_info_def
|
||||
int num_text; /* number of comments read or comments to write */
|
||||
int max_text; /* current size of text array */
|
||||
png_textp text; /* array of comments read or comments to write */
|
||||
#endif /* TEXT */
|
||||
#endif /* PNG_TEXT_SUPPORTED */
|
||||
|
||||
#ifdef PNG_tIME_SUPPORTED
|
||||
/* The tIME chunk holds the last time the displayed image data was
|
||||
@@ -173,11 +186,6 @@ defined(PNG_READ_BACKGROUND_SUPPORTED)
|
||||
png_byte phys_unit_type; /* resolution type (see PNG_RESOLUTION_ below) */
|
||||
#endif
|
||||
|
||||
#ifdef PNG_eXIf_SUPPORTED
|
||||
png_uint_32 num_exif; /* Added at libpng-1.6.31 */
|
||||
png_bytep exif;
|
||||
#endif
|
||||
|
||||
#ifdef PNG_hIST_SUPPORTED
|
||||
/* The hIST chunk contains the relative frequency or importance of the
|
||||
* various palette entries, so that a viewer can intelligently select a
|
||||
@@ -216,7 +224,7 @@ defined(PNG_READ_BACKGROUND_SUPPORTED)
|
||||
/* Storage for unknown chunks that the library doesn't recognize. */
|
||||
png_unknown_chunkp unknown_chunks;
|
||||
|
||||
/* The type of this field is limited by the type of
|
||||
/* The type of this field is limited by the type of
|
||||
* png_struct::user_chunk_cache_max, else overflow can occur.
|
||||
*/
|
||||
int unknown_chunks_num;
|
||||
@@ -232,7 +240,7 @@ defined(PNG_READ_BACKGROUND_SUPPORTED)
|
||||
/* The sCAL chunk describes the actual physical dimensions of the
|
||||
* subject matter of the graphic. The chunk contains a unit specification
|
||||
* a byte value, and two ASCII strings representing floating-point
|
||||
* values. The values are width and height corresponding to one pixel
|
||||
* values. The values are width and height corresponsing to one pixel
|
||||
* in the image. Data values are valid if (valid & PNG_INFO_sCAL) is
|
||||
* non-zero.
|
||||
*/
|
||||
@@ -248,16 +256,5 @@ defined(PNG_READ_BACKGROUND_SUPPORTED)
|
||||
png_bytepp row_pointers; /* the image bits */
|
||||
#endif
|
||||
|
||||
#ifdef PNG_cHRM_SUPPORTED
|
||||
png_xy cHRM;
|
||||
#endif
|
||||
|
||||
#ifdef PNG_gAMA_SUPPORTED
|
||||
png_fixed_point gamma;
|
||||
#endif
|
||||
|
||||
#ifdef PNG_sRGB_SUPPORTED
|
||||
int rendering_intent;
|
||||
#endif
|
||||
};
|
||||
#endif /* PNGINFO_H */
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
/* libpng 1.6.2 STANDARD API DEFINITION */
|
||||
|
||||
/* pnglibconf.h - library build configuration */
|
||||
|
||||
/* libpng version 1.6.55 */
|
||||
/* Libpng version 1.6.2 - April 25, 2013 */
|
||||
|
||||
/* Copyright (c) 2018-2026 Cosmin Truta */
|
||||
/* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson */
|
||||
/* Copyright (c) 1998-2013 Glenn Randers-Pehrson */
|
||||
|
||||
/* This code is released under the libpng license. */
|
||||
/* For conditions of distribution and use, see the disclaimer */
|
||||
@@ -19,6 +20,7 @@
|
||||
#define PNG_ALIGNED_MEMORY_SUPPORTED
|
||||
/*#undef PNG_ARM_NEON_API_SUPPORTED*/
|
||||
/*#undef PNG_ARM_NEON_CHECK_SUPPORTED*/
|
||||
/*#undef PNG_ARM_NEON_SUPPORTED*/
|
||||
#define PNG_BENIGN_ERRORS_SUPPORTED
|
||||
#define PNG_BENIGN_READ_ERRORS_SUPPORTED
|
||||
/*#undef PNG_BENIGN_WRITE_ERRORS_SUPPORTED*/
|
||||
@@ -27,7 +29,6 @@
|
||||
#define PNG_COLORSPACE_SUPPORTED
|
||||
//#define PNG_CONSOLE_IO_SUPPORTED
|
||||
#define PNG_CONVERT_tIME_SUPPORTED
|
||||
/*#undef PNG_DISABLE_ADLER32_CHECK_SUPPORTED*/
|
||||
#define PNG_EASY_ACCESS_SUPPORTED
|
||||
/*#undef PNG_ERROR_NUMBERS_SUPPORTED*/
|
||||
#define PNG_ERROR_TEXT_SUPPORTED
|
||||
@@ -42,14 +43,8 @@
|
||||
#define PNG_INCH_CONVERSIONS_SUPPORTED
|
||||
#define PNG_INFO_IMAGE_SUPPORTED
|
||||
#define PNG_IO_STATE_SUPPORTED
|
||||
/*#undef PNG_MIPS_MMI_API_SUPPORTED*/
|
||||
/*#undef PNG_MIPS_MMI_CHECK_SUPPORTED*/
|
||||
/*#undef PNG_MIPS_MSA_API_SUPPORTED*/
|
||||
/*#undef PNG_MIPS_MSA_CHECK_SUPPORTED*/
|
||||
#define PNG_MNG_FEATURES_SUPPORTED
|
||||
#define PNG_POINTER_INDEXING_SUPPORTED
|
||||
/*#undef PNG_POWERPC_VSX_API_SUPPORTED*/
|
||||
/*#undef PNG_POWERPC_VSX_CHECK_SUPPORTED*/
|
||||
#define PNG_PROGRESSIVE_READ_SUPPORTED
|
||||
#define PNG_READ_16BIT_SUPPORTED
|
||||
#define PNG_READ_ALPHA_MODE_SUPPORTED
|
||||
@@ -88,14 +83,10 @@
|
||||
#define PNG_READ_USER_TRANSFORM_SUPPORTED
|
||||
#define PNG_READ_bKGD_SUPPORTED
|
||||
#define PNG_READ_cHRM_SUPPORTED
|
||||
#define PNG_READ_cICP_SUPPORTED
|
||||
#define PNG_READ_cLLI_SUPPORTED
|
||||
#define PNG_READ_eXIf_SUPPORTED
|
||||
#define PNG_READ_gAMA_SUPPORTED
|
||||
#define PNG_READ_hIST_SUPPORTED
|
||||
#define PNG_READ_iCCP_SUPPORTED
|
||||
#define PNG_READ_iTXt_SUPPORTED
|
||||
#define PNG_READ_mDCV_SUPPORTED
|
||||
#define PNG_READ_oFFs_SUPPORTED
|
||||
#define PNG_READ_pCAL_SUPPORTED
|
||||
#define PNG_READ_pHYs_SUPPORTED
|
||||
@@ -107,11 +98,14 @@
|
||||
#define PNG_READ_tIME_SUPPORTED
|
||||
#define PNG_READ_tRNS_SUPPORTED
|
||||
#define PNG_READ_zTXt_SUPPORTED
|
||||
/*#undef PNG_SAFE_LIMITS_SUPPORTED*/
|
||||
#define PNG_SAVE_INT_32_SUPPORTED
|
||||
#define PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED
|
||||
#define PNG_SEQUENTIAL_READ_SUPPORTED
|
||||
#define PNG_SETJMP_SUPPORTED
|
||||
#define PNG_SET_OPTION_SUPPORTED
|
||||
#define PNG_SET_CHUNK_CACHE_LIMIT_SUPPORTED
|
||||
#define PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED
|
||||
/*#undef PNG_SET_OPTION_SUPPORTED*/
|
||||
#define PNG_SET_UNKNOWN_CHUNKS_SUPPORTED
|
||||
#define PNG_SET_USER_LIMITS_SUPPORTED
|
||||
#define PNG_SIMPLIFIED_READ_AFIRST_SUPPORTED
|
||||
@@ -119,7 +113,6 @@
|
||||
#define PNG_SIMPLIFIED_READ_SUPPORTED
|
||||
#define PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED
|
||||
#define PNG_SIMPLIFIED_WRITE_BGR_SUPPORTED
|
||||
#define PNG_SIMPLIFIED_WRITE_STDIO_SUPPORTED
|
||||
#define PNG_SIMPLIFIED_WRITE_SUPPORTED
|
||||
#define PNG_STDIO_SUPPORTED
|
||||
#define PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED
|
||||
@@ -137,7 +130,6 @@
|
||||
#define PNG_WRITE_BGR_SUPPORTED
|
||||
#define PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED
|
||||
#define PNG_WRITE_COMPRESSED_TEXT_SUPPORTED
|
||||
#define PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED
|
||||
#define PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED
|
||||
#define PNG_WRITE_FILLER_SUPPORTED
|
||||
#define PNG_WRITE_FILTER_SUPPORTED
|
||||
@@ -161,14 +153,10 @@
|
||||
#define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
|
||||
#define PNG_WRITE_bKGD_SUPPORTED
|
||||
#define PNG_WRITE_cHRM_SUPPORTED
|
||||
#define PNG_WRITE_cICP_SUPPORTED
|
||||
#define PNG_WRITE_cLLI_SUPPORTED
|
||||
#define PNG_WRITE_eXIf_SUPPORTED
|
||||
#define PNG_WRITE_gAMA_SUPPORTED
|
||||
#define PNG_WRITE_hIST_SUPPORTED
|
||||
#define PNG_WRITE_iCCP_SUPPORTED
|
||||
#define PNG_WRITE_iTXt_SUPPORTED
|
||||
#define PNG_WRITE_mDCV_SUPPORTED
|
||||
#define PNG_WRITE_oFFs_SUPPORTED
|
||||
#define PNG_WRITE_pCAL_SUPPORTED
|
||||
#define PNG_WRITE_pHYs_SUPPORTED
|
||||
@@ -182,14 +170,10 @@
|
||||
#define PNG_WRITE_zTXt_SUPPORTED
|
||||
#define PNG_bKGD_SUPPORTED
|
||||
#define PNG_cHRM_SUPPORTED
|
||||
#define PNG_cICP_SUPPORTED
|
||||
#define PNG_cLLI_SUPPORTED
|
||||
#define PNG_eXIf_SUPPORTED
|
||||
#define PNG_gAMA_SUPPORTED
|
||||
#define PNG_hIST_SUPPORTED
|
||||
#define PNG_iCCP_SUPPORTED
|
||||
#define PNG_iTXt_SUPPORTED
|
||||
#define PNG_mDCV_SUPPORTED
|
||||
#define PNG_oFFs_SUPPORTED
|
||||
#define PNG_pCAL_SUPPORTED
|
||||
#define PNG_pHYs_SUPPORTED
|
||||
@@ -204,30 +188,24 @@
|
||||
/* end of options */
|
||||
/* settings */
|
||||
#define PNG_API_RULE 0
|
||||
#define PNG_CALLOC_SUPPORTED
|
||||
#define PNG_COST_SHIFT 3
|
||||
#define PNG_DEFAULT_READ_MACROS 1
|
||||
#define PNG_GAMMA_THRESHOLD_FIXED 5000
|
||||
#define PNG_IDAT_READ_SIZE PNG_ZBUF_SIZE
|
||||
#define PNG_INFLATE_BUF_SIZE 1024
|
||||
#define PNG_LINKAGE_API extern
|
||||
#define PNG_LINKAGE_CALLBACK extern
|
||||
#define PNG_LINKAGE_DATA extern
|
||||
#define PNG_LINKAGE_FUNCTION extern
|
||||
#define PNG_MAX_GAMMA_8 11
|
||||
#define PNG_QUANTIZE_BLUE_BITS 5
|
||||
#define PNG_QUANTIZE_GREEN_BITS 5
|
||||
#define PNG_QUANTIZE_RED_BITS 5
|
||||
#define PNG_TEXT_Z_DEFAULT_COMPRESSION (-1)
|
||||
#define PNG_TEXT_Z_DEFAULT_STRATEGY 0
|
||||
#define PNG_USER_CHUNK_CACHE_MAX 1000
|
||||
#define PNG_USER_CHUNK_MALLOC_MAX 8000000
|
||||
#define PNG_USER_HEIGHT_MAX 1000000
|
||||
#define PNG_USER_WIDTH_MAX 1000000
|
||||
#define PNG_WEIGHT_SHIFT 8
|
||||
#define PNG_ZBUF_SIZE 8192
|
||||
#define PNG_ZLIB_VERNUM 0 /* unknown */
|
||||
#define PNG_Z_DEFAULT_COMPRESSION (-1)
|
||||
#define PNG_Z_DEFAULT_NOFILTER_STRATEGY 0
|
||||
#define PNG_Z_DEFAULT_STRATEGY 1
|
||||
#define PNG_sCAL_PRECISION 5
|
||||
#define PNG_sRGB_PROFILE_CHECKS 2
|
||||
/* end of settings */
|
||||
#endif /* PNGLCONF_H */
|
||||
#endif /* PNGLCONF_H */
|
||||
@@ -1,9 +1,10 @@
|
||||
|
||||
/* pngmem.c - stub functions for memory allocation
|
||||
*
|
||||
* Copyright (c) 2018-2025 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2014,2016 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Last changed in libpng 1.6.0 [February 14, 2013]
|
||||
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
@@ -40,14 +41,13 @@ png_destroy_png_struct(png_structrp png_ptr)
|
||||
}
|
||||
|
||||
/* Allocate memory. For reasonable files, size should never exceed
|
||||
* 64K. However, zlib may allocate more than 64K if you don't tell
|
||||
* 64K. However, zlib may allocate more then 64K if you don't tell
|
||||
* it not to. See zconf.h and png.h for more information. zlib does
|
||||
* need to allocate exactly 64K, so whatever you call here must
|
||||
* have the ability to do that.
|
||||
*/
|
||||
PNG_FUNCTION(png_voidp,PNGAPI
|
||||
png_calloc,(png_const_structrp png_ptr, png_alloc_size_t size),
|
||||
PNG_ALLOCATED)
|
||||
png_calloc,(png_const_structrp png_ptr, png_alloc_size_t size),PNG_ALLOCATED)
|
||||
{
|
||||
png_voidp ret;
|
||||
|
||||
@@ -66,49 +66,44 @@ png_calloc,(png_const_structrp png_ptr, png_alloc_size_t size),
|
||||
*/
|
||||
PNG_FUNCTION(png_voidp /* PRIVATE */,
|
||||
png_malloc_base,(png_const_structrp png_ptr, png_alloc_size_t size),
|
||||
PNG_ALLOCATED)
|
||||
PNG_ALLOCATED)
|
||||
{
|
||||
/* Moved to png_malloc_base from png_malloc_default in 1.6.0; the DOS
|
||||
* allocators have also been removed in 1.6.0, so any 16-bit system now has
|
||||
* to implement a user memory handler. This checks to be sure it isn't
|
||||
* called with big numbers.
|
||||
*/
|
||||
# ifdef PNG_MAX_MALLOC_64K
|
||||
/* This is support for legacy systems which had segmented addressing
|
||||
* limiting the maximum allocation size to 65536. It takes precedence
|
||||
* over PNG_SIZE_MAX which is set to 65535 on true 16-bit systems.
|
||||
*
|
||||
* TODO: libpng-1.8: finally remove both cases.
|
||||
*/
|
||||
if (size > 65536U) return NULL;
|
||||
# endif
|
||||
|
||||
/* This is checked too because the system malloc call below takes a (size_t).
|
||||
*/
|
||||
if (size > PNG_SIZE_MAX) return NULL;
|
||||
|
||||
# ifdef PNG_USER_MEM_SUPPORTED
|
||||
#ifdef PNG_USER_MEM_SUPPORTED
|
||||
PNG_UNUSED(png_ptr)
|
||||
#endif
|
||||
if (size > 0 && size <= PNG_SIZE_MAX
|
||||
# ifdef PNG_MAX_MALLOC_64K
|
||||
&& size <= 65536U
|
||||
# endif
|
||||
)
|
||||
{
|
||||
#ifdef PNG_USER_MEM_SUPPORTED
|
||||
if (png_ptr != NULL && png_ptr->malloc_fn != NULL)
|
||||
return png_ptr->malloc_fn(png_constcast(png_structrp,png_ptr), size);
|
||||
# else
|
||||
PNG_UNUSED(png_ptr)
|
||||
# endif
|
||||
|
||||
/* Use the system malloc */
|
||||
return malloc((size_t)/*SAFE*/size); /* checked for truncation above */
|
||||
else
|
||||
#endif
|
||||
return malloc((size_t)size); /* checked for truncation above */
|
||||
}
|
||||
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if defined(PNG_TEXT_SUPPORTED) || defined(PNG_sPLT_SUPPORTED) ||\
|
||||
defined(PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED)
|
||||
/* This is really here only to work round a spurious warning in GCC 4.6 and 4.7
|
||||
* that arises because of the checks in png_realloc_array that are repeated in
|
||||
* png_malloc_array.
|
||||
*/
|
||||
static png_voidp
|
||||
png_malloc_array_checked(png_const_structrp png_ptr, int nelements,
|
||||
size_t element_size)
|
||||
size_t element_size)
|
||||
{
|
||||
png_alloc_size_t req = (png_alloc_size_t)nelements; /* known to be > 0 */
|
||||
png_alloc_size_t req = nelements; /* known to be > 0 */
|
||||
|
||||
if (req <= PNG_SIZE_MAX/element_size)
|
||||
return png_malloc_base(png_ptr, req * element_size);
|
||||
@@ -119,8 +114,7 @@ png_malloc_array_checked(png_const_structrp png_ptr, int nelements,
|
||||
|
||||
PNG_FUNCTION(png_voidp /* PRIVATE */,
|
||||
png_malloc_array,(png_const_structrp png_ptr, int nelements,
|
||||
size_t element_size),
|
||||
PNG_ALLOCATED)
|
||||
size_t element_size),PNG_ALLOCATED)
|
||||
{
|
||||
if (nelements <= 0 || element_size == 0)
|
||||
png_error(png_ptr, "internal error: array alloc");
|
||||
@@ -130,8 +124,7 @@ png_malloc_array,(png_const_structrp png_ptr, int nelements,
|
||||
|
||||
PNG_FUNCTION(png_voidp /* PRIVATE */,
|
||||
png_realloc_array,(png_const_structrp png_ptr, png_const_voidp old_array,
|
||||
int old_elements, int add_elements, size_t element_size),
|
||||
PNG_ALLOCATED)
|
||||
int old_elements, int add_elements, size_t element_size),PNG_ALLOCATED)
|
||||
{
|
||||
/* These are internal errors: */
|
||||
if (add_elements <= 0 || element_size == 0 || old_elements < 0 ||
|
||||
@@ -144,7 +137,7 @@ png_realloc_array,(png_const_structrp png_ptr, png_const_voidp old_array,
|
||||
if (add_elements <= INT_MAX - old_elements)
|
||||
{
|
||||
png_voidp new_array = png_malloc_array_checked(png_ptr,
|
||||
old_elements+add_elements, element_size);
|
||||
old_elements+add_elements, element_size);
|
||||
|
||||
if (new_array != NULL)
|
||||
{
|
||||
@@ -155,7 +148,7 @@ png_realloc_array,(png_const_structrp png_ptr, png_const_voidp old_array,
|
||||
memcpy(new_array, old_array, element_size*(unsigned)old_elements);
|
||||
|
||||
memset((char*)new_array + element_size*(unsigned)old_elements, 0,
|
||||
element_size*(unsigned)add_elements);
|
||||
element_size*(unsigned)add_elements);
|
||||
|
||||
return new_array;
|
||||
}
|
||||
@@ -163,15 +156,13 @@ png_realloc_array,(png_const_structrp png_ptr, png_const_voidp old_array,
|
||||
|
||||
return NULL; /* error */
|
||||
}
|
||||
#endif /* TEXT || sPLT || STORE_UNKNOWN_CHUNKS */
|
||||
|
||||
/* Various functions that have different error handling are derived from this.
|
||||
* png_malloc always exists, but if PNG_USER_MEM_SUPPORTED is defined a separate
|
||||
* function png_malloc_default is also provided.
|
||||
*/
|
||||
PNG_FUNCTION(png_voidp,PNGAPI
|
||||
png_malloc,(png_const_structrp png_ptr, png_alloc_size_t size),
|
||||
PNG_ALLOCATED)
|
||||
png_malloc,(png_const_structrp png_ptr, png_alloc_size_t size),PNG_ALLOCATED)
|
||||
{
|
||||
png_voidp ret;
|
||||
|
||||
@@ -189,7 +180,7 @@ png_malloc,(png_const_structrp png_ptr, png_alloc_size_t size),
|
||||
#ifdef PNG_USER_MEM_SUPPORTED
|
||||
PNG_FUNCTION(png_voidp,PNGAPI
|
||||
png_malloc_default,(png_const_structrp png_ptr, png_alloc_size_t size),
|
||||
PNG_ALLOCATED PNG_DEPRECATED)
|
||||
PNG_ALLOCATED PNG_DEPRECATED)
|
||||
{
|
||||
png_voidp ret;
|
||||
|
||||
@@ -204,7 +195,7 @@ png_malloc_default,(png_const_structrp png_ptr, png_alloc_size_t size),
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif /* USER_MEM */
|
||||
#endif /* PNG_USER_MEM_SUPPORTED */
|
||||
|
||||
/* This function was added at libpng version 1.2.3. The png_malloc_warn()
|
||||
* function will issue a png_warning and return NULL instead of issuing a
|
||||
@@ -212,7 +203,7 @@ png_malloc_default,(png_const_structrp png_ptr, png_alloc_size_t size),
|
||||
*/
|
||||
PNG_FUNCTION(png_voidp,PNGAPI
|
||||
png_malloc_warn,(png_const_structrp png_ptr, png_alloc_size_t size),
|
||||
PNG_ALLOCATED)
|
||||
PNG_ALLOCATED)
|
||||
{
|
||||
if (png_ptr != NULL)
|
||||
{
|
||||
@@ -245,12 +236,11 @@ png_free(png_const_structrp png_ptr, png_voidp ptr)
|
||||
}
|
||||
|
||||
PNG_FUNCTION(void,PNGAPI
|
||||
png_free_default,(png_const_structrp png_ptr, png_voidp ptr),
|
||||
PNG_DEPRECATED)
|
||||
png_free_default,(png_const_structrp png_ptr, png_voidp ptr),PNG_DEPRECATED)
|
||||
{
|
||||
if (png_ptr == NULL || ptr == NULL)
|
||||
return;
|
||||
#endif /* USER_MEM */
|
||||
#endif /* PNG_USER_MEM_SUPPORTED */
|
||||
|
||||
free(ptr);
|
||||
}
|
||||
@@ -260,8 +250,8 @@ png_free_default,(png_const_structrp png_ptr, png_voidp ptr),
|
||||
* of allocating and freeing memory.
|
||||
*/
|
||||
void PNGAPI
|
||||
png_set_mem_fn(png_structrp png_ptr, png_voidp mem_ptr,
|
||||
png_malloc_ptr malloc_fn, png_free_ptr free_fn)
|
||||
png_set_mem_fn(png_structrp png_ptr, png_voidp mem_ptr, png_malloc_ptr
|
||||
malloc_fn, png_free_ptr free_fn)
|
||||
{
|
||||
if (png_ptr != NULL)
|
||||
{
|
||||
@@ -283,5 +273,5 @@ png_get_mem_ptr(png_const_structrp png_ptr)
|
||||
|
||||
return png_ptr->mem_ptr;
|
||||
}
|
||||
#endif /* USER_MEM */
|
||||
#endif /* READ || WRITE */
|
||||
#endif /* PNG_USER_MEM_SUPPORTED */
|
||||
#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
|
||||
/* pngpread.c - read a png file in push mode
|
||||
*
|
||||
* Copyright (c) 2018-2025 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Last changed in libpng 1.6.0 [February 14, 2013]
|
||||
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
@@ -18,37 +19,16 @@
|
||||
#define PNG_READ_SIG_MODE 0
|
||||
#define PNG_READ_CHUNK_MODE 1
|
||||
#define PNG_READ_IDAT_MODE 2
|
||||
#define PNG_SKIP_MODE 3
|
||||
#define PNG_READ_tEXt_MODE 4
|
||||
#define PNG_READ_zTXt_MODE 5
|
||||
#define PNG_READ_DONE_MODE 6
|
||||
#define PNG_READ_iTXt_MODE 7
|
||||
#define PNG_ERROR_MODE 8
|
||||
|
||||
#define PNG_PUSH_SAVE_BUFFER_IF_FULL \
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size) \
|
||||
{ png_push_save_buffer(png_ptr); return; }
|
||||
#define PNG_PUSH_SAVE_BUFFER_IF_LT(N) \
|
||||
if (png_ptr->buffer_size < N) \
|
||||
{ png_push_save_buffer(png_ptr); return; }
|
||||
|
||||
#ifdef PNG_READ_INTERLACING_SUPPORTED
|
||||
/* Arrays to facilitate interlacing - use pass (0 - 6) as index. */
|
||||
|
||||
/* Start of interlace block */
|
||||
static const png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};
|
||||
/* Offset to next interlace block */
|
||||
static const png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
|
||||
/* Start of interlace block in the y direction */
|
||||
static const png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1};
|
||||
/* Offset to next interlace block in the y direction */
|
||||
static const png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
|
||||
|
||||
/* TODO: Move these arrays to a common utility module to avoid duplication. */
|
||||
#endif
|
||||
|
||||
void PNGAPI
|
||||
png_process_data(png_structrp png_ptr, png_inforp info_ptr,
|
||||
png_bytep buffer, size_t buffer_size)
|
||||
png_bytep buffer, png_size_t buffer_size)
|
||||
{
|
||||
if (png_ptr == NULL || info_ptr == NULL)
|
||||
return;
|
||||
@@ -61,20 +41,20 @@ png_process_data(png_structrp png_ptr, png_inforp info_ptr,
|
||||
}
|
||||
}
|
||||
|
||||
size_t PNGAPI
|
||||
png_size_t PNGAPI
|
||||
png_process_data_pause(png_structrp png_ptr, int save)
|
||||
{
|
||||
if (png_ptr != NULL)
|
||||
{
|
||||
/* It's easiest for the caller if we do the save; then the caller doesn't
|
||||
/* It's easiest for the caller if we do the save, then the caller doesn't
|
||||
* have to supply the same data again:
|
||||
*/
|
||||
if (save != 0)
|
||||
if (save)
|
||||
png_push_save_buffer(png_ptr);
|
||||
else
|
||||
{
|
||||
/* This includes any pending saved bytes: */
|
||||
size_t remaining = png_ptr->buffer_size;
|
||||
png_size_t remaining = png_ptr->buffer_size;
|
||||
png_ptr->buffer_size = 0;
|
||||
|
||||
/* So subtract the saved buffer size, unless all the data
|
||||
@@ -91,14 +71,32 @@ png_process_data_pause(png_structrp png_ptr, int save)
|
||||
png_uint_32 PNGAPI
|
||||
png_process_data_skip(png_structrp png_ptr)
|
||||
{
|
||||
/* TODO: Deprecate and remove this API.
|
||||
* Somewhere the implementation of this seems to have been lost,
|
||||
* or abandoned. It was only to support some internal back-door access
|
||||
* to png_struct) in libpng-1.4.x.
|
||||
*/
|
||||
png_app_warning(png_ptr,
|
||||
"png_process_data_skip is not implemented in any current version of libpng");
|
||||
return 0;
|
||||
png_uint_32 remaining = 0;
|
||||
|
||||
if (png_ptr != NULL && png_ptr->process_mode == PNG_SKIP_MODE &&
|
||||
png_ptr->skip_length > 0)
|
||||
{
|
||||
/* At the end of png_process_data the buffer size must be 0 (see the loop
|
||||
* above) so we can detect a broken call here:
|
||||
*/
|
||||
if (png_ptr->buffer_size != 0)
|
||||
png_error(png_ptr,
|
||||
"png_process_data_skip called inside png_process_data");
|
||||
|
||||
/* If is impossible for there to be a saved buffer at this point -
|
||||
* otherwise we could not be in SKIP mode. This will also happen if
|
||||
* png_process_skip is called inside png_process_data (but only very
|
||||
* rarely.)
|
||||
*/
|
||||
if (png_ptr->save_buffer_size != 0)
|
||||
png_error(png_ptr, "png_process_data_skip called with saved data");
|
||||
|
||||
remaining = png_ptr->skip_length;
|
||||
png_ptr->skip_length = 0;
|
||||
png_ptr->process_mode = PNG_READ_CHUNK_MODE;
|
||||
}
|
||||
|
||||
return remaining;
|
||||
}
|
||||
|
||||
/* What we do with the incoming data depends on what we were previously
|
||||
@@ -130,6 +128,12 @@ png_process_some_data(png_structrp png_ptr, png_inforp info_ptr)
|
||||
break;
|
||||
}
|
||||
|
||||
case PNG_SKIP_MODE:
|
||||
{
|
||||
png_push_crc_finish(png_ptr);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
png_ptr->buffer_size = 0;
|
||||
@@ -147,8 +151,8 @@ png_process_some_data(png_structrp png_ptr, png_inforp info_ptr)
|
||||
void /* PRIVATE */
|
||||
png_push_read_sig(png_structrp png_ptr, png_inforp info_ptr)
|
||||
{
|
||||
size_t num_checked = png_ptr->sig_bytes; /* SAFE, does not exceed 8 */
|
||||
size_t num_to_check = 8 - num_checked;
|
||||
png_size_t num_checked = png_ptr->sig_bytes,
|
||||
num_to_check = 8 - num_checked;
|
||||
|
||||
if (png_ptr->buffer_size < num_to_check)
|
||||
{
|
||||
@@ -159,10 +163,10 @@ png_push_read_sig(png_structrp png_ptr, png_inforp info_ptr)
|
||||
num_to_check);
|
||||
png_ptr->sig_bytes = (png_byte)(png_ptr->sig_bytes + num_to_check);
|
||||
|
||||
if (png_sig_cmp(info_ptr->signature, num_checked, num_to_check) != 0)
|
||||
if (png_sig_cmp(info_ptr->signature, num_checked, num_to_check))
|
||||
{
|
||||
if (num_checked < 4 &&
|
||||
png_sig_cmp(info_ptr->signature, num_checked, num_to_check - 4) != 0)
|
||||
png_sig_cmp(info_ptr->signature, num_checked, num_to_check - 4))
|
||||
png_error(png_ptr, "Not a PNG file");
|
||||
|
||||
else
|
||||
@@ -185,16 +189,29 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
|
||||
int keep; /* unknown handling method */
|
||||
#endif
|
||||
|
||||
/* First we make sure we have enough data for the 4-byte chunk name
|
||||
* and the 4-byte chunk length before proceeding with decoding the
|
||||
/* First we make sure we have enough data for the 4 byte chunk name
|
||||
* and the 4 byte chunk length before proceeding with decoding the
|
||||
* chunk data. To fully decode each of these chunks, we also make
|
||||
* sure we have enough data in the buffer for the 4-byte CRC at the
|
||||
* sure we have enough data in the buffer for the 4 byte CRC at the
|
||||
* end of every chunk (except IDAT, which is handled separately).
|
||||
*/
|
||||
if ((png_ptr->mode & PNG_HAVE_CHUNK_HEADER) == 0)
|
||||
if (!(png_ptr->mode & PNG_HAVE_CHUNK_HEADER))
|
||||
{
|
||||
PNG_PUSH_SAVE_BUFFER_IF_LT(8)
|
||||
png_ptr->push_length = png_read_chunk_header(png_ptr);
|
||||
png_byte chunk_length[4];
|
||||
png_byte chunk_tag[4];
|
||||
|
||||
if (png_ptr->buffer_size < 8)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
return;
|
||||
}
|
||||
|
||||
png_push_fill_buffer(png_ptr, chunk_length, 4);
|
||||
png_ptr->push_length = png_get_uint_31(png_ptr, chunk_length);
|
||||
png_reset_crc(png_ptr);
|
||||
png_crc_read(png_ptr, chunk_tag, 4);
|
||||
png_ptr->chunk_name = PNG_CHUNK_FROM_STRING(chunk_tag);
|
||||
png_check_chunk_name(png_ptr, png_ptr->chunk_name);
|
||||
png_ptr->mode |= PNG_HAVE_CHUNK_HEADER;
|
||||
}
|
||||
|
||||
@@ -202,39 +219,28 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
|
||||
|
||||
if (chunk_name == png_IDAT)
|
||||
{
|
||||
if ((png_ptr->mode & PNG_AFTER_IDAT) != 0)
|
||||
if (png_ptr->mode & PNG_AFTER_IDAT)
|
||||
png_ptr->mode |= PNG_HAVE_CHUNK_AFTER_IDAT;
|
||||
|
||||
/* If we reach an IDAT chunk, this means we have read all of the
|
||||
* header chunks, and we can start reading the image (or if this
|
||||
* is called after the image has been read - we have an error).
|
||||
*/
|
||||
if ((png_ptr->mode & PNG_HAVE_IHDR) == 0)
|
||||
if (!(png_ptr->mode & PNG_HAVE_IHDR))
|
||||
png_error(png_ptr, "Missing IHDR before IDAT");
|
||||
|
||||
else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE &&
|
||||
(png_ptr->mode & PNG_HAVE_PLTE) == 0)
|
||||
!(png_ptr->mode & PNG_HAVE_PLTE))
|
||||
png_error(png_ptr, "Missing PLTE before IDAT");
|
||||
|
||||
png_ptr->process_mode = PNG_READ_IDAT_MODE;
|
||||
|
||||
if ((png_ptr->mode & PNG_HAVE_IDAT) != 0)
|
||||
if ((png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT) == 0)
|
||||
if (png_ptr->push_length == 0)
|
||||
return;
|
||||
|
||||
png_ptr->mode |= PNG_HAVE_IDAT;
|
||||
|
||||
if ((png_ptr->mode & PNG_AFTER_IDAT) != 0)
|
||||
png_benign_error(png_ptr, "Too many IDATs found");
|
||||
}
|
||||
if (!(png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT))
|
||||
if (png_ptr->push_length == 0)
|
||||
return;
|
||||
|
||||
else if ((png_ptr->mode & PNG_HAVE_IDAT) != 0)
|
||||
{
|
||||
/* These flags must be set consistently for all non-IDAT chunks,
|
||||
* including the unknown chunks.
|
||||
*/
|
||||
png_ptr->mode |= PNG_HAVE_CHUNK_AFTER_IDAT | PNG_AFTER_IDAT;
|
||||
if (png_ptr->mode & PNG_AFTER_IDAT)
|
||||
png_benign_error(png_ptr, "Too many IDATs found");
|
||||
}
|
||||
|
||||
if (chunk_name == png_IHDR)
|
||||
@@ -242,14 +248,24 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
|
||||
if (png_ptr->push_length != 13)
|
||||
png_error(png_ptr, "Invalid IHDR length");
|
||||
|
||||
PNG_PUSH_SAVE_BUFFER_IF_FULL
|
||||
png_handle_chunk(png_ptr, info_ptr, png_ptr->push_length);
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
return;
|
||||
}
|
||||
|
||||
png_handle_IHDR(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
|
||||
else if (chunk_name == png_IEND)
|
||||
{
|
||||
PNG_PUSH_SAVE_BUFFER_IF_FULL
|
||||
png_handle_chunk(png_ptr, info_ptr, png_ptr->push_length);
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
return;
|
||||
}
|
||||
|
||||
png_handle_IEND(png_ptr, info_ptr, png_ptr->push_length);
|
||||
|
||||
png_ptr->process_mode = PNG_READ_DONE_MODE;
|
||||
png_push_have_end(png_ptr, info_ptr);
|
||||
@@ -258,13 +274,28 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
|
||||
#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
|
||||
else if ((keep = png_chunk_unknown_handling(png_ptr, chunk_name)) != 0)
|
||||
{
|
||||
PNG_PUSH_SAVE_BUFFER_IF_FULL
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
return;
|
||||
}
|
||||
|
||||
png_handle_unknown(png_ptr, info_ptr, png_ptr->push_length, keep);
|
||||
|
||||
if (chunk_name == png_PLTE)
|
||||
png_ptr->mode |= PNG_HAVE_PLTE;
|
||||
}
|
||||
|
||||
#endif
|
||||
else if (chunk_name == png_PLTE)
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
return;
|
||||
}
|
||||
png_handle_PLTE(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
|
||||
else if (chunk_name == png_IDAT)
|
||||
{
|
||||
@@ -278,17 +309,311 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef PNG_READ_gAMA_SUPPORTED
|
||||
else if (png_ptr->chunk_name == png_gAMA)
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
return;
|
||||
}
|
||||
|
||||
png_handle_gAMA(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
|
||||
#endif
|
||||
#ifdef PNG_READ_sBIT_SUPPORTED
|
||||
else if (png_ptr->chunk_name == png_sBIT)
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
return;
|
||||
}
|
||||
|
||||
png_handle_sBIT(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
|
||||
#endif
|
||||
#ifdef PNG_READ_cHRM_SUPPORTED
|
||||
else if (png_ptr->chunk_name == png_cHRM)
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
return;
|
||||
}
|
||||
|
||||
png_handle_cHRM(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
|
||||
#endif
|
||||
#ifdef PNG_READ_sRGB_SUPPORTED
|
||||
else if (chunk_name == png_sRGB)
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
return;
|
||||
}
|
||||
|
||||
png_handle_sRGB(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
|
||||
#endif
|
||||
#ifdef PNG_READ_iCCP_SUPPORTED
|
||||
else if (png_ptr->chunk_name == png_iCCP)
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
return;
|
||||
}
|
||||
|
||||
png_handle_iCCP(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
|
||||
#endif
|
||||
#ifdef PNG_READ_sPLT_SUPPORTED
|
||||
else if (chunk_name == png_sPLT)
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
return;
|
||||
}
|
||||
|
||||
png_handle_sPLT(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
|
||||
#endif
|
||||
#ifdef PNG_READ_tRNS_SUPPORTED
|
||||
else if (chunk_name == png_tRNS)
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
return;
|
||||
}
|
||||
|
||||
png_handle_tRNS(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
|
||||
#endif
|
||||
#ifdef PNG_READ_bKGD_SUPPORTED
|
||||
else if (chunk_name == png_bKGD)
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
return;
|
||||
}
|
||||
|
||||
png_handle_bKGD(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
|
||||
#endif
|
||||
#ifdef PNG_READ_hIST_SUPPORTED
|
||||
else if (chunk_name == png_hIST)
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
return;
|
||||
}
|
||||
|
||||
png_handle_hIST(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
|
||||
#endif
|
||||
#ifdef PNG_READ_pHYs_SUPPORTED
|
||||
else if (chunk_name == png_pHYs)
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
return;
|
||||
}
|
||||
|
||||
png_handle_pHYs(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
|
||||
#endif
|
||||
#ifdef PNG_READ_oFFs_SUPPORTED
|
||||
else if (chunk_name == png_oFFs)
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
return;
|
||||
}
|
||||
|
||||
png_handle_oFFs(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_pCAL_SUPPORTED
|
||||
else if (chunk_name == png_pCAL)
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
return;
|
||||
}
|
||||
|
||||
png_handle_pCAL(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
|
||||
#endif
|
||||
#ifdef PNG_READ_sCAL_SUPPORTED
|
||||
else if (chunk_name == png_sCAL)
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
return;
|
||||
}
|
||||
|
||||
png_handle_sCAL(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
|
||||
#endif
|
||||
#ifdef PNG_READ_tIME_SUPPORTED
|
||||
else if (chunk_name == png_tIME)
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
return;
|
||||
}
|
||||
|
||||
png_handle_tIME(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
|
||||
#endif
|
||||
#ifdef PNG_READ_tEXt_SUPPORTED
|
||||
else if (chunk_name == png_tEXt)
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
return;
|
||||
}
|
||||
|
||||
png_handle_tEXt(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
|
||||
#endif
|
||||
#ifdef PNG_READ_zTXt_SUPPORTED
|
||||
else if (chunk_name == png_zTXt)
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
return;
|
||||
}
|
||||
|
||||
png_handle_zTXt(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
|
||||
#endif
|
||||
#ifdef PNG_READ_iTXt_SUPPORTED
|
||||
else if (chunk_name == png_iTXt)
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
return;
|
||||
}
|
||||
|
||||
png_handle_iTXt(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
|
||||
#endif
|
||||
else
|
||||
{
|
||||
PNG_PUSH_SAVE_BUFFER_IF_FULL
|
||||
png_handle_chunk(png_ptr, info_ptr, png_ptr->push_length);
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
return;
|
||||
}
|
||||
png_handle_unknown(png_ptr, info_ptr, png_ptr->push_length,
|
||||
PNG_HANDLE_CHUNK_AS_DEFAULT);
|
||||
}
|
||||
|
||||
png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER;
|
||||
}
|
||||
|
||||
void /* PRIVATE */
|
||||
png_push_crc_skip(png_structrp png_ptr, png_uint_32 skip)
|
||||
{
|
||||
png_ptr->process_mode = PNG_SKIP_MODE;
|
||||
png_ptr->skip_length = skip;
|
||||
}
|
||||
|
||||
void /* PRIVATE */
|
||||
png_push_crc_finish(png_structrp png_ptr)
|
||||
{
|
||||
if (png_ptr->skip_length && png_ptr->save_buffer_size)
|
||||
{
|
||||
png_size_t save_size = png_ptr->save_buffer_size;
|
||||
png_uint_32 skip_length = png_ptr->skip_length;
|
||||
|
||||
/* We want the smaller of 'skip_length' and 'save_buffer_size', but
|
||||
* they are of different types and we don't know which variable has the
|
||||
* fewest bits. Carefully select the smaller and cast it to the type of
|
||||
* the larger - this cannot overflow. Do not cast in the following test
|
||||
* - it will break on either 16 or 64 bit platforms.
|
||||
*/
|
||||
if (skip_length < save_size)
|
||||
save_size = (png_size_t)skip_length;
|
||||
|
||||
else
|
||||
skip_length = (png_uint_32)save_size;
|
||||
|
||||
png_calculate_crc(png_ptr, png_ptr->save_buffer_ptr, save_size);
|
||||
|
||||
png_ptr->skip_length -= skip_length;
|
||||
png_ptr->buffer_size -= save_size;
|
||||
png_ptr->save_buffer_size -= save_size;
|
||||
png_ptr->save_buffer_ptr += save_size;
|
||||
}
|
||||
if (png_ptr->skip_length && png_ptr->current_buffer_size)
|
||||
{
|
||||
png_size_t save_size = png_ptr->current_buffer_size;
|
||||
png_uint_32 skip_length = png_ptr->skip_length;
|
||||
|
||||
/* We want the smaller of 'skip_length' and 'current_buffer_size', here,
|
||||
* the same problem exists as above and the same solution.
|
||||
*/
|
||||
if (skip_length < save_size)
|
||||
save_size = (png_size_t)skip_length;
|
||||
|
||||
else
|
||||
skip_length = (png_uint_32)save_size;
|
||||
|
||||
png_calculate_crc(png_ptr, png_ptr->current_buffer_ptr, save_size);
|
||||
|
||||
png_ptr->skip_length -= skip_length;
|
||||
png_ptr->buffer_size -= save_size;
|
||||
png_ptr->current_buffer_size -= save_size;
|
||||
png_ptr->current_buffer_ptr += save_size;
|
||||
}
|
||||
if (!png_ptr->skip_length)
|
||||
{
|
||||
if (png_ptr->buffer_size < 4)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
return;
|
||||
}
|
||||
|
||||
png_crc_finish(png_ptr, 0);
|
||||
png_ptr->process_mode = PNG_READ_CHUNK_MODE;
|
||||
}
|
||||
}
|
||||
|
||||
void PNGCBAPI
|
||||
png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, size_t length)
|
||||
png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, png_size_t length)
|
||||
{
|
||||
png_bytep ptr;
|
||||
|
||||
@@ -296,9 +621,9 @@ png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, size_t length)
|
||||
return;
|
||||
|
||||
ptr = buffer;
|
||||
if (png_ptr->save_buffer_size != 0)
|
||||
if (png_ptr->save_buffer_size)
|
||||
{
|
||||
size_t save_size;
|
||||
png_size_t save_size;
|
||||
|
||||
if (length < png_ptr->save_buffer_size)
|
||||
save_size = length;
|
||||
@@ -313,9 +638,9 @@ png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, size_t length)
|
||||
png_ptr->save_buffer_size -= save_size;
|
||||
png_ptr->save_buffer_ptr += save_size;
|
||||
}
|
||||
if (length != 0 && png_ptr->current_buffer_size != 0)
|
||||
if (length && png_ptr->current_buffer_size)
|
||||
{
|
||||
size_t save_size;
|
||||
png_size_t save_size;
|
||||
|
||||
if (length < png_ptr->current_buffer_size)
|
||||
save_size = length;
|
||||
@@ -333,11 +658,11 @@ png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, size_t length)
|
||||
void /* PRIVATE */
|
||||
png_push_save_buffer(png_structrp png_ptr)
|
||||
{
|
||||
if (png_ptr->save_buffer_size != 0)
|
||||
if (png_ptr->save_buffer_size)
|
||||
{
|
||||
if (png_ptr->save_buffer_ptr != png_ptr->save_buffer)
|
||||
{
|
||||
size_t i, istop;
|
||||
png_size_t i, istop;
|
||||
png_bytep sp;
|
||||
png_bytep dp;
|
||||
|
||||
@@ -352,7 +677,7 @@ png_push_save_buffer(png_structrp png_ptr)
|
||||
if (png_ptr->save_buffer_size + png_ptr->current_buffer_size >
|
||||
png_ptr->save_buffer_max)
|
||||
{
|
||||
size_t new_max;
|
||||
png_size_t new_max;
|
||||
png_bytep old_buffer;
|
||||
|
||||
if (png_ptr->save_buffer_size > PNG_SIZE_MAX -
|
||||
@@ -364,7 +689,7 @@ png_push_save_buffer(png_structrp png_ptr)
|
||||
new_max = png_ptr->save_buffer_size + png_ptr->current_buffer_size + 256;
|
||||
old_buffer = png_ptr->save_buffer;
|
||||
png_ptr->save_buffer = (png_bytep)png_malloc_warn(png_ptr,
|
||||
(size_t)new_max);
|
||||
(png_size_t)new_max);
|
||||
|
||||
if (png_ptr->save_buffer == NULL)
|
||||
{
|
||||
@@ -372,10 +697,7 @@ png_push_save_buffer(png_structrp png_ptr)
|
||||
png_error(png_ptr, "Insufficient memory for save_buffer");
|
||||
}
|
||||
|
||||
if (old_buffer)
|
||||
memcpy(png_ptr->save_buffer, old_buffer, png_ptr->save_buffer_size);
|
||||
else if (png_ptr->save_buffer_size)
|
||||
png_error(png_ptr, "save_buffer error");
|
||||
memcpy(png_ptr->save_buffer, old_buffer, png_ptr->save_buffer_size);
|
||||
png_free(png_ptr, old_buffer);
|
||||
png_ptr->save_buffer_max = new_max;
|
||||
}
|
||||
@@ -392,7 +714,7 @@ png_push_save_buffer(png_structrp png_ptr)
|
||||
|
||||
void /* PRIVATE */
|
||||
png_push_restore_buffer(png_structrp png_ptr, png_bytep buffer,
|
||||
size_t buffer_length)
|
||||
png_size_t buffer_length)
|
||||
{
|
||||
png_ptr->current_buffer = buffer;
|
||||
png_ptr->current_buffer_size = buffer_length;
|
||||
@@ -403,13 +725,18 @@ png_push_restore_buffer(png_structrp png_ptr, png_bytep buffer,
|
||||
void /* PRIVATE */
|
||||
png_push_read_IDAT(png_structrp png_ptr)
|
||||
{
|
||||
if ((png_ptr->mode & PNG_HAVE_CHUNK_HEADER) == 0)
|
||||
if (!(png_ptr->mode & PNG_HAVE_CHUNK_HEADER))
|
||||
{
|
||||
png_byte chunk_length[4];
|
||||
png_byte chunk_tag[4];
|
||||
|
||||
/* TODO: this code can be commoned up with the same code in push_read */
|
||||
PNG_PUSH_SAVE_BUFFER_IF_LT(8)
|
||||
if (png_ptr->buffer_size < 8)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
return;
|
||||
}
|
||||
|
||||
png_push_fill_buffer(png_ptr, chunk_length, 4);
|
||||
png_ptr->push_length = png_get_uint_31(png_ptr, chunk_length);
|
||||
png_reset_crc(png_ptr);
|
||||
@@ -421,7 +748,7 @@ png_push_read_IDAT(png_structrp png_ptr)
|
||||
{
|
||||
png_ptr->process_mode = PNG_READ_CHUNK_MODE;
|
||||
|
||||
if ((png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED) == 0)
|
||||
if (!(png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED))
|
||||
png_error(png_ptr, "Not enough compressed data");
|
||||
|
||||
return;
|
||||
@@ -430,19 +757,19 @@ png_push_read_IDAT(png_structrp png_ptr)
|
||||
png_ptr->idat_size = png_ptr->push_length;
|
||||
}
|
||||
|
||||
if (png_ptr->idat_size != 0 && png_ptr->save_buffer_size != 0)
|
||||
if (png_ptr->idat_size && png_ptr->save_buffer_size)
|
||||
{
|
||||
size_t save_size = png_ptr->save_buffer_size;
|
||||
png_size_t save_size = png_ptr->save_buffer_size;
|
||||
png_uint_32 idat_size = png_ptr->idat_size;
|
||||
|
||||
/* We want the smaller of 'idat_size' and 'current_buffer_size', but they
|
||||
* are of different types and we don't know which variable has the fewest
|
||||
* bits. Carefully select the smaller and cast it to the type of the
|
||||
* larger - this cannot overflow. Do not cast in the following test - it
|
||||
* will break on either 16-bit or 64-bit platforms.
|
||||
* will break on either 16 or 64 bit platforms.
|
||||
*/
|
||||
if (idat_size < save_size)
|
||||
save_size = (size_t)idat_size;
|
||||
save_size = (png_size_t)idat_size;
|
||||
|
||||
else
|
||||
idat_size = (png_uint_32)save_size;
|
||||
@@ -457,9 +784,9 @@ png_push_read_IDAT(png_structrp png_ptr)
|
||||
png_ptr->save_buffer_ptr += save_size;
|
||||
}
|
||||
|
||||
if (png_ptr->idat_size != 0 && png_ptr->current_buffer_size != 0)
|
||||
if (png_ptr->idat_size && png_ptr->current_buffer_size)
|
||||
{
|
||||
size_t save_size = png_ptr->current_buffer_size;
|
||||
png_size_t save_size = png_ptr->current_buffer_size;
|
||||
png_uint_32 idat_size = png_ptr->idat_size;
|
||||
|
||||
/* We want the smaller of 'idat_size' and 'current_buffer_size', but they
|
||||
@@ -468,7 +795,7 @@ png_push_read_IDAT(png_structrp png_ptr)
|
||||
* larger - this cannot overflow.
|
||||
*/
|
||||
if (idat_size < save_size)
|
||||
save_size = (size_t)idat_size;
|
||||
save_size = (png_size_t)idat_size;
|
||||
|
||||
else
|
||||
idat_size = (png_uint_32)save_size;
|
||||
@@ -482,10 +809,14 @@ png_push_read_IDAT(png_structrp png_ptr)
|
||||
png_ptr->current_buffer_size -= save_size;
|
||||
png_ptr->current_buffer_ptr += save_size;
|
||||
}
|
||||
|
||||
if (png_ptr->idat_size == 0)
|
||||
if (!png_ptr->idat_size)
|
||||
{
|
||||
PNG_PUSH_SAVE_BUFFER_IF_LT(4)
|
||||
if (png_ptr->buffer_size < 4)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
return;
|
||||
}
|
||||
|
||||
png_crc_finish(png_ptr, 0);
|
||||
png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER;
|
||||
png_ptr->mode |= PNG_AFTER_IDAT;
|
||||
@@ -495,7 +826,7 @@ png_push_read_IDAT(png_structrp png_ptr)
|
||||
|
||||
void /* PRIVATE */
|
||||
png_process_IDAT_data(png_structrp png_ptr, png_bytep buffer,
|
||||
size_t buffer_length)
|
||||
png_size_t buffer_length)
|
||||
{
|
||||
/* The caller checks for a non-zero buffer length. */
|
||||
if (!(buffer_length > 0) || buffer == NULL)
|
||||
@@ -513,7 +844,7 @@ png_process_IDAT_data(png_structrp png_ptr, png_bytep buffer,
|
||||
* or the stream marked as finished.
|
||||
*/
|
||||
while (png_ptr->zstream.avail_in > 0 &&
|
||||
(png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED) == 0)
|
||||
!(png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED))
|
||||
{
|
||||
int ret;
|
||||
|
||||
@@ -538,7 +869,7 @@ png_process_IDAT_data(png_structrp png_ptr, png_bytep buffer,
|
||||
* change the current behavior (see comments in inflate.c
|
||||
* for why this doesn't happen at present with zlib 1.2.5).
|
||||
*/
|
||||
ret = PNG_INFLATE(png_ptr, Z_SYNC_FLUSH);
|
||||
ret = inflate(&png_ptr->zstream, Z_SYNC_FLUSH);
|
||||
|
||||
/* Check for any failure before proceeding. */
|
||||
if (ret != Z_OK && ret != Z_STREAM_END)
|
||||
@@ -555,12 +886,7 @@ png_process_IDAT_data(png_structrp png_ptr, png_bytep buffer,
|
||||
png_warning(png_ptr, "Truncated compressed data in IDAT");
|
||||
|
||||
else
|
||||
{
|
||||
if (ret == Z_DATA_ERROR)
|
||||
png_benign_error(png_ptr, "IDAT: ADLER32 checksum mismatch");
|
||||
else
|
||||
png_error(png_ptr, "Decompression error in IDAT");
|
||||
}
|
||||
png_error(png_ptr, "Decompression error in IDAT");
|
||||
|
||||
/* Skip the check on unprocessed input */
|
||||
return;
|
||||
@@ -635,7 +961,7 @@ png_push_process_row(png_structrp png_ptr)
|
||||
memcpy(png_ptr->prev_row, png_ptr->row_buf, row_info.rowbytes + 1);
|
||||
|
||||
#ifdef PNG_READ_TRANSFORMS_SUPPORTED
|
||||
if (png_ptr->transformations != 0)
|
||||
if (png_ptr->transformations)
|
||||
png_do_read_transformations(png_ptr, &row_info);
|
||||
#endif
|
||||
|
||||
@@ -652,16 +978,15 @@ png_push_process_row(png_structrp png_ptr)
|
||||
|
||||
|
||||
#ifdef PNG_READ_INTERLACING_SUPPORTED
|
||||
/* Expand interlaced rows to full size */
|
||||
if (png_ptr->interlaced != 0 &&
|
||||
(png_ptr->transformations & PNG_INTERLACE) != 0)
|
||||
/* Blow up interlaced rows to full size */
|
||||
if (png_ptr->interlaced && (png_ptr->transformations & PNG_INTERLACE))
|
||||
{
|
||||
if (png_ptr->pass < 6)
|
||||
png_do_read_interlace(&row_info, png_ptr->row_buf + 1, png_ptr->pass,
|
||||
png_ptr->transformations);
|
||||
png_ptr->transformations);
|
||||
|
||||
switch (png_ptr->pass)
|
||||
{
|
||||
switch (png_ptr->pass)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
int i;
|
||||
@@ -838,12 +1163,33 @@ png_push_process_row(png_structrp png_ptr)
|
||||
void /* PRIVATE */
|
||||
png_read_push_finish_row(png_structrp png_ptr)
|
||||
{
|
||||
#ifdef PNG_READ_INTERLACING_SUPPORTED
|
||||
/* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
|
||||
|
||||
/* Start of interlace block */
|
||||
static PNG_CONST png_byte png_pass_start[] = {0, 4, 0, 2, 0, 1, 0};
|
||||
|
||||
/* Offset to next interlace block */
|
||||
static PNG_CONST png_byte png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1};
|
||||
|
||||
/* Start of interlace block in the y direction */
|
||||
static PNG_CONST png_byte png_pass_ystart[] = {0, 0, 4, 0, 2, 0, 1};
|
||||
|
||||
/* Offset to next interlace block in the y direction */
|
||||
static PNG_CONST png_byte png_pass_yinc[] = {8, 8, 8, 4, 4, 2, 2};
|
||||
|
||||
/* Height of interlace block. This is not currently used - if you need
|
||||
* it, uncomment it here and in png.h
|
||||
static PNG_CONST png_byte png_pass_height[] = {8, 8, 4, 4, 2, 2, 1};
|
||||
*/
|
||||
#endif
|
||||
|
||||
png_ptr->row_number++;
|
||||
if (png_ptr->row_number < png_ptr->num_rows)
|
||||
return;
|
||||
|
||||
#ifdef PNG_READ_INTERLACING_SUPPORTED
|
||||
if (png_ptr->interlaced != 0)
|
||||
if (png_ptr->interlaced)
|
||||
{
|
||||
png_ptr->row_number = 0;
|
||||
memset(png_ptr->prev_row, 0, png_ptr->rowbytes + 1);
|
||||
@@ -867,7 +1213,7 @@ png_read_push_finish_row(png_structrp png_ptr)
|
||||
png_pass_start[png_ptr->pass]) /
|
||||
png_pass_inc[png_ptr->pass];
|
||||
|
||||
if ((png_ptr->transformations & PNG_INTERLACE) != 0)
|
||||
if (png_ptr->transformations & PNG_INTERLACE)
|
||||
break;
|
||||
|
||||
png_ptr->num_rows = (png_ptr->height +
|
||||
@@ -877,7 +1223,7 @@ png_read_push_finish_row(png_structrp png_ptr)
|
||||
|
||||
} while (png_ptr->iwidth == 0 || png_ptr->num_rows == 0);
|
||||
}
|
||||
#endif /* READ_INTERLACING */
|
||||
#endif /* PNG_READ_INTERLACING_SUPPORTED */
|
||||
}
|
||||
|
||||
void /* PRIVATE */
|
||||
@@ -899,7 +1245,7 @@ png_push_have_row(png_structrp png_ptr, png_bytep row)
|
||||
{
|
||||
if (png_ptr->row_fn != NULL)
|
||||
(*(png_ptr->row_fn))(png_ptr, row, png_ptr->row_number,
|
||||
(int)png_ptr->pass);
|
||||
(int)png_ptr->pass);
|
||||
}
|
||||
|
||||
#ifdef PNG_READ_INTERLACING_SUPPORTED
|
||||
@@ -915,9 +1261,9 @@ png_progressive_combine_row(png_const_structrp png_ptr, png_bytep old_row,
|
||||
* it must be png_ptr->row_buf+1
|
||||
*/
|
||||
if (new_row != NULL)
|
||||
png_combine_row(png_ptr, old_row, 1/*blocky display*/);
|
||||
png_combine_row(png_ptr, old_row, 1/*display*/);
|
||||
}
|
||||
#endif /* READ_INTERLACING */
|
||||
#endif /* PNG_READ_INTERLACING_SUPPORTED */
|
||||
|
||||
void PNGAPI
|
||||
png_set_progressive_read_fn(png_structrp png_ptr, png_voidp progressive_ptr,
|
||||
@@ -938,8 +1284,8 @@ png_voidp PNGAPI
|
||||
png_get_progressive_ptr(png_const_structrp png_ptr)
|
||||
{
|
||||
if (png_ptr == NULL)
|
||||
return NULL;
|
||||
return (NULL);
|
||||
|
||||
return png_ptr->io_ptr;
|
||||
}
|
||||
#endif /* PROGRESSIVE_READ */
|
||||
#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,9 +1,10 @@
|
||||
|
||||
/* pngrio.c - functions for data input
|
||||
*
|
||||
* Copyright (c) 2018-2025 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Last changed in libpng 1.6.0 [February 14, 2013]
|
||||
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
@@ -25,10 +26,10 @@
|
||||
* reads from a file pointer. Note that this routine sometimes gets called
|
||||
* with very small lengths, so you should implement some kind of simple
|
||||
* buffering if you are using unbuffered reads. This should never be asked
|
||||
* to read more than 64K on a 16-bit machine.
|
||||
* to read more then 64K on a 16 bit machine.
|
||||
*/
|
||||
void /* PRIVATE */
|
||||
png_read_data(png_structrp png_ptr, png_bytep data, size_t length)
|
||||
png_read_data(png_structrp png_ptr, png_bytep data, png_size_t length)
|
||||
{
|
||||
png_debug1(4, "reading %d bytes", (int)length);
|
||||
|
||||
@@ -46,17 +47,17 @@ png_read_data(png_structrp png_ptr, png_bytep data, size_t length)
|
||||
* than changing the library.
|
||||
*/
|
||||
void PNGCBAPI
|
||||
png_default_read_data(png_structp png_ptr, png_bytep data, size_t length)
|
||||
png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
{
|
||||
size_t check;
|
||||
png_size_t check;
|
||||
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
|
||||
/* fread() returns 0 on error, so it is OK to store this in a size_t
|
||||
/* fread() returns 0 on error, so it is OK to store this in a png_size_t
|
||||
* instead of an int, which is what fread() actually returns.
|
||||
*/
|
||||
check = fread(data, 1, length, png_voidcast(FILE *, png_ptr->io_ptr));
|
||||
check = fread(data, 1, length, png_voidcast(png_FILE_p, png_ptr->io_ptr));
|
||||
|
||||
if (check != length)
|
||||
png_error(png_ptr, "Read Error");
|
||||
@@ -84,7 +85,7 @@ png_default_read_data(png_structp png_ptr, png_bytep data, size_t length)
|
||||
*/
|
||||
void PNGAPI
|
||||
png_set_read_fn(png_structrp png_ptr, png_voidp io_ptr,
|
||||
png_rw_ptr read_data_fn)
|
||||
png_rw_ptr read_data_fn)
|
||||
{
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
@@ -101,7 +102,6 @@ png_set_read_fn(png_structrp png_ptr, png_voidp io_ptr,
|
||||
png_ptr->read_data_fn = read_data_fn;
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_SUPPORTED
|
||||
/* It is an error to write to a read device */
|
||||
if (png_ptr->write_data_fn != NULL)
|
||||
{
|
||||
@@ -110,10 +110,9 @@ png_set_read_fn(png_structrp png_ptr, png_voidp io_ptr,
|
||||
"Can't set both read_data_fn and write_data_fn in the"
|
||||
" same structure");
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_FLUSH_SUPPORTED
|
||||
png_ptr->output_flush_fn = NULL;
|
||||
#endif
|
||||
}
|
||||
#endif /* READ */
|
||||
#endif /* PNG_READ_SUPPORTED */
|
||||
|
||||
+1735
-1793
File diff suppressed because it is too large
Load Diff
+1349
-1582
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,18 +1,22 @@
|
||||
/* pngstruct.h - internal structures for libpng
|
||||
|
||||
/* pngstruct.h - header file for PNG reference library
|
||||
*
|
||||
* Copyright (c) 2018-2025 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*
|
||||
* Last changed in libpng 1.6.1 [March 28, 2013]
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
* and license in png.h
|
||||
*/
|
||||
|
||||
#ifndef PNGPRIV_H
|
||||
# error This file must not be included by applications; please include <png.h>
|
||||
#endif
|
||||
/* The structure that holds the information to read and write PNG files.
|
||||
* The only people who need to care about what is inside of this are the
|
||||
* people who will be modifying the library for their own special needs.
|
||||
* It should NOT be accessed directly by an application.
|
||||
*/
|
||||
|
||||
#ifndef PNGSTRUCT_H
|
||||
#define PNGSTRUCT_H
|
||||
@@ -44,7 +48,7 @@
|
||||
/* zlib.h declares a magic type 'uInt' that limits the amount of data that zlib
|
||||
* can handle at once. This type need be no larger than 16 bits (so maximum of
|
||||
* 65535), this define allows us to discover how big it is, but limited by the
|
||||
* maximum for size_t. The value can be overridden in a library build
|
||||
* maximuum for png_size_t. The value can be overriden in a library build
|
||||
* (pngusr.h, or set it in CPPFLAGS) and it works to set it to a considerably
|
||||
* lower value (e.g. 255 works). A lower value may help memory usage (slightly)
|
||||
* and may even improve performance on some systems (and degrade it on others.)
|
||||
@@ -67,7 +71,13 @@ typedef struct png_compression_buffer
|
||||
|
||||
/* Colorspace support; structures used in png_struct, png_info and in internal
|
||||
* functions to hold and communicate information about the color space.
|
||||
*
|
||||
* PNG_COLORSPACE_SUPPORTED is only required if the application will perform
|
||||
* colorspace corrections, otherwise all the colorspace information can be
|
||||
* skipped and the size of libpng can be reduced (significantly) by compiling
|
||||
* out the colorspace support.
|
||||
*/
|
||||
#ifdef PNG_COLORSPACE_SUPPORTED
|
||||
/* The chromaticities of the red, green and blue colorants and the chromaticity
|
||||
* of the corresponding white point (i.e. of rgb(1.0,1.0,1.0)).
|
||||
*/
|
||||
@@ -88,36 +98,48 @@ typedef struct png_XYZ
|
||||
png_fixed_point green_X, green_Y, green_Z;
|
||||
png_fixed_point blue_X, blue_Y, blue_Z;
|
||||
} png_XYZ;
|
||||
#endif /* COLORSPACE */
|
||||
|
||||
/* Chunk index values as an enum, PNG_INDEX_unknown is also a count of the
|
||||
* number of chunks.
|
||||
*/
|
||||
#define PNG_CHUNK(cHNK, i) PNG_INDEX_ ## cHNK = (i),
|
||||
typedef enum
|
||||
{
|
||||
PNG_KNOWN_CHUNKS
|
||||
PNG_INDEX_unknown
|
||||
} png_index;
|
||||
#undef PNG_CHUNK
|
||||
|
||||
/* Chunk flag values. These are (png_uint_32 values) with exactly one bit set
|
||||
* and can be combined into a flag set with bitwise 'or'.
|
||||
#if defined(PNG_COLORSPACE_SUPPORTED) || defined(PNG_GAMMA_SUPPORTED)
|
||||
/* A colorspace is all the above plus, potentially, profile information,
|
||||
* however at present libpng does not use the profile internally so it is only
|
||||
* stored in the png_info struct (if iCCP is supported.) The rendering intent
|
||||
* is retained here and is checked.
|
||||
*
|
||||
* TODO: C23: convert these macros to C23 inlines (which are static).
|
||||
* The file gamma encoding information is also stored here and gamma correction
|
||||
* is done by libpng, whereas color correction must currently be done by the
|
||||
* application.
|
||||
*/
|
||||
#define png_chunk_flag_from_index(i) (0x80000000U >> (31 - (i)))
|
||||
/* The flag coresponding to the given png_index enum value. This is defined
|
||||
* for png_unknown as well (until it reaches the value 32) but this should
|
||||
* not be relied on.
|
||||
*/
|
||||
typedef struct png_colorspace
|
||||
{
|
||||
#ifdef PNG_GAMMA_SUPPORTED
|
||||
png_fixed_point gamma; /* File gamma */
|
||||
#endif
|
||||
|
||||
#define png_file_has_chunk(png_ptr, i)\
|
||||
(((png_ptr)->chunks & png_chunk_flag_from_index(i)) != 0)
|
||||
/* The chunk has been recorded in png_struct */
|
||||
#ifdef PNG_COLORSPACE_SUPPORTED
|
||||
png_xy end_points_xy; /* End points as chromaticities */
|
||||
png_XYZ end_points_XYZ; /* End points as CIE XYZ colorant values */
|
||||
png_uint_16 rendering_intent; /* Rendering intent of a profile */
|
||||
#endif
|
||||
|
||||
#define png_file_add_chunk(pnt_ptr, i)\
|
||||
((void)((png_ptr)->chunks |= png_chunk_flag_from_index(i)))
|
||||
/* Record the chunk in the png_struct */
|
||||
/* Flags are always defined to simplify the code. */
|
||||
png_uint_16 flags; /* As defined below */
|
||||
} png_colorspace, * PNG_RESTRICT png_colorspacerp;
|
||||
|
||||
typedef const png_colorspace * PNG_RESTRICT png_const_colorspacerp;
|
||||
|
||||
/* General flags for the 'flags' field */
|
||||
#define PNG_COLORSPACE_HAVE_GAMMA 0x0001
|
||||
#define PNG_COLORSPACE_HAVE_ENDPOINTS 0x0002
|
||||
#define PNG_COLORSPACE_HAVE_INTENT 0x0004
|
||||
#define PNG_COLORSPACE_FROM_gAMA 0x0008
|
||||
#define PNG_COLORSPACE_FROM_cHRM 0x0010
|
||||
#define PNG_COLORSPACE_FROM_sRGB 0x0020
|
||||
#define PNG_COLORSPACE_ENDPOINTS_MATCH_sRGB 0x0040
|
||||
#define PNG_COLORSPACE_MATCHES_sRGB 0x0080 /* exact match on profile */
|
||||
#define PNG_COLORSPACE_INVALID 0x8000
|
||||
#define PNG_COLORSPACE_CANCEL(flags) (0xffff ^ (flags))
|
||||
#endif /* COLORSPACE || GAMMA */
|
||||
|
||||
struct png_struct_def
|
||||
{
|
||||
@@ -189,34 +211,27 @@ struct png_struct_def
|
||||
int zlib_set_strategy;
|
||||
#endif
|
||||
|
||||
png_uint_32 chunks; /* PNG_CF_ for every chunk read or (NYI) written */
|
||||
# define png_has_chunk(png_ptr, cHNK)\
|
||||
png_file_has_chunk(png_ptr, PNG_INDEX_ ## cHNK)
|
||||
/* Convenience accessor - use this to check for a known chunk by name */
|
||||
|
||||
png_uint_32 width; /* width of image in pixels */
|
||||
png_uint_32 height; /* height of image in pixels */
|
||||
png_uint_32 num_rows; /* number of rows in current pass */
|
||||
png_uint_32 usr_width; /* width of row at start of write */
|
||||
size_t rowbytes; /* size of row in bytes */
|
||||
png_size_t rowbytes; /* size of row in bytes */
|
||||
png_uint_32 iwidth; /* width of current interlaced row in pixels */
|
||||
png_uint_32 row_number; /* current row in interlace pass */
|
||||
png_uint_32 chunk_name; /* PNG_CHUNK() id of current chunk */
|
||||
png_bytep prev_row; /* buffer to save previous (unfiltered) row.
|
||||
* While reading this is a pointer into
|
||||
* big_prev_row; while writing it is separately
|
||||
* allocated if needed.
|
||||
* This is a pointer into big_prev_row
|
||||
*/
|
||||
png_bytep row_buf; /* buffer to save current (unfiltered) row.
|
||||
* While reading, this is a pointer into
|
||||
* big_row_buf; while writing it is separately
|
||||
* allocated.
|
||||
* This is a pointer into big_row_buf
|
||||
*/
|
||||
#ifdef PNG_WRITE_FILTER_SUPPORTED
|
||||
png_bytep try_row; /* buffer to save trial row when filtering */
|
||||
png_bytep tst_row; /* buffer to save best trial row when filtering */
|
||||
#ifdef PNG_WRITE_SUPPORTED
|
||||
png_bytep sub_row; /* buffer to save "sub" row when filtering */
|
||||
png_bytep up_row; /* buffer to save "up" row when filtering */
|
||||
png_bytep avg_row; /* buffer to save "avg" row when filtering */
|
||||
png_bytep paeth_row; /* buffer to save "Paeth" row when filtering */
|
||||
#endif
|
||||
size_t info_rowbytes; /* Added in 1.5.4: cache of updated row bytes */
|
||||
png_size_t info_rowbytes; /* Added in 1.5.4: cache of updated row bytes */
|
||||
|
||||
png_uint_32 idat_size; /* current IDAT size for read */
|
||||
png_uint_32 crc; /* current chunk CRC value */
|
||||
@@ -233,7 +248,7 @@ struct png_struct_def
|
||||
png_byte filter; /* file filter type (always 0) */
|
||||
png_byte interlaced; /* PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */
|
||||
png_byte pass; /* current interlace pass (0 - 6) */
|
||||
png_byte do_filter; /* row filter flags (see PNG_FILTER_ in png.h ) */
|
||||
png_byte do_filter; /* row filter flags (see PNG_FILTER_ below ) */
|
||||
png_byte color_type; /* color type of file */
|
||||
png_byte bit_depth; /* bit depth of file */
|
||||
png_byte usr_bit_depth; /* bit depth of users row: write only */
|
||||
@@ -247,9 +262,6 @@ struct png_struct_def
|
||||
/* pixel depth used for the row buffers */
|
||||
png_byte transformed_pixel_depth;
|
||||
/* pixel depth after read/write transforms */
|
||||
#if ZLIB_VERNUM >= 0x1240
|
||||
png_byte zstream_start; /* at start of an input zlib stream */
|
||||
#endif /* Zlib >= 1.2.4 */
|
||||
#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED)
|
||||
png_uint_16 filler; /* filler bytes for pixel expansion */
|
||||
#endif
|
||||
@@ -262,7 +274,7 @@ struct png_struct_def
|
||||
#ifdef PNG_READ_GAMMA_SUPPORTED
|
||||
png_color_16 background_1; /* background normalized to gamma 1.0 */
|
||||
#endif
|
||||
#endif /* bKGD */
|
||||
#endif /* PNG_bKGD_SUPPORTED */
|
||||
|
||||
#ifdef PNG_WRITE_FLUSH_SUPPORTED
|
||||
png_flush_ptr output_flush_fn; /* Function for flushing output */
|
||||
@@ -270,16 +282,9 @@ struct png_struct_def
|
||||
png_uint_32 flush_rows; /* number of rows written since last flush */
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
|
||||
png_xy chromaticities; /* From mDVC, cICP, [iCCP], sRGB or cHRM */
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_GAMMA_SUPPORTED
|
||||
int gamma_shift; /* number of "insignificant" bits in 16-bit gamma */
|
||||
png_fixed_point screen_gamma; /* screen gamma value (display exponent) */
|
||||
png_fixed_point file_gamma; /* file gamma value (encoding exponent) */
|
||||
png_fixed_point chunk_gamma; /* from cICP, iCCP, sRGB or gAMA */
|
||||
png_fixed_point default_gamma;/* from png_set_alpha_mode */
|
||||
png_fixed_point screen_gamma; /* screen gamma value (display_exponent) */
|
||||
|
||||
png_bytep gamma_table; /* gamma table for 8-bit depth files */
|
||||
png_uint_16pp gamma_16_table; /* gamma table for 16-bit depth files */
|
||||
@@ -291,14 +296,14 @@ struct png_struct_def
|
||||
png_uint_16pp gamma_16_from_1; /* converts from 1.0 to screen */
|
||||
png_uint_16pp gamma_16_to_1; /* converts from file to 1.0 */
|
||||
#endif /* READ_BACKGROUND || READ_ALPHA_MODE || RGB_TO_GRAY */
|
||||
#endif /* READ_GAMMA */
|
||||
#endif
|
||||
|
||||
#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_sBIT_SUPPORTED)
|
||||
png_color_8 sig_bit; /* significant bits in each available channel */
|
||||
#endif
|
||||
|
||||
#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED)
|
||||
png_color_8 shift; /* shift for significant bit transformation */
|
||||
png_color_8 shift; /* shift for significant bit tranformation */
|
||||
#endif
|
||||
|
||||
#if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) \
|
||||
@@ -319,30 +324,50 @@ struct png_struct_def
|
||||
png_bytep current_buffer; /* buffer for recently used data */
|
||||
png_uint_32 push_length; /* size of current input chunk */
|
||||
png_uint_32 skip_length; /* bytes to skip in input data */
|
||||
size_t save_buffer_size; /* amount of data now in save_buffer */
|
||||
size_t save_buffer_max; /* total size of save_buffer */
|
||||
size_t buffer_size; /* total amount of available input data */
|
||||
size_t current_buffer_size; /* amount of data now in current_buffer */
|
||||
png_size_t save_buffer_size; /* amount of data now in save_buffer */
|
||||
png_size_t save_buffer_max; /* total size of save_buffer */
|
||||
png_size_t buffer_size; /* total amount of available input data */
|
||||
png_size_t current_buffer_size; /* amount of data now in current_buffer */
|
||||
int process_mode; /* what push library is currently doing */
|
||||
int cur_palette; /* current push library palette index */
|
||||
#endif /* PROGRESSIVE_READ */
|
||||
|
||||
#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
|
||||
|
||||
#if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__)
|
||||
/* For the Borland special 64K segment handler */
|
||||
png_bytepp offset_table_ptr;
|
||||
png_bytep offset_table;
|
||||
png_uint_16 offset_table_number;
|
||||
png_uint_16 offset_table_count;
|
||||
png_uint_16 offset_table_count_free;
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_QUANTIZE_SUPPORTED
|
||||
png_bytep palette_lookup; /* lookup table for quantizing */
|
||||
png_bytep quantize_index; /* index translation for palette files */
|
||||
#endif
|
||||
|
||||
/* Options */
|
||||
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
|
||||
png_byte heuristic_method; /* heuristic for row filter selection */
|
||||
png_byte num_prev_filters; /* number of weights for previous rows */
|
||||
png_bytep prev_filters; /* filter type(s) of previous row(s) */
|
||||
png_uint_16p filter_weights; /* weight(s) for previous line(s) */
|
||||
png_uint_16p inv_filter_weights; /* 1/weight(s) for previous line(s) */
|
||||
png_uint_16p filter_costs; /* relative filter calculation cost */
|
||||
png_uint_16p inv_filter_costs; /* 1/relative filter calculation cost */
|
||||
#endif
|
||||
|
||||
/* Options */
|
||||
#ifdef PNG_SET_OPTION_SUPPORTED
|
||||
png_uint_32 options; /* On/off state (up to 16 options) */
|
||||
png_byte options; /* On/off state (up to 4 options) */
|
||||
#endif
|
||||
|
||||
#if PNG_LIBPNG_VER < 10700
|
||||
/* To do: remove this from libpng-1.7 */
|
||||
#ifdef PNG_TIME_RFC1123_SUPPORTED
|
||||
char time_buffer[29]; /* String to hold RFC 1123 time text */
|
||||
#endif /* TIME_RFC1123 */
|
||||
#endif /* LIBPNG_VER < 10700 */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* New members added in libpng-1.0.6 */
|
||||
|
||||
@@ -352,8 +377,8 @@ struct png_struct_def
|
||||
png_voidp user_chunk_ptr;
|
||||
#ifdef PNG_READ_USER_CHUNKS_SUPPORTED
|
||||
png_user_chunk_ptr read_user_chunk_fn; /* user read chunk handler */
|
||||
#endif /* READ_USER_CHUNKS */
|
||||
#endif /* USER_CHUNKS */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED
|
||||
int unknown_default; /* As PNG_HANDLE_* */
|
||||
@@ -373,13 +398,6 @@ struct png_struct_def
|
||||
/* deleted in 1.5.5: rgb_to_gray_blue_coeff; */
|
||||
#endif
|
||||
|
||||
/* New member added in libpng-1.6.36 */
|
||||
#if defined(PNG_READ_EXPAND_SUPPORTED) && \
|
||||
(defined(PNG_ARM_NEON_IMPLEMENTATION) || \
|
||||
defined(PNG_RISCV_RVV_IMPLEMENTATION))
|
||||
png_bytep riffled_palette; /* buffer for accelerated palette expansion */
|
||||
#endif
|
||||
|
||||
/* New member added in libpng-1.0.4 (renamed in 1.0.9) */
|
||||
#if defined(PNG_MNG_FEATURES_SUPPORTED)
|
||||
/* Changed from png_byte to png_uint_32 at version 1.2.0 */
|
||||
@@ -405,6 +423,7 @@ struct png_struct_def
|
||||
|
||||
#ifdef PNG_READ_QUANTIZE_SUPPORTED
|
||||
/* The following three members were added at version 1.0.14 and 1.2.4 */
|
||||
png_bytep quantize_sort; /* working sort array */
|
||||
png_bytep index_to_palette; /* where the original index currently is
|
||||
in the palette */
|
||||
png_bytep palette_to_index; /* which original index points to this
|
||||
@@ -438,7 +457,7 @@ struct png_struct_def
|
||||
#endif
|
||||
|
||||
/* New member added in libpng-1.2.26 */
|
||||
size_t old_big_row_buf_size;
|
||||
png_size_t old_big_row_buf_size;
|
||||
|
||||
#ifdef PNG_READ_SUPPORTED
|
||||
/* New member added in libpng-1.2.30 */
|
||||
@@ -460,5 +479,11 @@ struct png_struct_def
|
||||
/* New member added in libpng-1.5.7 */
|
||||
void (*read_filter[PNG_FILTER_VALUE_LAST-1])(png_row_infop row_info,
|
||||
png_bytep row, png_const_bytep prev_row);
|
||||
|
||||
#ifdef PNG_READ_SUPPORTED
|
||||
#if defined(PNG_COLORSPACE_SUPPORTED) || defined(PNG_GAMMA_SUPPORTED)
|
||||
png_colorspace colorspace;
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
#endif /* PNGSTRUCT_H */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,9 +1,10 @@
|
||||
|
||||
/* pngtrans.c - transforms the data in a row (used by both readers and writers)
|
||||
*
|
||||
* Copyright (c) 2018-2024 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Last changed in libpng 1.6.2 [April 25, 2013]
|
||||
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
@@ -29,7 +30,7 @@ png_set_bgr(png_structrp png_ptr)
|
||||
#endif
|
||||
|
||||
#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED)
|
||||
/* Turn on 16-bit byte swapping */
|
||||
/* Turn on 16 bit byte swapping */
|
||||
void PNGAPI
|
||||
png_set_swap(png_structrp png_ptr)
|
||||
{
|
||||
@@ -56,9 +57,7 @@ png_set_packing(png_structrp png_ptr)
|
||||
if (png_ptr->bit_depth < 8)
|
||||
{
|
||||
png_ptr->transformations |= PNG_PACK;
|
||||
# ifdef PNG_WRITE_SUPPORTED
|
||||
png_ptr->usr_bit_depth = 8;
|
||||
# endif
|
||||
png_ptr->usr_bit_depth = 8;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -99,13 +98,13 @@ png_set_interlace_handling(png_structrp png_ptr)
|
||||
{
|
||||
png_debug(1, "in png_set_interlace handling");
|
||||
|
||||
if (png_ptr != 0 && png_ptr->interlaced != 0)
|
||||
if (png_ptr && png_ptr->interlaced)
|
||||
{
|
||||
png_ptr->transformations |= PNG_INTERLACE;
|
||||
return 7;
|
||||
return (7);
|
||||
}
|
||||
|
||||
return 1;
|
||||
return (1);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -126,7 +125,7 @@ png_set_filler(png_structrp png_ptr, png_uint_32 filler, int filler_loc)
|
||||
/* In libpng 1.6 it is possible to determine whether this is a read or write
|
||||
* operation and therefore to do more checking here for a valid call.
|
||||
*/
|
||||
if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0)
|
||||
if (png_ptr->mode & PNG_IS_READ_STRUCT)
|
||||
{
|
||||
# ifdef PNG_READ_FILLER_SUPPORTED
|
||||
/* On read png_set_filler is always valid, regardless of the base PNG
|
||||
@@ -171,14 +170,13 @@ png_set_filler(png_structrp png_ptr, png_uint_32 filler, int filler_loc)
|
||||
* size!
|
||||
*/
|
||||
png_app_error(png_ptr,
|
||||
"png_set_filler is invalid for"
|
||||
" low bit depth gray output");
|
||||
"png_set_filler is invalid for low bit depth gray output");
|
||||
return;
|
||||
}
|
||||
|
||||
default:
|
||||
png_app_error(png_ptr,
|
||||
"png_set_filler: inappropriate color type");
|
||||
"png_set_filler: inappropriate color type");
|
||||
return;
|
||||
}
|
||||
# else
|
||||
@@ -210,7 +208,7 @@ png_set_add_alpha(png_structrp png_ptr, png_uint_32 filler, int filler_loc)
|
||||
|
||||
png_set_filler(png_ptr, filler, filler_loc);
|
||||
/* The above may fail to do anything. */
|
||||
if ((png_ptr->transformations & PNG_FILLER) != 0)
|
||||
if (png_ptr->transformations & PNG_FILLER)
|
||||
png_ptr->transformations |= PNG_ADD_ALPHA;
|
||||
}
|
||||
|
||||
@@ -268,8 +266,8 @@ png_do_invert(png_row_infop row_info, png_bytep row)
|
||||
if (row_info->color_type == PNG_COLOR_TYPE_GRAY)
|
||||
{
|
||||
png_bytep rp = row;
|
||||
size_t i;
|
||||
size_t istop = row_info->rowbytes;
|
||||
png_size_t i;
|
||||
png_size_t istop = row_info->rowbytes;
|
||||
|
||||
for (i = 0; i < istop; i++)
|
||||
{
|
||||
@@ -282,8 +280,8 @@ png_do_invert(png_row_infop row_info, png_bytep row)
|
||||
row_info->bit_depth == 8)
|
||||
{
|
||||
png_bytep rp = row;
|
||||
size_t i;
|
||||
size_t istop = row_info->rowbytes;
|
||||
png_size_t i;
|
||||
png_size_t istop = row_info->rowbytes;
|
||||
|
||||
for (i = 0; i < istop; i += 2)
|
||||
{
|
||||
@@ -297,8 +295,8 @@ png_do_invert(png_row_infop row_info, png_bytep row)
|
||||
row_info->bit_depth == 16)
|
||||
{
|
||||
png_bytep rp = row;
|
||||
size_t i;
|
||||
size_t istop = row_info->rowbytes;
|
||||
png_size_t i;
|
||||
png_size_t istop = row_info->rowbytes;
|
||||
|
||||
for (i = 0; i < istop; i += 4)
|
||||
{
|
||||
@@ -313,7 +311,7 @@ png_do_invert(png_row_infop row_info, png_bytep row)
|
||||
|
||||
#ifdef PNG_16BIT_SUPPORTED
|
||||
#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED)
|
||||
/* Swaps byte order on 16-bit depth images */
|
||||
/* Swaps byte order on 16 bit depth images */
|
||||
void /* PRIVATE */
|
||||
png_do_swap(png_row_infop row_info, png_bytep row)
|
||||
{
|
||||
@@ -327,16 +325,9 @@ png_do_swap(png_row_infop row_info, png_bytep row)
|
||||
|
||||
for (i = 0; i < istop; i++, rp += 2)
|
||||
{
|
||||
#ifdef PNG_BUILTIN_BSWAP16_SUPPORTED
|
||||
/* Feature added to libpng-1.6.11 for testing purposes, not
|
||||
* enabled by default.
|
||||
*/
|
||||
*(png_uint_16*)rp = __builtin_bswap16(*(png_uint_16*)rp);
|
||||
#else
|
||||
png_byte t = *rp;
|
||||
*rp = *(rp + 1);
|
||||
*(rp + 1) = t;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -344,7 +335,7 @@ png_do_swap(png_row_infop row_info, png_bytep row)
|
||||
#endif
|
||||
|
||||
#if defined(PNG_READ_PACKSWAP_SUPPORTED)||defined(PNG_WRITE_PACKSWAP_SUPPORTED)
|
||||
static const png_byte onebppswaptable[256] = {
|
||||
static PNG_CONST png_byte onebppswaptable[256] = {
|
||||
0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0,
|
||||
0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0,
|
||||
0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8,
|
||||
@@ -379,7 +370,7 @@ static const png_byte onebppswaptable[256] = {
|
||||
0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF
|
||||
};
|
||||
|
||||
static const png_byte twobppswaptable[256] = {
|
||||
static PNG_CONST png_byte twobppswaptable[256] = {
|
||||
0x00, 0x40, 0x80, 0xC0, 0x10, 0x50, 0x90, 0xD0,
|
||||
0x20, 0x60, 0xA0, 0xE0, 0x30, 0x70, 0xB0, 0xF0,
|
||||
0x04, 0x44, 0x84, 0xC4, 0x14, 0x54, 0x94, 0xD4,
|
||||
@@ -414,7 +405,7 @@ static const png_byte twobppswaptable[256] = {
|
||||
0x2F, 0x6F, 0xAF, 0xEF, 0x3F, 0x7F, 0xBF, 0xFF
|
||||
};
|
||||
|
||||
static const png_byte fourbppswaptable[256] = {
|
||||
static PNG_CONST png_byte fourbppswaptable[256] = {
|
||||
0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70,
|
||||
0x80, 0x90, 0xA0, 0xB0, 0xC0, 0xD0, 0xE0, 0xF0,
|
||||
0x01, 0x11, 0x21, 0x31, 0x41, 0x51, 0x61, 0x71,
|
||||
@@ -478,7 +469,7 @@ png_do_packswap(png_row_infop row_info, png_bytep row)
|
||||
*rp = table[*rp];
|
||||
}
|
||||
}
|
||||
#endif /* PACKSWAP || WRITE_PACKSWAP */
|
||||
#endif /* PNG_READ_PACKSWAP_SUPPORTED or PNG_WRITE_PACKSWAP_SUPPORTED */
|
||||
|
||||
#if defined(PNG_WRITE_FILLER_SUPPORTED) || \
|
||||
defined(PNG_READ_STRIP_ALPHA_SUPPORTED)
|
||||
@@ -497,8 +488,6 @@ png_do_strip_channel(png_row_infop row_info, png_bytep row, int at_start)
|
||||
png_bytep dp = row; /* destination pointer */
|
||||
png_bytep ep = row + row_info->rowbytes; /* One beyond end of row */
|
||||
|
||||
png_debug(1, "in png_do_strip_channel");
|
||||
|
||||
/* At the start sp will point to the first byte to copy and dp to where
|
||||
* it is copied to. ep always points just beyond the end of the row, so
|
||||
* the loop simply copies (channels-1) channels until sp reaches ep.
|
||||
@@ -512,35 +501,27 @@ png_do_strip_channel(png_row_infop row_info, png_bytep row, int at_start)
|
||||
{
|
||||
if (row_info->bit_depth == 8)
|
||||
{
|
||||
if (at_start != 0) /* Skip initial filler */
|
||||
if (at_start) /* Skip initial filler */
|
||||
++sp;
|
||||
else /* Skip initial channel and, for sp, the filler */
|
||||
{
|
||||
sp += 2; ++dp;
|
||||
}
|
||||
sp += 2, ++dp;
|
||||
|
||||
/* For a 1 pixel wide image there is nothing to do */
|
||||
while (sp < ep)
|
||||
{
|
||||
*dp++ = *sp; sp += 2;
|
||||
}
|
||||
*dp++ = *sp, sp += 2;
|
||||
|
||||
row_info->pixel_depth = 8;
|
||||
}
|
||||
|
||||
else if (row_info->bit_depth == 16)
|
||||
{
|
||||
if (at_start != 0) /* Skip initial filler */
|
||||
if (at_start) /* Skip initial filler */
|
||||
sp += 2;
|
||||
else /* Skip initial channel and, for sp, the filler */
|
||||
{
|
||||
sp += 4; dp += 2;
|
||||
}
|
||||
sp += 4, dp += 2;
|
||||
|
||||
while (sp < ep)
|
||||
{
|
||||
*dp++ = *sp++; *dp++ = *sp; sp += 3;
|
||||
}
|
||||
*dp++ = *sp++, *dp++ = *sp, sp += 3;
|
||||
|
||||
row_info->pixel_depth = 16;
|
||||
}
|
||||
@@ -560,37 +541,31 @@ png_do_strip_channel(png_row_infop row_info, png_bytep row, int at_start)
|
||||
{
|
||||
if (row_info->bit_depth == 8)
|
||||
{
|
||||
if (at_start != 0) /* Skip initial filler */
|
||||
if (at_start) /* Skip initial filler */
|
||||
++sp;
|
||||
else /* Skip initial channels and, for sp, the filler */
|
||||
{
|
||||
sp += 4; dp += 3;
|
||||
}
|
||||
sp += 4, dp += 3;
|
||||
|
||||
/* Note that the loop adds 3 to dp and 4 to sp each time. */
|
||||
while (sp < ep)
|
||||
{
|
||||
*dp++ = *sp++; *dp++ = *sp++; *dp++ = *sp; sp += 2;
|
||||
}
|
||||
*dp++ = *sp++, *dp++ = *sp++, *dp++ = *sp, sp += 2;
|
||||
|
||||
row_info->pixel_depth = 24;
|
||||
}
|
||||
|
||||
else if (row_info->bit_depth == 16)
|
||||
{
|
||||
if (at_start != 0) /* Skip initial filler */
|
||||
if (at_start) /* Skip initial filler */
|
||||
sp += 2;
|
||||
else /* Skip initial channels and, for sp, the filler */
|
||||
{
|
||||
sp += 8; dp += 6;
|
||||
}
|
||||
sp += 8, dp += 6;
|
||||
|
||||
while (sp < ep)
|
||||
{
|
||||
/* Copy 6 bytes, skip 2 */
|
||||
*dp++ = *sp++; *dp++ = *sp++;
|
||||
*dp++ = *sp++; *dp++ = *sp++;
|
||||
*dp++ = *sp++; *dp++ = *sp; sp += 3;
|
||||
*dp++ = *sp++, *dp++ = *sp++;
|
||||
*dp++ = *sp++, *dp++ = *sp++;
|
||||
*dp++ = *sp++, *dp++ = *sp, sp += 3;
|
||||
}
|
||||
|
||||
row_info->pixel_depth = 48;
|
||||
@@ -610,7 +585,7 @@ png_do_strip_channel(png_row_infop row_info, png_bytep row, int at_start)
|
||||
return; /* The filler channel has gone already */
|
||||
|
||||
/* Fix the rowbytes value. */
|
||||
row_info->rowbytes = (size_t)(dp-row);
|
||||
row_info->rowbytes = dp-row;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -621,7 +596,7 @@ png_do_bgr(png_row_infop row_info, png_bytep row)
|
||||
{
|
||||
png_debug(1, "in png_do_bgr");
|
||||
|
||||
if ((row_info->color_type & PNG_COLOR_MASK_COLOR) != 0)
|
||||
if ((row_info->color_type & PNG_COLOR_MASK_COLOR))
|
||||
{
|
||||
png_uint_32 row_width = row_info->width;
|
||||
if (row_info->bit_depth == 8)
|
||||
@@ -691,7 +666,7 @@ png_do_bgr(png_row_infop row_info, png_bytep row)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif /* READ_BGR || WRITE_BGR */
|
||||
#endif /* PNG_READ_BGR_SUPPORTED or PNG_WRITE_BGR_SUPPORTED */
|
||||
|
||||
#if defined(PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED) || \
|
||||
defined(PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED)
|
||||
@@ -699,8 +674,6 @@ png_do_bgr(png_row_infop row_info, png_bytep row)
|
||||
void /* PRIVATE */
|
||||
png_do_check_palette_indexes(png_structrp png_ptr, png_row_infop row_info)
|
||||
{
|
||||
png_debug(1, "in png_do_check_palette_indexes");
|
||||
|
||||
if (png_ptr->num_palette < (1 << row_info->bit_depth) &&
|
||||
png_ptr->num_palette > 0) /* num_palette can be 0 in MNG files */
|
||||
{
|
||||
@@ -710,7 +683,7 @@ png_do_check_palette_indexes(png_structrp png_ptr, png_row_infop row_info)
|
||||
* and this calculation is used because it avoids warnings that other
|
||||
* forms produced on either GCC or MSVC.
|
||||
*/
|
||||
int padding = PNG_PADBITS(row_info->pixel_depth, row_info->width);
|
||||
int padding = (-row_info->pixel_depth * row_info->width) & 7;
|
||||
png_bytep rp = png_ptr->row_buf + row_info->rowbytes;
|
||||
|
||||
switch (row_info->bit_depth)
|
||||
@@ -722,7 +695,7 @@ png_do_check_palette_indexes(png_structrp png_ptr, png_row_infop row_info)
|
||||
*/
|
||||
for (; rp > png_ptr->row_buf; rp--)
|
||||
{
|
||||
if ((*rp >> padding) != 0)
|
||||
if (*rp >> padding != 0)
|
||||
png_ptr->num_palette_max = 1;
|
||||
padding = 0;
|
||||
}
|
||||
@@ -796,14 +769,14 @@ png_do_check_palette_indexes(png_structrp png_ptr, png_row_infop row_info)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* CHECK_FOR_INVALID_INDEX */
|
||||
#endif /* PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED */
|
||||
|
||||
#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
|
||||
defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
|
||||
#ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED
|
||||
void PNGAPI
|
||||
png_set_user_transform_info(png_structrp png_ptr, png_voidp user_transform_ptr,
|
||||
int user_transform_depth, int user_transform_channels)
|
||||
png_set_user_transform_info(png_structrp png_ptr, png_voidp
|
||||
user_transform_ptr, int user_transform_depth, int user_transform_channels)
|
||||
{
|
||||
png_debug(1, "in png_set_user_transform_info");
|
||||
|
||||
@@ -815,7 +788,7 @@ png_set_user_transform_info(png_structrp png_ptr, png_voidp user_transform_ptr,
|
||||
(png_ptr->flags & PNG_FLAG_ROW_INIT) != 0)
|
||||
{
|
||||
png_app_error(png_ptr,
|
||||
"info change after png_start_read_image or png_read_update_info");
|
||||
"info change after png_start_read_image or png_read_update_info");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
@@ -836,7 +809,7 @@ png_voidp PNGAPI
|
||||
png_get_user_transform_ptr(png_const_structrp png_ptr)
|
||||
{
|
||||
if (png_ptr == NULL)
|
||||
return NULL;
|
||||
return (NULL);
|
||||
|
||||
return png_ptr->user_transform_ptr;
|
||||
}
|
||||
@@ -846,7 +819,7 @@ png_get_user_transform_ptr(png_const_structrp png_ptr)
|
||||
png_uint_32 PNGAPI
|
||||
png_get_current_row_number(png_const_structrp png_ptr)
|
||||
{
|
||||
/* See the comments in png.h - this is the sub-image row when reading an
|
||||
/* See the comments in png.h - this is the sub-image row when reading and
|
||||
* interlaced image.
|
||||
*/
|
||||
if (png_ptr != NULL)
|
||||
@@ -862,6 +835,7 @@ png_get_current_pass_number(png_const_structrp png_ptr)
|
||||
return png_ptr->pass;
|
||||
return 8; /* invalid */
|
||||
}
|
||||
#endif /* USER_TRANSFORM_INFO */
|
||||
#endif /* READ_USER_TRANSFORM || WRITE_USER_TRANSFORM */
|
||||
#endif /* READ || WRITE */
|
||||
#endif /* PNG_USER_TRANSFORM_INFO_SUPPORTED */
|
||||
#endif /* PNG_READ_USER_TRANSFORM_SUPPORTED ||
|
||||
PNG_WRITE_USER_TRANSFORM_SUPPORTED */
|
||||
#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
|
||||
/* pngwio.c - functions for data output
|
||||
*
|
||||
* Copyright (c) 2018-2025 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2014,2016,2018 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Last changed in libpng 1.6.0 [February 14, 2013]
|
||||
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
@@ -25,16 +26,16 @@
|
||||
* writes to a file pointer. Note that this routine sometimes gets called
|
||||
* with very small lengths, so you should implement some kind of simple
|
||||
* buffering if you are using unbuffered writes. This should never be asked
|
||||
* to write more than 64K on a 16-bit machine.
|
||||
* to write more than 64K on a 16 bit machine.
|
||||
*/
|
||||
|
||||
void /* PRIVATE */
|
||||
png_write_data(png_structrp png_ptr, png_const_bytep data, size_t length)
|
||||
png_write_data(png_structrp png_ptr, png_const_bytep data, png_size_t length)
|
||||
{
|
||||
/* NOTE: write_data_fn must not change the buffer! */
|
||||
if (png_ptr->write_data_fn != NULL )
|
||||
(*(png_ptr->write_data_fn))(png_ptr, png_constcast(png_bytep,data),
|
||||
length);
|
||||
length);
|
||||
|
||||
else
|
||||
png_error(png_ptr, "Call to NULL write function");
|
||||
@@ -47,14 +48,14 @@ png_write_data(png_structrp png_ptr, png_const_bytep data, size_t length)
|
||||
* than changing the library.
|
||||
*/
|
||||
void PNGCBAPI
|
||||
png_default_write_data(png_structp png_ptr, png_bytep data, size_t length)
|
||||
png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
{
|
||||
size_t check;
|
||||
png_size_t check;
|
||||
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
|
||||
check = fwrite(data, 1, length, (FILE *)png_ptr->io_ptr);
|
||||
check = fwrite(data, 1, length, (png_FILE_p)(png_ptr->io_ptr));
|
||||
|
||||
if (check != length)
|
||||
png_error(png_ptr, "Write Error");
|
||||
@@ -77,12 +78,12 @@ png_flush(png_structrp png_ptr)
|
||||
void PNGCBAPI
|
||||
png_default_flush(png_structp png_ptr)
|
||||
{
|
||||
FILE *io_ptr;
|
||||
png_FILE_p io_ptr;
|
||||
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
|
||||
io_ptr = png_voidcast(FILE *, png_ptr->io_ptr);
|
||||
io_ptr = png_voidcast(png_FILE_p, (png_ptr->io_ptr));
|
||||
fflush(io_ptr);
|
||||
}
|
||||
# endif
|
||||
@@ -148,11 +149,8 @@ png_set_write_fn(png_structrp png_ptr, png_voidp io_ptr,
|
||||
# else
|
||||
png_ptr->output_flush_fn = output_flush_fn;
|
||||
# endif
|
||||
#else
|
||||
PNG_UNUSED(output_flush_fn)
|
||||
#endif /* WRITE_FLUSH */
|
||||
#endif /* PNG_WRITE_FLUSH_SUPPORTED */
|
||||
|
||||
#ifdef PNG_READ_SUPPORTED
|
||||
/* It is an error to read while writing a png file */
|
||||
if (png_ptr->read_data_fn != NULL)
|
||||
{
|
||||
@@ -162,6 +160,5 @@ png_set_write_fn(png_structrp png_ptr, png_voidp io_ptr,
|
||||
"Can't set both read_data_fn and write_data_fn in the"
|
||||
" same structure");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif /* WRITE */
|
||||
#endif /* PNG_WRITE_SUPPORTED */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,9 +1,10 @@
|
||||
|
||||
/* pngwtran.c - transforms the data in a row for PNG writers
|
||||
*
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Last changed in libpng 1.6.0 [February 14, 2013]
|
||||
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
@@ -13,14 +14,90 @@
|
||||
#include "pngpriv.h"
|
||||
|
||||
#ifdef PNG_WRITE_SUPPORTED
|
||||
|
||||
#ifdef PNG_WRITE_TRANSFORMS_SUPPORTED
|
||||
/* Transform the data according to the user's wishes. The order of
|
||||
* transformations is significant.
|
||||
*/
|
||||
void /* PRIVATE */
|
||||
png_do_write_transformations(png_structrp png_ptr, png_row_infop row_info)
|
||||
{
|
||||
png_debug(1, "in png_do_write_transformations");
|
||||
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
|
||||
#ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED
|
||||
if (png_ptr->transformations & PNG_USER_TRANSFORM)
|
||||
if (png_ptr->write_user_transform_fn != NULL)
|
||||
(*(png_ptr->write_user_transform_fn)) /* User write transform
|
||||
function */
|
||||
(png_ptr, /* png_ptr */
|
||||
row_info, /* row_info: */
|
||||
/* png_uint_32 width; width of row */
|
||||
/* png_size_t rowbytes; number of bytes in row */
|
||||
/* png_byte color_type; color type of pixels */
|
||||
/* png_byte bit_depth; bit depth of samples */
|
||||
/* png_byte channels; number of channels (1-4) */
|
||||
/* png_byte pixel_depth; bits per pixel (depth*channels) */
|
||||
png_ptr->row_buf + 1); /* start of pixel data for row */
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_FILLER_SUPPORTED
|
||||
if (png_ptr->transformations & PNG_FILLER)
|
||||
png_do_strip_channel(row_info, png_ptr->row_buf + 1,
|
||||
!(png_ptr->flags & PNG_FLAG_FILLER_AFTER));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_PACKSWAP_SUPPORTED
|
||||
if (png_ptr->transformations & PNG_PACKSWAP)
|
||||
png_do_packswap(row_info, png_ptr->row_buf + 1);
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_PACK_SUPPORTED
|
||||
if (png_ptr->transformations & PNG_PACK)
|
||||
png_do_pack(row_info, png_ptr->row_buf + 1,
|
||||
(png_uint_32)png_ptr->bit_depth);
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_SWAP_SUPPORTED
|
||||
if (png_ptr->transformations & PNG_SWAP_BYTES)
|
||||
png_do_swap(row_info, png_ptr->row_buf + 1);
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_SHIFT_SUPPORTED
|
||||
if (png_ptr->transformations & PNG_SHIFT)
|
||||
png_do_shift(row_info, png_ptr->row_buf + 1,
|
||||
&(png_ptr->shift));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_SWAP_ALPHA_SUPPORTED
|
||||
if (png_ptr->transformations & PNG_SWAP_ALPHA)
|
||||
png_do_write_swap_alpha(row_info, png_ptr->row_buf + 1);
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_INVERT_ALPHA_SUPPORTED
|
||||
if (png_ptr->transformations & PNG_INVERT_ALPHA)
|
||||
png_do_write_invert_alpha(row_info, png_ptr->row_buf + 1);
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_BGR_SUPPORTED
|
||||
if (png_ptr->transformations & PNG_BGR)
|
||||
png_do_bgr(row_info, png_ptr->row_buf + 1);
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_INVERT_SUPPORTED
|
||||
if (png_ptr->transformations & PNG_INVERT_MONO)
|
||||
png_do_invert(row_info, png_ptr->row_buf + 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef PNG_WRITE_PACK_SUPPORTED
|
||||
/* Pack pixels into bytes. Pass the true bit depth in bit_depth. The
|
||||
* row_info bit depth should be 8 (one pixel per byte). The channels
|
||||
* should be 1 (this only happens on grayscale and paletted images).
|
||||
*/
|
||||
static void
|
||||
void /* PRIVATE */
|
||||
png_do_pack(png_row_infop row_info, png_bytep row, png_uint_32 bit_depth)
|
||||
{
|
||||
png_debug(1, "in png_do_pack");
|
||||
@@ -70,8 +147,7 @@ png_do_pack(png_row_infop row_info, png_bytep row, png_uint_32 bit_depth)
|
||||
case 2:
|
||||
{
|
||||
png_bytep sp, dp;
|
||||
unsigned int shift;
|
||||
int v;
|
||||
int shift, v;
|
||||
png_uint_32 i;
|
||||
png_uint_32 row_width = row_info->width;
|
||||
|
||||
@@ -110,8 +186,7 @@ png_do_pack(png_row_infop row_info, png_bytep row, png_uint_32 bit_depth)
|
||||
case 4:
|
||||
{
|
||||
png_bytep sp, dp;
|
||||
unsigned int shift;
|
||||
int v;
|
||||
int shift, v;
|
||||
png_uint_32 i;
|
||||
png_uint_32 row_width = row_info->width;
|
||||
|
||||
@@ -167,7 +242,7 @@ png_do_pack(png_row_infop row_info, png_bytep row, png_uint_32 bit_depth)
|
||||
* would pass 3 as bit_depth, and this routine would translate the
|
||||
* data to 0 to 15.
|
||||
*/
|
||||
static void
|
||||
void /* PRIVATE */
|
||||
png_do_shift(png_row_infop row_info, png_bytep row,
|
||||
png_const_color_8p bit_depth)
|
||||
{
|
||||
@@ -176,9 +251,9 @@ png_do_shift(png_row_infop row_info, png_bytep row,
|
||||
if (row_info->color_type != PNG_COLOR_TYPE_PALETTE)
|
||||
{
|
||||
int shift_start[4], shift_dec[4];
|
||||
unsigned int channels = 0;
|
||||
int channels = 0;
|
||||
|
||||
if ((row_info->color_type & PNG_COLOR_MASK_COLOR) != 0)
|
||||
if (row_info->color_type & PNG_COLOR_MASK_COLOR)
|
||||
{
|
||||
shift_start[channels] = row_info->bit_depth - bit_depth->red;
|
||||
shift_dec[channels] = bit_depth->red;
|
||||
@@ -200,7 +275,7 @@ png_do_shift(png_row_infop row_info, png_bytep row,
|
||||
channels++;
|
||||
}
|
||||
|
||||
if ((row_info->color_type & PNG_COLOR_MASK_ALPHA) != 0)
|
||||
if (row_info->color_type & PNG_COLOR_MASK_ALPHA)
|
||||
{
|
||||
shift_start[channels] = row_info->bit_depth - bit_depth->alpha;
|
||||
shift_dec[channels] = bit_depth->alpha;
|
||||
@@ -211,9 +286,9 @@ png_do_shift(png_row_infop row_info, png_bytep row,
|
||||
if (row_info->bit_depth < 8)
|
||||
{
|
||||
png_bytep bp = row;
|
||||
size_t i;
|
||||
png_size_t i;
|
||||
unsigned int mask;
|
||||
size_t row_bytes = row_info->rowbytes;
|
||||
png_size_t row_bytes = row_info->rowbytes;
|
||||
|
||||
if (bit_depth->gray == 1 && row_info->bit_depth == 2)
|
||||
mask = 0x55;
|
||||
@@ -253,7 +328,8 @@ png_do_shift(png_row_infop row_info, png_bytep row,
|
||||
|
||||
for (i = 0; i < istop; i++, bp++)
|
||||
{
|
||||
unsigned int c = i%channels;
|
||||
|
||||
const unsigned int c = i%channels;
|
||||
int j;
|
||||
unsigned int v, out;
|
||||
|
||||
@@ -281,7 +357,7 @@ png_do_shift(png_row_infop row_info, png_bytep row,
|
||||
|
||||
for (bp = row, i = 0; i < istop; i++)
|
||||
{
|
||||
unsigned int c = i%channels;
|
||||
const unsigned int c = i%channels;
|
||||
int j;
|
||||
unsigned int value, v;
|
||||
|
||||
@@ -305,7 +381,7 @@ png_do_shift(png_row_infop row_info, png_bytep row,
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_SWAP_ALPHA_SUPPORTED
|
||||
static void
|
||||
void /* PRIVATE */
|
||||
png_do_write_swap_alpha(png_row_infop row_info, png_bytep row)
|
||||
{
|
||||
png_debug(1, "in png_do_write_swap_alpha");
|
||||
@@ -353,7 +429,7 @@ png_do_write_swap_alpha(png_row_infop row_info, png_bytep row)
|
||||
*(dp++) = save[1];
|
||||
}
|
||||
}
|
||||
#endif /* WRITE_16BIT */
|
||||
#endif /* PNG_WRITE_16BIT_SUPPORTED */
|
||||
}
|
||||
|
||||
else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
|
||||
@@ -392,14 +468,14 @@ png_do_write_swap_alpha(png_row_infop row_info, png_bytep row)
|
||||
*(dp++) = save[1];
|
||||
}
|
||||
}
|
||||
#endif /* WRITE_16BIT */
|
||||
#endif /* PNG_WRITE_16BIT_SUPPORTED */
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_INVERT_ALPHA_SUPPORTED
|
||||
static void
|
||||
void /* PRIVATE */
|
||||
png_do_write_invert_alpha(png_row_infop row_info, png_bytep row)
|
||||
{
|
||||
png_debug(1, "in png_do_write_invert_alpha");
|
||||
@@ -422,7 +498,7 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row)
|
||||
*(dp++) = *(sp++);
|
||||
*/
|
||||
sp+=3; dp = sp;
|
||||
*dp = (png_byte)(255 - *(sp++));
|
||||
*(dp++) = (png_byte)(255 - *(sp++));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -446,10 +522,10 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row)
|
||||
*/
|
||||
sp+=6; dp = sp;
|
||||
*(dp++) = (png_byte)(255 - *(sp++));
|
||||
*dp = (png_byte)(255 - *(sp++));
|
||||
*(dp++) = (png_byte)(255 - *(sp++));
|
||||
}
|
||||
}
|
||||
#endif /* WRITE_16BIT */
|
||||
#endif /* PNG_WRITE_16BIT_SUPPORTED */
|
||||
}
|
||||
|
||||
else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
|
||||
@@ -484,91 +560,78 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row)
|
||||
*/
|
||||
sp+=2; dp = sp;
|
||||
*(dp++) = (png_byte)(255 - *(sp++));
|
||||
*dp = (png_byte)(255 - *(sp++));
|
||||
*(dp++) = (png_byte)(255 - *(sp++));
|
||||
}
|
||||
}
|
||||
#endif /* WRITE_16BIT */
|
||||
#endif /* PNG_WRITE_16BIT_SUPPORTED */
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif /* PNG_WRITE_TRANSFORMS_SUPPORTED */
|
||||
|
||||
/* Transform the data according to the user's wishes. The order of
|
||||
* transformations is significant.
|
||||
*/
|
||||
#ifdef PNG_MNG_FEATURES_SUPPORTED
|
||||
/* Undoes intrapixel differencing */
|
||||
void /* PRIVATE */
|
||||
png_do_write_transformations(png_structrp png_ptr, png_row_infop row_info)
|
||||
png_do_write_intrapixel(png_row_infop row_info, png_bytep row)
|
||||
{
|
||||
png_debug(1, "in png_do_write_transformations");
|
||||
png_debug(1, "in png_do_write_intrapixel");
|
||||
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
if ((row_info->color_type & PNG_COLOR_MASK_COLOR))
|
||||
{
|
||||
int bytes_per_pixel;
|
||||
png_uint_32 row_width = row_info->width;
|
||||
if (row_info->bit_depth == 8)
|
||||
{
|
||||
png_bytep rp;
|
||||
png_uint_32 i;
|
||||
|
||||
#ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED
|
||||
if ((png_ptr->transformations & PNG_USER_TRANSFORM) != 0)
|
||||
if (png_ptr->write_user_transform_fn != NULL)
|
||||
(*(png_ptr->write_user_transform_fn)) /* User write transform
|
||||
function */
|
||||
(png_ptr, /* png_ptr */
|
||||
row_info, /* row_info: */
|
||||
/* png_uint_32 width; width of row */
|
||||
/* size_t rowbytes; number of bytes in row */
|
||||
/* png_byte color_type; color type of pixels */
|
||||
/* png_byte bit_depth; bit depth of samples */
|
||||
/* png_byte channels; number of channels (1-4) */
|
||||
/* png_byte pixel_depth; bits per pixel (depth*channels) */
|
||||
png_ptr->row_buf + 1); /* start of pixel data for row */
|
||||
#endif
|
||||
if (row_info->color_type == PNG_COLOR_TYPE_RGB)
|
||||
bytes_per_pixel = 3;
|
||||
|
||||
#ifdef PNG_WRITE_FILLER_SUPPORTED
|
||||
if ((png_ptr->transformations & PNG_FILLER) != 0)
|
||||
png_do_strip_channel(row_info, png_ptr->row_buf + 1,
|
||||
!(png_ptr->flags & PNG_FLAG_FILLER_AFTER));
|
||||
#endif
|
||||
else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
|
||||
bytes_per_pixel = 4;
|
||||
|
||||
#ifdef PNG_WRITE_PACKSWAP_SUPPORTED
|
||||
if ((png_ptr->transformations & PNG_PACKSWAP) != 0)
|
||||
png_do_packswap(row_info, png_ptr->row_buf + 1);
|
||||
#endif
|
||||
else
|
||||
return;
|
||||
|
||||
#ifdef PNG_WRITE_PACK_SUPPORTED
|
||||
if ((png_ptr->transformations & PNG_PACK) != 0)
|
||||
png_do_pack(row_info, png_ptr->row_buf + 1,
|
||||
(png_uint_32)png_ptr->bit_depth);
|
||||
#endif
|
||||
for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel)
|
||||
{
|
||||
*(rp) = (png_byte)((*rp - *(rp + 1)) & 0xff);
|
||||
*(rp + 2) = (png_byte)((*(rp + 2) - *(rp + 1)) & 0xff);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef PNG_WRITE_SWAP_SUPPORTED
|
||||
# ifdef PNG_16BIT_SUPPORTED
|
||||
if ((png_ptr->transformations & PNG_SWAP_BYTES) != 0)
|
||||
png_do_swap(row_info, png_ptr->row_buf + 1);
|
||||
# endif
|
||||
#endif
|
||||
#ifdef PNG_WRITE_16BIT_SUPPORTED
|
||||
else if (row_info->bit_depth == 16)
|
||||
{
|
||||
png_bytep rp;
|
||||
png_uint_32 i;
|
||||
|
||||
#ifdef PNG_WRITE_SHIFT_SUPPORTED
|
||||
if ((png_ptr->transformations & PNG_SHIFT) != 0)
|
||||
png_do_shift(row_info, png_ptr->row_buf + 1,
|
||||
&(png_ptr->shift));
|
||||
#endif
|
||||
if (row_info->color_type == PNG_COLOR_TYPE_RGB)
|
||||
bytes_per_pixel = 6;
|
||||
|
||||
#ifdef PNG_WRITE_SWAP_ALPHA_SUPPORTED
|
||||
if ((png_ptr->transformations & PNG_SWAP_ALPHA) != 0)
|
||||
png_do_write_swap_alpha(row_info, png_ptr->row_buf + 1);
|
||||
#endif
|
||||
else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
|
||||
bytes_per_pixel = 8;
|
||||
|
||||
#ifdef PNG_WRITE_INVERT_ALPHA_SUPPORTED
|
||||
if ((png_ptr->transformations & PNG_INVERT_ALPHA) != 0)
|
||||
png_do_write_invert_alpha(row_info, png_ptr->row_buf + 1);
|
||||
#endif
|
||||
else
|
||||
return;
|
||||
|
||||
#ifdef PNG_WRITE_BGR_SUPPORTED
|
||||
if ((png_ptr->transformations & PNG_BGR) != 0)
|
||||
png_do_bgr(row_info, png_ptr->row_buf + 1);
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_INVERT_SUPPORTED
|
||||
if ((png_ptr->transformations & PNG_INVERT_MONO) != 0)
|
||||
png_do_invert(row_info, png_ptr->row_buf + 1);
|
||||
#endif
|
||||
for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel)
|
||||
{
|
||||
png_uint_32 s0 = (*(rp ) << 8) | *(rp + 1);
|
||||
png_uint_32 s1 = (*(rp + 2) << 8) | *(rp + 3);
|
||||
png_uint_32 s2 = (*(rp + 4) << 8) | *(rp + 5);
|
||||
png_uint_32 red = (png_uint_32)((s0 - s1) & 0xffffL);
|
||||
png_uint_32 blue = (png_uint_32)((s2 - s1) & 0xffffL);
|
||||
*(rp ) = (png_byte)((red >> 8) & 0xff);
|
||||
*(rp + 1) = (png_byte)(red & 0xff);
|
||||
*(rp + 4) = (png_byte)((blue >> 8) & 0xff);
|
||||
*(rp + 5) = (png_byte)(blue & 0xff);
|
||||
}
|
||||
}
|
||||
#endif /* PNG_WRITE_16BIT_SUPPORTED */
|
||||
}
|
||||
}
|
||||
#endif /* WRITE_TRANSFORMS */
|
||||
#endif /* WRITE */
|
||||
#endif /* PNG_MNG_FEATURES_SUPPORTED */
|
||||
#endif /* PNG_WRITE_SUPPORTED */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,4 @@
|
||||
|
||||
#define MICROPROFILE_ENABLED 1
|
||||
#define MICROPROFILE_GPU_TIMERS_D3D11 1
|
||||
#define MICROPROFILE_GPU_TIMERS_D3D12 1
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,333 @@
|
||||
#ifdef MICROPROFILE_EMBED_HTML
|
||||
#include <stdint.h>
|
||||
|
||||
const uint32_t uprof_16[] = {
|
||||
0x474e5089, 0x0a1a0a0d, 0x0d000000, 0x52444849, 0x10000000, 0x10000000, 0x00000308, 0x0f2d2800, 0x00000053, 0x47527301, 0xc9d90142, 0x00007f2c, 0x48700900, 0x00007359, 0x0000130b, 0x0001130b,
|
||||
0x00189c9a, 0x50ff0000, 0x0045544c, 0x3d190000, 0x366b3818, 0x296ad96f, 0x6b382757, 0x214b2336, 0x37245226, 0x6b383569, 0x183e1936, 0x3569d76e, 0x411b336e, 0x2652281a, 0x19183d19, 0x6b38183d,
|
||||
0x46924936, 0x20275729, 0x57291e49, 0x4fa45327, 0x38193e1a, 0x7d40366b, 0x5cbd603e, 0x2665ce6a, 0x6b382456, 0x366b3836, 0x4557b05b, 0x4f244286, 0x2e673122, 0x38275929, 0xcc68366b, 0x27572963,
|
||||
0x3c265628, 0xb65c3a75, 0x27572958, 0x19183d19, 0x7439183d, 0x23532636, 0x6b316933, 0x512566d1, 0x366b3823, 0x66366b38, 0x6b3862c9, 0x376d3936, 0x29408043, 0x5d2a2757, 0x27572927, 0x2f275729,
|
||||
0x3d192d62, 0x53ac5718, 0x2f4a964d, 0x3d192d62, 0x438d4718, 0x521a411b, 0x6b384f9f, 0x5ec36336, 0x1938793a, 0x6a37183d, 0x3b773e35, 0x385bb95f, 0x3d19366b, 0x183d1918, 0x5947954b, 0x9a4f55b0,
|
||||
0x2a5e2d4c, 0x2b366b38, 0x67252959, 0x00002581, 0x52745500, 0xff00534e, 0xf6ffffff, 0x33ffffff, 0xffffffff, 0x2d1ff3ff, 0x23fff1ff, 0xffa97fff, 0xc9ffffff, 0xffffff89, 0xff30ffff, 0xffa2ff25,
|
||||
0xffae5bbd, 0x5cffff8b, 0x81ffc34c, 0xffb2ff67, 0x27a17a3e, 0x38ffffff, 0x57ff89ff, 0xff62ffff, 0x2337ffff, 0xffffffb3, 0x6bffccff, 0x00656578, 0x49c30000, 0x78544144, 0x458f3d9c, 0x0c40c316,
|
||||
0xa8753d43, 0x9999940d, 0xe1999999, 0x4ce967fe, 0x2f3ff692, 0x190b4b2c, 0x05897180, 0xfc2b3102, 0x3a2dbeb0, 0xb7a1a751, 0x6f84c5bc, 0xc1d53ee9, 0xc7ea53f8, 0x32cf12e7, 0xf06d6a51, 0xa570fa2e,
|
||||
0x0c806d49, 0x2ab19ecb, 0xb4115114, 0xecba0663, 0xd08fc610, 0xa0a2f390, 0x0890a0f5, 0x4d98129e, 0x461a182b, 0x4c1ae922, 0x0bba8b5e, 0x1b0edf65, 0xaeaa9b29, 0xdc71cc61, 0x859c6503, 0x39084930,
|
||||
0x3a1e8e40, 0x4210f798, 0x40299087, 0xd6614b89, 0xb46e0c46, 0xb8add787, 0x3bb6a6f6, 0x3b91d558, 0x4bec0669, 0x40ef19e3, 0x38ae9954, 0x9ae6fffe, 0xaaf97f7e, 0xa5be5faf, 0x2b110712, 0x00001d18,
|
||||
0x45490000, 0x42ae444e, 0x00008260,
|
||||
};
|
||||
|
||||
const uint32_t uprof_16_len = 650;
|
||||
|
||||
const uint32_t uprof_32[] = {
|
||||
0x474e5089, 0x0a1a0a0d, 0x0d000000, 0x52444849, 0x20000000, 0x20000000, 0x00000308, 0x8aa44400, 0x000000c6, 0x47527301, 0xc9d90142, 0x00007f2c, 0x48700900, 0x00007359, 0x0000130b, 0x0001130b,
|
||||
0x00189c9a, 0x50b90100, 0x0045544c, 0x3d190000, 0x366b3818, 0x296ad96f, 0x4b232757, 0x224d2421, 0x34193f1a, 0x6b383264, 0x366b3836, 0x3a255727, 0x5729386e, 0x2b662e27, 0x3e2a5f2c, 0x3d193b76,
|
||||
0x285e2b18, 0x19366b38, 0x6b38183d, 0x67d46c36, 0x1f225224, 0x6b381d49, 0x285c2a36, 0x2255ae59, 0x3d192050, 0x2f673218, 0x38366b38, 0x3d19366b, 0x69d76e18, 0x2d1d461e, 0x713b2a63, 0x214c2339,
|
||||
0x3366d16b, 0x56283164, 0x40834326, 0x192c602d, 0x7137183d, 0x5dc16235, 0x38468d49, 0x5729366b, 0x366b3827, 0x383b7c3e, 0xd06a366b, 0x4c9f5065, 0x3057b55b, 0x83412d63, 0x2757293e, 0x6637763a,
|
||||
0x6b3862c8, 0x27572936, 0x19366b38, 0x6c34183d, 0x3f864331, 0x693e7b40, 0x743c64cd, 0x366b383a, 0x29245126, 0xc4642757, 0x366b3860, 0x38469049, 0x4b213574, 0x366b3820, 0x3c3f7e41, 0xbb603978,
|
||||
0x2757295c, 0x2552ab56, 0xb75c2351, 0x2e643158, 0x29183d19, 0x3d192757, 0x2c612f18, 0x1c183d19, 0x57291b41, 0x366b3827, 0x56275729, 0x864552a7, 0x183d1943, 0x29366b38, 0x57292757, 0x183d1927,
|
||||
0x5a366b38, 0x3d1956b0, 0x366b3818, 0x29275729, 0x4e232757, 0x366b3822, 0x21275729, 0x3d19204e, 0x183d1918, 0x19366b38, 0x5729183d, 0x27572927, 0x20469649, 0x612c1e48, 0x30613229, 0x535ab85e,
|
||||
0x6b3850a2, 0x366b3836, 0x291b421c, 0x7f3d2757, 0x4488473a, 0x19183d19, 0x3d19183d, 0x366b3818, 0x38356a37, 0x944d366b, 0x27572949, 0x4c3d823f, 0x9d514998, 0x2554274e, 0x3850a653, 0x6b38366b,
|
||||
0x2a5c2c36, 0x40e8e81c, 0x93000000, 0x534e5274, 0xffffff00, 0xffffffff, 0xff26fdff, 0xfffffcff, 0xd5ff19ff, 0xffff1127, 0xffffddff, 0x3aff0cff, 0xffff3709, 0xffffffff, 0xffffffff, 0xffffffcd,
|
||||
0xff8b0643, 0xffffffa7, 0xff84ffff, 0xce2b1eff, 0xffffffc1, 0xffc8ffff, 0xff9eff14, 0xff38ffff, 0xffc7ffff, 0x04ffffff, 0x802371b6, 0x8e01d6ff, 0xc0b424ff, 0x33301ded, 0x6d99de10, 0xade3f703,
|
||||
0xf028f9ff, 0xffc30e8d, 0xffffff2a, 0x19aefbff, 0xd3ffffbe, 0xff492f94, 0xff22ffe9, 0xffffffff, 0x2cffd806, 0x002e00bf, 0x49ff0100, 0x78544144, 0x8993759c, 0x18511257, 0x016f1fc5, 0x14150505,
|
||||
0x40410104, 0x2b525c91, 0x4d295cb7, 0x36972d41, 0xd17db4b5, 0xf6cb2f68, 0x2feb353d, 0x1ad9beee, 0xce67ba06, 0xbf7ce77c, 0x337df73b, 0x66210def, 0x51a33a1d, 0x8ff921e7, 0xeef5dd6e, 0x3bd76852,
|
||||
0x77065733, 0x8d26a69f, 0xe6e0b17e, 0xac5a4abe, 0x7e66f537, 0x512d37f2, 0xb7c4d3a3, 0xdfa5394b, 0x57b3470c, 0xd4d554ed, 0x26a24a9c, 0x8664ab51, 0xf68ccabe, 0xd8c66bc8, 0x21a50eec, 0x343689d4,
|
||||
0xd51e54fa, 0xd00b3be7, 0x67a1da91, 0x0af62350, 0xc315ba74, 0x56d17d35, 0x6d10b480, 0xec1ac671, 0xd7463a42, 0xc07a9dc1, 0x10a7783c, 0x84350862, 0x8bf21d2a, 0xfb01e8f5, 0xc7007b00, 0x754208e5,
|
||||
0x7c60c0f4, 0x430057c1, 0x2251cbe8, 0x1a38aec2, 0x5f2c7861, 0x80595e50, 0x6036e83f, 0x2b708f04, 0x936f5f19, 0x9df5da7a, 0xece92576, 0x48b0f824, 0x11c8754d, 0x6a60e9dc, 0xcf084ea9, 0xdf31b20b,
|
||||
0xa161fedb, 0x2ae5727d, 0xe127b2c0, 0xf73c2397, 0x77090227, 0x15d2fdc0, 0x33c69723, 0xdefe8591, 0x900cbe01, 0x3f1a6bad, 0x5fc27a86, 0xd936adb0, 0x1896811c, 0x0d35ca79, 0x72b8a933, 0x9b0e9d67,
|
||||
0x5c8447aa, 0x333f7957, 0x6dc6bdeb, 0xa99e4261, 0x95b40986, 0xcb2e4cf4, 0x7f8d79e2, 0xaa0e6bc4, 0x9cc04586, 0xd74053cb, 0x03d2e4b1, 0xa370c32e, 0x1dc8315a, 0x3e86fa32, 0x20bacdcb, 0xb5d30679,
|
||||
0x4c7cac3a, 0x1911cdd9, 0xc5808031, 0x7a988092, 0xf0c0ae20, 0x569f860b, 0x513b49fe, 0xbe71cf47, 0x5b060c12, 0x5848fc2c, 0x6bd3943f, 0x0c954f9c, 0xdff6a770, 0xc6469eb1, 0x79e5aac1, 0x832ac713,
|
||||
0xb45d3cd5, 0x293093c4, 0xce03c8d6, 0xbcde06f3, 0xfcefe659, 0x96ddef71, 0x2ec70f84, 0x4560cafa, 0x7cfadff7, 0x5a8be7b5, 0x0e16017f, 0xe8187143, 0x00000636, 0x45490000, 0x42ae444e, 0x00008260,
|
||||
};
|
||||
|
||||
const uint32_t uprof_32_len = 1214;
|
||||
|
||||
const uint32_t uprof_192[] = {
|
||||
0x474e5089, 0x0a1a0a0d, 0x0d000000, 0x52444849, 0xc0000000, 0xc0000000, 0x00000308, 0x9c026500, 0x00000035, 0x47527301, 0xc9d90142, 0x00007f2c, 0x48700900, 0x00007359, 0x0000130b, 0x0001130b,
|
||||
0x00189c9a, 0x50c20100, 0x0045544c, 0x3d190000, 0x366b3818, 0x296ad96f, 0x4b232757, 0x224d2421, 0x1a69d66e, 0x421c193f, 0x2556271b, 0x253e9443, 0x592b2351, 0x3e844129, 0x3e60c565, 0x753b3a8a,
|
||||
0x3c8e4039, 0x60295e2b, 0x54265bbd, 0x2b5c2d24, 0x49357f39, 0xcd69468f, 0x5ab85e64, 0x3c62c967, 0x88443885, 0x3f804141, 0x3567d36c, 0xc1633276, 0x2b622d5e, 0x2f366f38, 0x6b382c69, 0x51a75536,
|
||||
0x513b7b3e, 0x6b384da0, 0x66d06a36, 0x4f2e6030, 0x6a334c99, 0x49954c31, 0x30347a37, 0x5c292e65, 0x1d471e26, 0x3350a354, 0x8c463071, 0x55af5943, 0x4e366b38, 0x6b384a9c, 0x57b45b36, 0x382e6e31,
|
||||
0x6b37366b, 0x27572935, 0x20366b38, 0x3d191f4b, 0x366b3818, 0x19366b38, 0x5729183d, 0x53ab5627, 0x38366b38, 0x3d19366b, 0x366b3818, 0x38183d19, 0x3d19366b, 0x366b3818, 0x29366b38, 0x57292757,
|
||||
0x366b3827, 0x29275729, 0x3e192757, 0x183d1918, 0x38183d19, 0x3d19366b, 0x183d1918, 0x19366b38, 0x5729183d, 0x366b3827, 0x29275729, 0x57292757, 0x366b3827, 0x38183d19, 0x6b38366b, 0x46944a36,
|
||||
0x38366b38, 0x6b38366b, 0x27572936, 0x29183d19, 0x57292757, 0x27572927, 0x19366b38, 0x5729183d, 0x366b3827, 0x19183d19, 0x3d19183d, 0x183d1918, 0x19183d19, 0x6b38183d, 0x27572936, 0x29366b38,
|
||||
0x3d192757, 0x183d1918, 0x19366b38, 0x6b38183d, 0x183d1936, 0x29275729, 0x3d192757, 0x366b3818, 0x29275729, 0x3d192757, 0x27572918, 0x45366b38, 0x57294098, 0x2d633027, 0x6d448c47, 0xa05068d6,
|
||||
0x62c8664d, 0x2868d56d, 0xd56d2656, 0xe6ab1468, 0x000000dc, 0x4e527496, 0xffff0053, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffcffff,
|
||||
0xff02ffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfff6ffee, 0x03ff1dff, 0x0e03ffd6, 0xff0cfb40, 0xcf231507, 0xb61b2312, 0x85fd2495, 0x0b4ed0e7, 0x70cbaca5, 0xc7f79fde, 0xe7f03dc4, 0xff7853f3,
|
||||
0x864ca429, 0xa7dc17ec, 0x7173e5bf, 0x7e96bdb1, 0xb363d536, 0x5d89312e, 0x3e37645c, 0x8c2c9d49, 0x5bdb5366, 0x0593ff6c, 0x78b998d4, 0x67d57f01, 0x007fccad, 0x49831000, 0x78544144, 0xf95bed9c,
|
||||
0x1f47135f, 0x3b9b26ce, 0x1721b721, 0x80920490, 0x84120102, 0x4a9c8080, 0x0aada811, 0xa282d56a, 0xb5bc55a8, 0xd5eb155a, 0xe8f7db6a, 0x33befffb, 0xbb3639bb, 0x4863ddf3, 0xf1f3f636, 0x7491a1f9,
|
||||
0xbe679f74, 0x31677ce7, 0x2be2be18, 0xe819a2be, 0xb9313d9d, 0x7f7f7cf2, 0x7f6e6e6e, 0xe4cafaff, 0x56ded989, 0xa58b5253, 0x6b4fb995, 0x1c2fa777, 0x5631ef1d, 0xf47e33d0, 0xdaeaf4c2, 0x2fc9b9b3,
|
||||
0xcaef465a, 0xd31bd3d5, 0x8c24da35, 0xdb5c6f4f, 0x53356c9d, 0xf7f91002, 0xc9e4b697, 0xad6c4557, 0xb2fdde9e, 0xdafd716c, 0xee2ab8f2, 0xf4bd1c35, 0xb0d10be9, 0x4176bbb4, 0xa60af923, 0xb52fefdf,
|
||||
0xf3ef7d98, 0xeeb4976b, 0xee1d9d7d, 0xbd0ed4b6, 0x6107ab73, 0xb1b0d65f, 0x93fa22df, 0x475d68d7, 0x27fbe58c, 0xbbdf6774, 0xf451ba72, 0xefa67a11, 0x4f5a9ceb, 0x38da3fbc, 0xaeb61cfa, 0x93cf18e9,
|
||||
0xfaee0fef, 0x67a70904, 0xfb3fa1f5, 0xf409ba69, 0xaf967a11, 0x7f6121ea, 0x39f439b9, 0x37af7709, 0x86e4fe9b, 0x5a8176ba, 0x46a6fbc2, 0x06abd2f3, 0xcb001ea6, 0x6cabcdbb, 0xddcdabb3, 0x6b3d1e7e,
|
||||
0xde848a4d, 0xd03a5b57, 0xdbb0b8c7, 0x6bb3fe0c, 0x649dc8cd, 0xbc6fdf8c, 0x989a5611, 0x6d58087c, 0x5b6782b4, 0x6547f2ba, 0xb191ae6d, 0x3f5f74bc, 0x782aa9f7, 0x4b0538d6, 0x47d3ba6b, 0x28dd39e8,
|
||||
0xb52e2705, 0x8dc23f82, 0x2bd974c6, 0x346fe2ad, 0xc142346e, 0x6eb526f5, 0xf07cb0aa, 0xab7cf464, 0x8291fc85, 0xfb777683, 0xe47e6fcd, 0xcd60e971, 0xf356f3dd, 0x0fa71a37, 0x5b2b0712, 0x708fa6ad,
|
||||
0xbf9e8569, 0x0403edbe, 0xf662b6ea, 0x97a9ab6e, 0xd1574ab1, 0xfe14be96, 0xcd1ae346, 0x74e962c4, 0x30d769ab, 0x06c29f7e, 0x7d38f4cf, 0x9cf8c5a9, 0x8dbbfe66, 0x0c1d5c9e, 0xb416b547, 0x002fad13,
|
||||
0x56d558f5, 0xb556960e, 0x99edf3fd, 0x48c8c8cc, 0x823b972e, 0xd0303031, 0x23e8a1ce, 0x2f10ef2f, 0x77d7e1df, 0x4d623cc8, 0xd35c1853, 0x3498dfc6, 0x9c391111, 0x211f2e27, 0xb00d372f, 0x8c47c0c7,
|
||||
0x7fc0d2bf, 0xff1b4b6e, 0xd0991f6c, 0x4fd2cba8, 0x04041f5a, 0x586ecd64, 0x5df551c1, 0x0ed692d1, 0xb420007a, 0x485b3663, 0x9af40036, 0x053966dc, 0x8356d437, 0xf91af7de, 0x4201471b, 0x70523369,
|
||||
0x03bcb258, 0xcb431e58, 0x745e32cd, 0x6903ad4d, 0x2103c13e, 0x64947780, 0x1960c803, 0x06c65cbc, 0x3adaea5b, 0xda442ded, 0x04a3b32a, 0x0101441b, 0x21fd7e59, 0x555dc150, 0x10b7b402, 0x88d08009,
|
||||
0x07c0a899, 0xbb9f4084, 0xc1b61ebc, 0x27fc1555, 0x286097b5, 0x5477962b, 0x810a00ac, 0xdeb2a5a4, 0x59693d0d, 0xdef51339, 0x0a1fccd0, 0x6643ce81, 0x0a2382a2, 0x045ec306, 0xa2b4ea3d, 0x3ded3980,
|
||||
0x6953b65c, 0x01029147, 0xb5672825, 0x368396d5, 0xc714aa38, 0x0c087b5a, 0x66320428, 0x4836aa21, 0xadcbc87b, 0x0a1566fd, 0x7808286e, 0xcd043145, 0x758a0201, 0xd16eaa02, 0xe82c1801, 0xa1172e20,
|
||||
0xed2dbe47, 0x416299a5, 0x5ebfb159, 0xa1536540, 0x2f231810, 0x1ebe4317, 0xf7f052ef, 0x3c84c8c5, 0x72a3116e, 0x02012f82, 0x89cb243a, 0xdb3d938f, 0x218cd12c, 0xcb19408a, 0xf88cc458, 0x9af4054d,
|
||||
0x64e59252, 0x02321b05, 0x07f052ae, 0x424240ab, 0x7c746b88, 0x6108f2c0, 0xc68bd139, 0xb011c39f, 0x6d402341, 0x8e94f008, 0xa3e58115, 0xa216d584, 0xa444e00d, 0x00c38bbd, 0x8bab031a, 0x2eccc024,
|
||||
0x88da0202, 0xc60a49cb, 0x9525d3c1, 0xa100b201, 0xd9909120, 0x41015405, 0x22f456d9, 0xa59eada8, 0xbd40441a, 0x962b38b1, 0x80aa0291, 0xa2306c87, 0x26032d17, 0x1fc34678, 0x32698acc, 0x33862821,
|
||||
0x2f64e5e4, 0xb3a53722, 0xbe315754, 0x84509908, 0x0c81d325, 0xa059ca46, 0x74b0f202, 0xd7146a9f, 0xa0815401, 0x00700ab4, 0xe625660c, 0x2f521e2c, 0x10fa22da, 0xda142cdd, 0x9bb01cd1, 0x024b1940,
|
||||
0xf06c0306, 0x041e61a9, 0xc692c6f6, 0xb3940780, 0x8290bd00, 0x5d808269, 0x069022aa, 0x3cd6330e, 0x2018c999, 0xaa055c80, 0x0f517b10, 0x774664e1, 0x9401df1b, 0x5c6f5131, 0x0fb65405, 0x1c100bcb,
|
||||
0x933c7827, 0xe69ba00a, 0xcb8dedaa, 0x4f210170, 0xa844846a, 0xa486c1b7, 0xe2a15ea9, 0xfa0435af, 0x46a4e581, 0x2f7a8448, 0x3e888e92, 0x1a0009d1, 0x02101303, 0x10a72750, 0xbcea3c02, 0xedea3c48,
|
||||
0x02217ba5, 0xe47dabaa, 0xa601602a, 0x242350ba, 0x6b06d082, 0xe8270122, 0xf3a0642e, 0xc0cc897c, 0x127c840d, 0xfac48468, 0x45960a05, 0x8a8e78c5, 0x080331bf, 0x38332768, 0x1b872c06, 0x5e6a1121,
|
||||
0x6bb61e24, 0x01e0d1bd, 0x119a484e, 0x366a1c02, 0x14743510, 0x3c2338f3, 0x55018ad2, 0xc8cc3800, 0xd4224235, 0x41f57c46, 0x834af9a0, 0x40a3b407, 0x83003808, 0x21bd57d5, 0x885ee9e9, 0x3ae5828a,
|
||||
0x62e9cf01, 0xefcf3a18, 0x03ed9f90, 0xd55d58ca, 0xf2c378b3, 0xd17b2846, 0x7b295d78, 0xadab7745, 0xa317e830, 0x8772cd5d, 0x939f2e33, 0x37545e2a, 0xa56ba3a2, 0x1f4cc3a1, 0xd95004e0, 0xe9bf200e,
|
||||
0xf6ea2cae, 0x26f243fb, 0x5d517b28, 0xe71d5314, 0x4b80ed8d, 0x042d8094, 0xc8be00aa, 0x1657f419, 0x439dbb85, 0x7ab8020a, 0x508ffd90, 0x418bdd00, 0xf92f75e0, 0x396029b9, 0x677102ae, 0x3fc87459,
|
||||
0x628f97e3, 0x4745ef33, 0x201425fe, 0xe10ee18a, 0x24b67995, 0x944c5de2, 0xf75d00ff, 0x858fc8fa, 0x72f0666e, 0xbbdb657f, 0x84f0b6e3, 0x45ec0092, 0x59ff7fc9, 0xa22b3fe3, 0x3e721418, 0x30bd1262,
|
||||
0x9ff28910, 0x980aa069, 0x1e5d5324, 0xabe00840, 0x5e338b31, 0x278517e0, 0x652eae98, 0xcefe9601, 0x0135dbe9, 0x9d3a5ed5, 0x3d1472c9, 0xa6a3be02, 0x121857fa, 0x48af1891, 0x0a57baf6, 0xc61c7007,
|
||||
0x3bd67fc7, 0x3989e711, 0x7d774c43, 0x2311751e, 0x71fa552a, 0x0d09d09d, 0xd3b00698, 0x4db52358, 0xedac7b4f, 0x09d9e6f5, 0x21a6cb16, 0x202c9163, 0x5205532f, 0xc51f0761, 0x199db881, 0x3dfdd6f2,
|
||||
0x4840bfaf, 0xe5b0854b, 0x65404d45, 0xf3ed9d2a, 0x7b47d064, 0xf4db5929, 0x4474a7a2, 0x33a3bfc8, 0x0d951035, 0xd330e001, 0x55c72c06, 0xcc3130a0, 0x3760f147, 0xc2bcb8c3, 0x53f9773d, 0x54694e5d,
|
||||
0x676c87c4, 0x97ee026a, 0x77048dc9, 0x81d1b730, 0x91e71ad1, 0x508cb1d1, 0xf5946640, 0x708da675, 0x4bace815, 0xcaee8122, 0x89b800d1, 0x1fcec4ea, 0x01fdd94f, 0x618bad8e, 0x1de5bd86, 0x61523ee7,
|
||||
0x171dd31b, 0x87790ff3, 0x01359799, 0x3a2397e5, 0x27ace962, 0xb2c74c6d, 0x0e28b563, 0x4309b4ee, 0xb349e7da, 0x99096287, 0x394ca810, 0x4f51b827, 0x579873f8, 0x17e60160, 0xb66b2741, 0x970c43f8,
|
||||
0x1b4e027b, 0x7cbcd8c3, 0x15700a46, 0x4664db0d, 0x5e52db52, 0xd25e731b, 0xd847468b, 0x7a8b27bc, 0xd56dc3cc, 0xa6774e28, 0x1a4149d3, 0x2cdd45ca, 0x8728cb9b, 0x4e33eb80, 0xd0e71626, 0xadef17a0,
|
||||
0x63281fb9, 0x3982aec5, 0x52661ce4, 0x57516883, 0xc8308317, 0xd78b6595, 0x7e2d3e89, 0x9b06fe07, 0x09a81529, 0xd71f0bc0, 0x0c56ac04, 0x84c1b2c0, 0xd36318b1, 0x5f70939c, 0x48f95326, 0x53c026b6,
|
||||
0xe7d65964, 0xf9e7c1f1, 0xe1372772, 0x600e738c, 0xcab817b7, 0x7cde1d04, 0xd0863fc8, 0xb7cf63c6, 0xa65b31c4, 0x80d1e5c0, 0x5b8c2bb3, 0x4df461a3, 0x2bdd8fc0, 0xe7996d8e, 0xc037adf2, 0x04d4bf30,
|
||||
0xa477af70, 0x5b883b93, 0x1b98c466, 0x157df365, 0x963923ce, 0xba42d6b5, 0x8b479623, 0xf0097ddc, 0x722a6330, 0xbbf8b6e6, 0x53c72bb1, 0x3843f1e8, 0x5bc3a140, 0xe734e42a, 0x77630cbd, 0xaf01cc3a,
|
||||
0x70080b1d, 0x089e1d01, 0x94e65df9, 0x8c337f1f, 0xdc5767fe, 0xebd29d8f, 0xcec3600c, 0x5123cc30, 0x3b103127, 0x07b5b884, 0xeb04d18d, 0xd9d4a24e, 0x9a22cb1e, 0xa9eb2c1d, 0x1628d1e5, 0x198bb2c9,
|
||||
0x632a0263, 0x6e2ece63, 0xeee1ecff, 0xb571fef2, 0x73dbba15, 0x41857220, 0x329bcab4, 0xb44fe177, 0x2075e0be, 0x78b6c3e6, 0xc854ecaa, 0x99ce0287, 0xd632f202, 0x98b7e13f, 0xf4a46103, 0x5fc04d62,
|
||||
0xd8933a38, 0xc46cd839, 0x8647e9e7, 0x7db221c8, 0x13b674d1, 0xe71478ed, 0x2e4523a4, 0x0273f687, 0x1434c912, 0x20d2a602, 0x0b88284e, 0x2f6e8df2, 0xb8a1f8f7, 0x772d0f25, 0x30a9bcd8, 0x5c26540a,
|
||||
0xc3031ce0, 0xc2bb0e1e, 0xb4970605, 0x8df710f8, 0x609f1e23, 0xb98b4e42, 0xcdec30ab, 0x1826bb9b, 0xfeff80a1, 0xa853812f, 0xb7eb531b, 0x88027bb6, 0xebe8c961, 0xdbda46cc, 0x50add863, 0x38ac26cc,
|
||||
0x8e517394, 0xe8758e3f, 0x6a34c362, 0x905b889f, 0x272e3347, 0x3dd841ef, 0xd450d002, 0x050a6294, 0x9a2d086f, 0x63b0bb08, 0x1e217ff0, 0xc6185a77, 0x87f874e2, 0x9138a379, 0x29bdd977, 0x0cc5d397,
|
||||
0x2c7e1df9, 0xc0555ceb, 0x8a457f9f, 0x472cbebe, 0x968b102d, 0x8f31c7d0, 0xcee2332f, 0xe8238246, 0x3ab85407, 0x3b58c53c, 0x5e3ea1ca, 0x8398bb00, 0xb514c25c, 0xd405e3d9, 0x64763193, 0xccf1fe6d,
|
||||
0x7aaa17a0, 0xf0e31f26, 0xbc86cb72, 0xb2b65d13, 0xf00b5400, 0x61bcdb1e, 0x14abf96f, 0x4f0818d6, 0xc3c69360, 0x009d7b4e, 0x9e63f7c3, 0xa78062d2, 0x431cea56, 0x99d43dff, 0xa3b22088, 0x30ef2cd6,
|
||||
0x58f745c1, 0xb78478d4, 0xe40afe12, 0x90588a6f, 0x29d8bdad, 0x32e1fd06, 0x1418c09f, 0x6d9ca631, 0xf31fb3f8, 0x03faf199, 0x5cc3154c, 0x073b7738, 0x4eec0119, 0x1d77fe3f, 0x0533ce4e, 0x3bbdf031,
|
||||
0x532fea67, 0xe07531db, 0x83d44f0f, 0xc531655d, 0x324ccd65, 0xb2c7f6cf, 0x22f29dc9, 0x00a069e4, 0x42250253, 0xe38c00ec, 0xe4fcaa73, 0x11b55002, 0x338c033a, 0xfc4979ce, 0xc22330f3, 0xbaeee7f0,
|
||||
0x49bcc39f, 0x0122130b, 0x85775997, 0xe3ebeb3f, 0x4d6a38fe, 0x31b655b0, 0x8247762e, 0xe0e50e5c, 0xc3f3de86, 0x3d8c4294, 0x9162e364, 0xde80e467, 0x1a50e167, 0xa699f30e, 0x8fe62e2b, 0xfdd50bbe,
|
||||
0xfc121968, 0x3fa34820, 0x12a435b3, 0xc58c9b9c, 0xdcafd552, 0xf9412e51, 0xf57739ac, 0x700aa82b, 0xc18f2a94, 0xec73606e, 0x5845adc8, 0xab7176ec, 0x00a90e5d, 0x5dfa4dbb, 0xf6428205, 0xef209596,
|
||||
0x87c0fc13, 0x35573b87, 0xfa0fdb13, 0x4edf4634, 0x7627cf80, 0xbb24b647, 0x18a44392, 0x10c26982, 0xa53712b4, 0x75001402, 0x63583572, 0x26444f1e, 0x821a4452, 0x0156bca5, 0x9eee6682, 0x5a600166,
|
||||
0x467586a7, 0x043d7299, 0xcd47f4ed, 0x1691a002, 0xf2b5163d, 0x9a070467, 0xf7f95a2b, 0x129169c3, 0x633294d6, 0x04d49e11, 0xd0156bac, 0xd5b9daa6, 0xcad76822, 0x4d64fb7f, 0x015682c0, 0x0a9d89b2,
|
||||
0x7806cd09, 0x804d4dfa, 0x028d3be1, 0x1686cec0, 0x500d4211, 0x02b383c0, 0xf1b59701, 0x76e72b77, 0x14c9c88d, 0x4282002c, 0xd1dc306c, 0x68dd2026, 0xcd7ea6fe, 0xc06585fc, 0x9b5bf860, 0xf3469d80,
|
||||
0x8037698f, 0x0c1a8b30, 0x85ab7fbf, 0x55e1bbbf, 0x7f3b5da0, 0xc050a4e6, 0x7c514d0b, 0x1e25fa18, 0xa3c58005, 0xff9da5cf, 0x80a171fc, 0x08b5efa9, 0xe5e7ee80, 0xa087cc91, 0x30a195e4, 0x0ea1a6c0,
|
||||
0xba18a29a, 0x758392eb, 0x019c750c, 0xa83114e0, 0x478257cc, 0xb53402f5, 0xabbbd073, 0x9df20832, 0x06d10cc2, 0x1c7dcd49, 0xd4618a23, 0xe288690d, 0x14070a43, 0x95fd4a29, 0x236f632c, 0x2af68fc4,
|
||||
0x4eb730cc, 0xfdb80bd5, 0x3e017aa3, 0xc81837e8, 0xd8b9da41, 0xdaeb3825, 0x04891902, 0x851855ed, 0x017af1c0, 0x316a1a53, 0x797c0554, 0xed3c6982, 0xab96d392, 0x4a2ebf58, 0x021c5fc1, 0xf507c306,
|
||||
0x6ea9a002, 0x16f9b188, 0x26b1d605, 0xfc965973, 0x98a14b78, 0x6bce568b, 0x2f011a05, 0xd5d602c5, 0x12300107, 0x1106e3ea, 0x973160ec, 0x76e4cc59, 0x1981d2da, 0x1b6afab9, 0x74f9b176, 0x4dada3b6,
|
||||
0x81514c32, 0x02c5275b, 0xe5a93f0c, 0x4b394d0f, 0x8b491b34, 0x0225c773, 0x002b50fe, 0xc9a2ebba, 0x7890d425, 0xebf0c190, 0x80052a0f, 0xf91d7e83, 0x0a929fcf, 0x4dd95058, 0x473f6f40, 0x2d11aa68,
|
||||
0x55fca536, 0x54d0d4b7, 0xd2192a94, 0x804935e2, 0x850c62ca, 0xfc8e98c0, 0x935865c5, 0xf9e7410f, 0x1e028eac, 0x53a3f890, 0x6efe1a8d, 0x06b625a0, 0x30db9f94, 0x580b219c, 0x410fd350, 0x8eaa2d23,
|
||||
0xdf9b1292, 0x3aa80590, 0xbdd74014, 0x6a056314, 0x1bf8079c, 0x0130a8ae, 0x875696f4, 0x21b7fc7e, 0x7ea61803, 0x9d001656, 0xc70f350a, 0xe21171e9, 0x62b1aa8f, 0x43437526, 0x8c8e9a51, 0x3ed2db0e,
|
||||
0x8ac616ae, 0x3ce802a7, 0xbf8dd49f, 0xc29576f0, 0x5d6fe004, 0xfb7fc6e9, 0xa5009c8d, 0x05540af1, 0x09ba5d4c, 0xa46d28b8, 0xdf28f885, 0x9181e693, 0x64c52756, 0x32f30e8a, 0x4099c011, 0x2181113e,
|
||||
0x827af9a0, 0x8011b216, 0x41d2df21, 0xd19a79e7, 0x6dc8151a, 0xde099d5c, 0xce8009ca, 0xc69dbaf3, 0x97f12b1e, 0xa0a5109f, 0x78c51691, 0x8a9b0a9f, 0x1bf84006, 0xf42ca276, 0xc57a788b, 0xd686d030,
|
||||
0x638e0163, 0x517b7ae8, 0xce0618a7, 0x015c6201, 0x96f42953, 0x04fdcd16, 0x5214f605, 0xe0530568, 0x0dd013ab, 0x011f5a45, 0x512d1b60, 0xe863d400, 0xfa4d3957, 0xb3c5c084, 0x4e2bd4ca, 0x8271be44,
|
||||
0x5d11330e, 0x25ca330e, 0x7df20040, 0x46055407, 0xaf3fe0f5, 0x9d55032a, 0x4cba7488, 0xa6d02141, 0xe45f8087, 0x6e31389b, 0x87bd6613, 0x11e800da, 0x73c10f02, 0xf9d20024, 0xcb5ba1d8, 0x96b6c126,
|
||||
0x6a41e000, 0xce7a1dac, 0x25b8853f, 0x63218a7b, 0xa5a926ea, 0x3d38eb30, 0xbcfe61a9, 0x2b2800b6, 0x9614b620, 0x18d02856, 0x9b9015c0, 0x81fe90a2, 0x518eb840, 0x45627587, 0x03c15dd6, 0x86a809ad,
|
||||
0xac8ae4db, 0xd43f286f, 0x6c94809e, 0x80206ba0, 0x78755c93, 0xb4bcbe41, 0x9b46e6e8, 0xd8685b2a, 0xd22f6406, 0x9d54102b, 0x90141521, 0x5d0e8dc7, 0x1b9aa186, 0x740a2d08, 0xe403e508, 0x91a0211f,
|
||||
0xfcd9a5af, 0xc13fa91f, 0x76202828, 0x6aeb2c15, 0x536c206a, 0x82800ff5, 0x7e73e47b, 0xbdec1533, 0x847f1c6e, 0xd464e48f, 0xef7b06bc, 0x23e9235d, 0x22d303ac, 0xcfe85373, 0xf84c6b9f, 0x07f0b10a,
|
||||
0x8cd8e679, 0xbe7dbcaa, 0xc42be151, 0x3764afd4, 0xc15c3572, 0xd9944f6f, 0x2de16150, 0x5c1b9631, 0x371fe795, 0x0aaa7dde, 0x46b6277e, 0x9bcaad0d, 0x7d9a1a67, 0x10ee1224, 0xaab0d08d, 0x2fedccdc,
|
||||
0x1d3105e3, 0xe6102635, 0xf7b41dcf, 0x0f858354, 0x034243a4, 0xe6fcda6a, 0x1f246699, 0x847b8492, 0x50e07a8c, 0x13ad7bde, 0xf7db8c7d, 0x40f52908, 0x29b4fca1, 0xd4c61fa9, 0xc49fcdfa, 0xf6439e1d,
|
||||
0xcc395745, 0xf07f3d3f, 0x2c668b83, 0x54e4907c, 0x7cde50ca, 0x57eeefa9, 0xade57531, 0x42281828, 0xb351ef79, 0x092aaeea, 0xae5dee2f, 0x431a0c2b, 0xf3c3d6f9, 0xb75a9b27, 0xd14068d4, 0x4fca1940,
|
||||
0x356a9f1f, 0x3fd632fb, 0x2565a9dc, 0x6fe9ed75, 0x297f5ee7, 0xad4c39ec, 0xf979bc7f, 0x29556fbb, 0xf87bdf98, 0x8a2f99cb, 0x0b53197d, 0xf9ddee2f, 0x50d907e9, 0xee7a7ede, 0xe516bbf5, 0x5a98951c,
|
||||
0xdfc3f5ff, 0xfe6c1e8f, 0xdd5db7b6, 0xa7bdedf2, 0x7a3c1f0f, 0xcb4df2fc, 0x8e355623, 0xf2753d9f, 0x4f27bbe4, 0xf379bcde, 0x93bbdde4, 0xfb39bea7, 0x15fea18f, 0xc2cff15f, 0x69e401ff, 0x6f1037bd,
|
||||
0x000063a5, 0x45490000, 0x42ae444e, 0x00008260,
|
||||
};
|
||||
|
||||
const uint32_t uprof_192_len = 4942;
|
||||
|
||||
const uint32_t uprof_512[] = {
|
||||
0x474e5089, 0x0a1a0a0d, 0x0d000000, 0x52444849, 0x00020000, 0x00020000, 0x00000308, 0x24a6c300, 0x000000c8, 0x47527301, 0xc9d90142, 0x00007f2c, 0x48700900, 0x00007359, 0x0000130b, 0x0001130b,
|
||||
0x00189c9a, 0x50c20100, 0x0045544c, 0x3d190000, 0x366b3818, 0x296ad96f, 0x4b232757, 0x40994521, 0x2a224e24, 0x9644285a, 0x1b431c3f, 0x26193f1a, 0xbf612451, 0x68d56d5d, 0x42265628, 0xd76e3e93,
|
||||
0x48954b69, 0x2567d26c, 0x5f2b2354, 0x42894529, 0x2d468f49, 0x3d192b62, 0x5bbb5f18, 0x68366b38, 0xcf6a64cc, 0x346a3765, 0x5b2b5d2d, 0xab5657b2, 0x2e683053, 0x672e6e31, 0x873d62c9, 0x38703b38,
|
||||
0x65316834, 0xa25260c5, 0x3a763c4f, 0x3f2f6231, 0x70343a8b, 0x59b75d31, 0x3e50a654, 0x672e3b7a, 0x3378362b, 0x38327535, 0xaf59366b, 0x3f814255, 0x38275729, 0x8040347c, 0x4b994e3d, 0x381d481f,
|
||||
0x833b366b, 0x5ec16237, 0x44357338, 0x7f3a4285, 0x27572936, 0x21366b38, 0x6b381f4b, 0x183d1936, 0x4e366b38, 0x57294a9e, 0x366b3827, 0x384d9d50, 0x8e40366b, 0x366b383c, 0x38366b38, 0x6b38366b,
|
||||
0x366b3836, 0x19183d19, 0x3d19183d, 0x366b3818, 0x38366b38, 0x3d19366b, 0x438e4618, 0x38275729, 0x6b38366b, 0x366b3836, 0x29183d19, 0x57292757, 0x183d1927, 0x38366b38, 0x3d19366b, 0x27572918,
|
||||
0x19183d19, 0x5729183d, 0x366b3827, 0x38366b38, 0x5729366b, 0x183d1927, 0x29275729, 0x3d192757, 0x27572918, 0x29275729, 0x6b382757, 0x183d1936, 0x29275729, 0x3d192757, 0x366b3818, 0x38366b38,
|
||||
0x6b38366b, 0x366b3836, 0x29275729, 0x3d192757, 0x183d1918, 0x38183d19, 0x3d19366b, 0x366b3818, 0x19183d19, 0x5729183d, 0x366b3827, 0x29183d19, 0x3d192757, 0x27572918, 0x6e183d19, 0xd96f69d6,
|
||||
0x6ad96f6a, 0x6f52a756, 0xd96f6ad9, 0xf9a3176a, 0x00000094, 0x4e527496, 0xffff0053, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff04ffff, 0xfffffffc, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xfffff6ff, 0xfffffffa, 0xffff02ff, 0x04ffffff, 0xfb0cff06, 0x2910ff17, 0x20ff95ff, 0x3489d5e9, 0xef2917f1, 0xffb1c0ce, 0xaf3cdcf1, 0x5163e83c, 0x324762a8,
|
||||
0x4426c00f, 0x58734b9f, 0x1b73c53f, 0x655bd14b, 0xb9dd94dc, 0x70e3c652, 0x8b217cb9, 0x69807832, 0x80a1e597, 0x86a3adc8, 0xac5507d2, 0x127dd934, 0x00bc7d27, 0x49422f00, 0x78544144, 0xf99ded9c,
|
||||
0x9a46d47f, 0xddba6987, 0x8f7df03e, 0xc19f17b1, 0x303e3076, 0x83180d8c, 0xcb9a7301, 0x662f1009, 0xe1308136, 0x92c0d848, 0x3930201d, 0x99612048, 0x6efff9ec, 0x492ae955, 0x6f4952a5, 0x5ddd5549,
|
||||
0x19f32fcf, 0x7a356da7, 0xdf7d555f, 0x8763b4ab, 0x183060c1, 0xc183060c, 0x0c183060, 0x60c18306, 0x060c1830, 0xf271d543, 0xd7f3a5f4, 0x6f6f6dae, 0x5f6c203f, 0xd2fe76bb, 0xbfaa9399, 0x4e432195,
|
||||
0xf67eda5e, 0xdbc3eafa, 0x795c6f37, 0x27717d75, 0x5fd7dd93, 0xf371badd, 0x6f8b9df6, 0x7f383eee, 0x3637f55a, 0xf6f4e148, 0x6e77abdd, 0x9bbcb95e, 0xd70e736d, 0xfb7f7d6f, 0x9747ebe2, 0x27feaa8e,
|
||||
0x7a715218, 0x2f8bd7fb, 0x6c4f5c6e, 0xb78b10f7, 0xf37c3e6e, 0x7fea8ce0, 0xa398418f, 0xbc5eefe7, 0x23f92af9, 0x8dfae7cf, 0x8db66f3b, 0xa39cd04c, 0xb9df5ed7, 0xcbc3b111, 0xdbadf760, 0xea303fbf,
|
||||
0x3cce4f40, 0xeda5987b, 0x72b82f29, 0xa379f5e7, 0xd2e2b40c, 0xe56fb7af, 0xcb8f7b61, 0x66bf7e2f, 0xce0b409c, 0x55fb7afc, 0xb877c6be, 0x8138d37e, 0x7cbf4e62, 0xf18d4578, 0xfedf2e1d, 0x8a0804d5,
|
||||
0x66e6f4b8, 0x2c7e7b2e, 0x9b6e2e57, 0xb66f2085, 0xf47e2a2f, 0xfdbe5cfd, 0xb90704cc, 0x9dd1f471, 0x1e2daacb, 0xafc5f166, 0x407207c6, 0x2c5beb4f, 0x903e34de, 0x6a1ed731, 0xc58b7d6b, 0xba4ccf17,
|
||||
0x5d2e2b30, 0x4fd839cd, 0x0f3bf5c7, 0x6aa9df54, 0xdfafe4e4, 0x67ef4ecb, 0x26abadc7, 0xf6cb9436, 0xbd75091d, 0xd37dd93c, 0x38d2056c, 0x6a86faf9, 0xf2e1a67b, 0xefaa4bc5, 0xfe70555c, 0xfc3d8561,
|
||||
0xbc5fbb1e, 0x18221934, 0xd0565f47, 0xd6e2cfce, 0xa618131b, 0x8a9bf4e7, 0xae7cfd90, 0x413b343f, 0xac5cce3a, 0xcfdfb5d8, 0xaadb17ee, 0x720565ef, 0x951e8efe, 0xff7c391e, 0xacfdf552, 0xaeddae30,
|
||||
0xcc3fadec, 0x0f466795, 0xa2fdb30a, 0xb98fccda, 0x80b8d775, 0x5537db10, 0x8c2b2a9b, 0xad70080b, 0x077e9f2a, 0x9c3102e3, 0x3fbdbaaf, 0x072315c8, 0xa77339a3, 0xb98fcdda, 0x36428261, 0x5356afa7,
|
||||
0xc5e3c7e0, 0x5af7d579, 0xd6be8e43, 0x2643d5bc, 0x729a1fbb, 0x5a478071, 0xcf6678f5, 0xb54ddff5, 0x0bfce298, 0x9fc906d5, 0x3a0d465b, 0x2b58be9c, 0x9b9fbf9b, 0xee100a46, 0x52ec9a2a, 0x5345e2cf,
|
||||
0xbe71de2b, 0x227ef36a, 0x7df5aabc, 0x84cd64e0, 0xa8bc517e, 0x07816ee9, 0x01f0d055, 0xcd4df165, 0x3f4f8766, 0x5fc485ac, 0x546a373c, 0x59acbe0c, 0xf16417f1, 0x05260d6a, 0x7d51df4e, 0xcae275db,
|
||||
0xc8f6d535, 0x9435479b, 0x776115f8, 0x27022d6d, 0xa21feecd, 0xb6c09496, 0x160cff11, 0x3848d75f, 0x79aaf470, 0xacdcd9fc, 0xa5e11a89, 0x67df55ef, 0x48fcb97d, 0xe7b275b5, 0x7b4c9559, 0x2ac5c464,
|
||||
0x1f2782d7, 0xbac3beaa, 0x53aaa373, 0xac6be7c3, 0x8b0d23ed, 0x295b54cf, 0xe59aee3b, 0x5587845f, 0xbd1c0dba, 0x56cefaa8, 0x0db9d50a, 0x63c8a99c, 0xb970d43e, 0x7a998f0a, 0x09bf7260, 0xb57bfdd8,
|
||||
0xd75e8525, 0x5247e37a, 0xb755576e, 0xfd1351d8, 0x154ae625, 0x26338109, 0xcb8297f9, 0x76423355, 0xa47e74de, 0x6aaef162, 0x91e1c9cb, 0x72d3fe89, 0xe0a41ab5, 0x4bfb536b, 0x4148154f, 0x7101fd93,
|
||||
0xc42bc2a3, 0x1fe74d27, 0x1d155b90, 0xf2369c0c, 0x0ae5cc1f, 0x633d17ee, 0x58127f8a, 0x112ed8ac, 0x61c9fe13, 0x88168577, 0xbfec99af, 0xb6ab5e2c, 0x981e1a65, 0xbf1e5ff0, 0x7266b6ab, 0x8fea9a5e,
|
||||
0x5a562e4c, 0xb199e84a, 0x561e5cbf, 0x35dc0796, 0x9dcd97f6, 0xbb146a4a, 0xf2bfd26b, 0xf80f20a9, 0x0b3fd8d5, 0x078a576e, 0x233fe798, 0x8c03c42a, 0x4ee333fd, 0xa3412825, 0x02a433ff, 0xff130162,
|
||||
0x1ef68a67, 0x3fd8c8f0, 0xb6aa2e5b, 0xc6079f30, 0x557359fe, 0x5c798db5, 0xecfff933, 0x7432b8d1, 0xf2ffd4de, 0xe166db40, 0x9ffea633, 0xed35bb0b, 0xfa6d3910, 0x5162727f, 0x93b12ecb, 0x372fffa6,
|
||||
0xa478ebae, 0xcdffe99c, 0x75fa5791, 0x7d555f8b, 0x1b8b6a4f, 0x988c4dba, 0xdcce6002, 0x68252bd6, 0xa3b94012, 0xbce84255, 0x8fe50049, 0xd380e946, 0x055fece6, 0xfce6d6ec, 0xfd35a380, 0x5c7527de,
|
||||
0xd06c65d7, 0xe22b000c, 0x80a11e8a, 0x865200e9, 0x35c0a116, 0xe3a80013, 0x9beb6a8d, 0x9462900a, 0x008c85d7, 0x21728b54, 0x8ac03268, 0x55b6a1b9, 0x8011a5fc, 0x24da51aa, 0x0064c978, 0xf8f0a3d5,
|
||||
0x0f4aa388, 0x9d9b9f00, 0xba9a9a9d, 0xe88c3880, 0x43ececec, 0xf6f6f56c, 0x3a1c471e, 0x31196874, 0x8d373737, 0xfb2108f8, 0xeaf853f2, 0xc9d5de53, 0x1fabbde5, 0xd99eaeb2, 0xd5163de5, 0xcda80735,
|
||||
0x26285d00, 0xd5d115a6, 0x188435d5, 0x7d5d841c, 0x3bd5f93a, 0x97dbabac, 0x5dce58ff, 0x1f30a9d8, 0x00ad48f4, 0x04dc9fd8, 0x25f55d34, 0x613bd5c8, 0xd40e2f57, 0x11bac835, 0x19c064aa, 0x83c03dc5,
|
||||
0xd48c0b30, 0xae01b5d5, 0x80740c3e, 0x1e893abe, 0x038952f0, 0xcc00ce28, 0xbc702d01, 0x3fc0790e, 0x38fcbea5, 0x75abf2f0, 0x49403d12, 0xac8de036, 0xc3929f6f, 0xadec0b40, 0x0a407883, 0x54a7e009,
|
||||
0x6e03d327, 0x38145fe6, 0x0004baaf, 0x9a3b835c, 0x9aea05b1, 0x54007a53, 0xab90b402, 0xdc80f3cb, 0x2a8e85c7, 0xae00021f, 0x0596c3c1, 0x41c07ad2, 0xda7403a0, 0xe923df97, 0x0b1ee46e, 0x43014f2a,
|
||||
0x3aade0d7, 0x024c0790, 0x275abf2f, 0xe4ae03d9, 0x56de129b, 0xae86029e, 0x107533c1, 0x03a8f80f, 0x9d52f978, 0xb5c80f6c, 0xfaa4f449, 0x18684026, 0xf10756d6, 0xd5e03e80, 0x9757798f, 0xf3bb01e5,
|
||||
0xa0d3179c, 0x06b80c09, 0xa81650b7, 0xf49bde6b, 0x700950ea, 0x07be4eb8, 0x136fcadc, 0x8001bf50, 0xda4ee0d7, 0x49f57502, 0x012a003d, 0xf032eba6, 0x140edc80, 0x000360d6, 0x75abc1af, 0x4b000f10,
|
||||
0x0cba8680, 0x4db7203c, 0xb0047940, 0x0706be13, 0x03d0902c, 0x1f57817a, 0x925d5c0f, 0x0914e407, 0x0a05d168, 0x1643835c, 0x2301e648, 0x10b80740, 0x0f1cbcba, 0x5447a7c8, 0x4380b787, 0x05b0e0d7,
|
||||
0xd413eaea, 0x1d018f67, 0x797c3a60, 0x4b901e29, 0x8cb5e83a, 0xba050a6f, 0x2d85cf06, 0x5a03c490, 0xc3df9781, 0x0f14bcb8, 0x7026a1c8, 0x302e8b46, 0xcfdc1ae8, 0x07b880b0, 0x3d5e071c, 0xf34901bc,
|
||||
0xc3fbec80, 0x9af8cb6e, 0xf06b8060, 0x04d33d50, 0x301e8275, 0x2980740b, 0x7865d5f6, 0x8facf5c0, 0xe120790e, 0xb8004a4b, 0x2db08f06, 0x2d01ea20, 0x6d600740, 0x203cb240, 0xa3a0eee3, 0x7600a41a,
|
||||
0x43e0d7c2, 0xe6200e51, 0xcbc05d01, 0x2c8024b3, 0x1938c80f, 0x1bfc3bf0, 0x06ba00ca, 0x803a468f, 0x010e0d88, 0xba083eaf, 0x67df1c7a, 0x50f503a9, 0xb835e080, 0x04da39b5, 0x02983602, 0x0484403a,
|
||||
0x5901e590, 0x8e5d40ea, 0xc1ae0382, 0x080b1cc3, 0xe80060d8, 0x40125100, 0xce5c0792, 0x9afc4bae, 0x011022fa, 0x72f706ba, 0x06d6201d, 0x33cbc043, 0x1e895063, 0x48515d90, 0xa140b397, 0xd70cf06b,
|
||||
0x58367102, 0x239d5e06, 0xc078e401, 0xc23d5662, 0x4cdfa0cf, 0x9835d016, 0xdc080127, 0x1314cd5e, 0xe3663e49, 0x80f60eae, 0x5fd8d93b, 0x27701093, 0x881e0d78, 0x1d5d40b3, 0x3808686f, 0x8e5c5491,
|
||||
0x03d83abd, 0x550509b2, 0x40b8020f, 0x58cee0d7, 0x203d700b, 0x8040095b, 0x12660dce, 0xe6d69e0a, 0x35d0106d, 0x02de3578, 0x4e800f1c, 0xa1a54524, 0x16407aa5, 0xd0e8c727, 0x5d016206, 0x06f14b83,
|
||||
0x1a1e8ba8, 0xc5244e82, 0x1e19004a, 0x12fe4570, 0x680e4ba0, 0x742a7827, 0x9102c852, 0x04bd901e, 0xf201e190, 0x683545c7, 0xae81b604, 0x1d0567c1, 0x8003c220, 0x58fc57ee, 0x0f30eaf0, 0x3bbb2578,
|
||||
0x7d0e92ec, 0x35d01660, 0x138ed198, 0x00606b01, 0x2424913a, 0x80782401, 0x1fa4a3ec, 0x548dbe82, 0x64706ba0, 0x03c84e2d, 0x5917eea0, 0x01ec9689, 0x1ac21392, 0xa9d0002d, 0x5c44b8d0, 0x2740078c,
|
||||
0xd12ba292, 0xee403d92, 0x02d1a012, 0xc5835d00, 0x07a47854, 0xe0860f40, 0x7ae5a254, 0x2a9965c0, 0x0005a740, 0xa82a153a, 0x003c23c2, 0xc25d7eea, 0x01ec0012, 0x8d009732, 0x1af00016, 0xac11e89c,
|
||||
0x420e0e0b, 0x04812fdd, 0xc4807a80, 0x468ce025, 0x2474000b, 0x5823e124, 0x81191817, 0x9125244e, 0x900f5000, 0x93e804b7, 0x848f8003, 0x016a4c1c, 0xa74007bf, 0x3fae9342, 0x96900f10, 0x4fad380b,
|
||||
0x153e1012, 0x120cd31a, 0xf75001e3, 0xfebc4d6b, 0x56403c40, 0x2a9f503a, 0x1af84ec0, 0x038537bc, 0x75001e78, 0x0feb14bf, 0x552403c0, 0x536a4e04, 0xd700c406, 0x66d88ee0, 0xd807b610, 0xdfba8046,
|
||||
0x4f5754f1, 0xa40f01ed, 0x7d368038, 0x1ae81800, 0x05953fbc, 0x4a800f5c, 0x4feb5480, 0x29b80f7a, 0x34fafec3, 0x80b66102, 0xe94be816, 0x80079600, 0xf5ba4025, 0xc807bd27, 0xa6d20d68, 0x9d009013,
|
||||
0x066a150a, 0x74023489, 0x04953928, 0x43c07880, 0x4ba00e09, 0x7405b02b, 0x19ac5f32, 0x5008ca24, 0x82134bf7, 0xbd392458, 0x7c376280, 0x649af456, 0x4e01020b, 0xbf8b1e85, 0x800f3cd5, 0x094a5fba,
|
||||
0xf800f000, 0x0cba2199, 0xa7405903, 0xdfc70f42, 0x80119e69, 0x025a97ee, 0xeb80f7a4, 0x69f0aad0, 0xf0c0b29d, 0x66f150a9, 0xc0331610, 0x0097a7ab, 0x3a003de9, 0x38c9a829, 0x327403b0, 0x0833413f,
|
||||
0x28256803, 0xef4804bd, 0x0e803701, 0x080c55a0, 0x9f650a9e, 0xb40c22cd, 0x01200917, 0x2c007bd2, 0xdd247c12, 0x53a02084, 0x6cc1bca1, 0x07ee8001, 0x3da90092, 0xc8647600, 0x8446f90b, 0x4d0a9d00,
|
||||
0x60120cd8, 0xfceaf02f, 0x3cacf4a9, 0x03221160, 0xd8046ab5, 0x150a9f09, 0xa366c96d, 0xc12910a2, 0x016d2003, 0x7701d55a, 0x92f2c782, 0x80f88337, 0x254122f6, 0xb80f4a40, 0xcd007002, 0x2a742024,
|
||||
0x563f6934, 0x0848e000, 0xf4a4025c, 0x5032f480, 0x5ce13393, 0xe9a153a0, 0x1f0eb18a, 0x412eaf03, 0x901e5802, 0xf4fb6cf4, 0xe3d112ef, 0xb50f4850, 0x10b41861, 0x10024329, 0xea407a92, 0x5966a06c,
|
||||
0x5e58f040, 0x071066ca, 0x4c48bd25, 0xda407a92, 0xb35ff161, 0xa06a6331, 0x9b69a153, 0x90f46c41, 0x1e848400, 0x03a53b70, 0x6c377e28, 0xde58e808, 0xe59dfc56, 0x757807b0, 0x90801259, 0x165203cc,
|
||||
0x7268cf85, 0x540b9c28, 0x0e1dc402, 0x0cda07c6, 0x10024d22, 0xba407992, 0xbd568054, 0x58e81880, 0x7dfc5b5e, 0x066d00e5, 0x08012791, 0xfbe03c89, 0xc3a00e54, 0xa068419b, 0xf12d7963, 0xd0079577,
|
||||
0x004a64fd, 0x480f2242, 0x25e07273, 0x680076dd, 0x70e45631, 0x801a68b0, 0x012a9757, 0x203c4908, 0x75a5bbcd, 0xa783034b, 0xa0fd0142, 0xa78f8c88, 0x0f02434d, 0xa015d348, 0x96000edb, 0xc537c100,
|
||||
0x8bda0325, 0x10025924, 0xf2407812, 0xca5d49b7, 0x80a994d0, 0x9b03e4f6, 0x21238041, 0x410025d2, 0xef9203dc, 0x82f59a01, 0x60f2c7c1, 0xe02520cd, 0x004be5d5, 0x2407b082, 0xdbb403df, 0x5899a001,
|
||||
0xb1fd29ee, 0x19910b40, 0xb0820048, 0x038d2407, 0x8102cbb4, 0x8e04f2c7, 0xa3a0e5e8, 0x7a882004, 0x905cd240, 0xa487af16, 0xf1004a81, 0x0098f9f3, 0x91b24247, 0x0f410400, 0x01d09178, 0x84066b34,
|
||||
0x9ac2854f, 0x3ff2da41, 0x31184497, 0xac9dd80f, 0xa7527c26, 0xd0084143, 0xc3e26c4c, 0x0b407c79, 0x9456b091, 0x203cc418, 0xb3584d59, 0xf09df076, 0x87e4d0a9, 0xdb40d0f3, 0x00933391, 0x480f2104,
|
||||
0xd3ae1ed6, 0x2a1670b9, 0xeaeaf2c7, 0x9d4f7cb2, 0xe03c4404, 0xa323a27a, 0x8506eb34, 0xe2c2854f, 0xfba066f0, 0xac012965, 0x01e0282f, 0xb5437a49, 0xa782034b, 0xf8716142, 0x99eaf02a, 0x8082004a,
|
||||
0x06492407, 0x000ad76a, 0x35850a9e, 0x5e059c83, 0x40095b3d, 0x2480f788, 0x17690607, 0xd7df8204, 0xbbba0ddc, 0xaca489c0, 0xd6210025, 0x82041203, 0x020bb547, 0x8158c5a1, 0x8071c537, 0xb9910c1e,
|
||||
0x5eb02004, 0xfc43e16f, 0x5cedb8d0, 0x68049a8c, 0x066b0618, 0x10025fd1, 0x7c403ce2, 0x5ebb4440, 0x2854f010, 0xda0419ac, 0x41cb0c8e, 0x01e31388, 0xba8243e2, 0x5fc383f5, 0x066b08d6, 0x0323b601,
|
||||
0x10135267, 0xdda201e3, 0x0049fae1, 0xf4563168, 0xea6c714d, 0x38140a81, 0xbe049a93, 0x83668807, 0xd00093f5, 0x37e150a9, 0x9e8131c5, 0x432b050d, 0x01eb8324, 0xbb4022a2, 0x48f02066, 0x0419ac08,
|
||||
0x979c8eda, 0x3cf02004, 0x482db440, 0x7d00093f, 0x70ec2359, 0x00918ab0, 0x08079e04, 0x8ead008a, 0x8b40c787, 0x14de89b1, 0x40a80617, 0x04009473, 0x6588078e, 0x68e7ce02, 0x79f2315a, 0xd014735f,
|
||||
0x2760a1b3, 0xda20a553, 0x01cac403, 0xe7854dba, 0x08e6bef6, 0xb0c8eda0, 0x10d2a993, 0x736201e9, 0x0e9d7ae2, 0x848e818c, 0x9c004cc0, 0x23360248, 0x03ca22a6, 0x21de8516, 0xeb5f2573, 0x0a9d03c6,
|
||||
0x26a6f34d, 0x8502a00a, 0x89293fed, 0x019100f2, 0x35da93a1, 0x30c34384, 0x1fa62d58, 0xfda17578, 0x72416c67, 0x03c230c1, 0xa623de44, 0x3a081a5f, 0x066b0a15, 0x8b23b681, 0x968c23cc, 0x8586b0cb,
|
||||
0x100f6c30, 0xd7e90549, 0x0095020c, 0x9c0b7bb0, 0x410a1248, 0x09e5ca57, 0xc06497d0, 0xa69100f4, 0x2034ed10, 0x78042474, 0xfdd01838, 0xeb124644, 0x76e5cb1b, 0xc16497d0, 0x814580f2, 0x86ed50ce,
|
||||
0x1861a102, 0x7a0419ac, 0x16489436, 0xe500ed1a, 0x21aefcb2, 0xabc40796, 0x1dbaa3c0, 0x0a9e080e, 0x38a6fd4d, 0x286cf402, 0x0af42c91, 0xc5580076, 0x03c3099a, 0x9a820be2, 0x276a24bd, 0xd6142a7c,
|
||||
0x489c020c, 0xa0953a12, 0x6c003b11, 0xd84d9578, 0x225fe203, 0x101e5da5, 0x6f40012a, 0x0c1f038a, 0x12e04171, 0x7232e5fd, 0xd7d03181, 0x01e4208c, 0x9d40b9f1, 0x804f155e, 0x37b06186, 0x86cf41c5,
|
||||
0x3552def2, 0xcbb514b6, 0x4031409f, 0xfa00bcb9, 0x3d04519e, 0x03ac72e0, 0x860b5768, 0xdec2854e, 0x476d0714, 0xf9f67776, 0xc440f972, 0xe5cbda35, 0x0579729e, 0x09233df4, 0x456c407a, 0x331a95f8,
|
||||
0x0a9d0347, 0x0e29bd85, 0xf5e49138, 0x7cc7a1a2, 0xc812fb1f, 0xb29afbf8, 0x7c2d0388, 0xf23d301e, 0xd7f6313f, 0xec0c112f, 0x833607c9, 0xb7802500, 0xbe45a0fc, 0x2c49aecc, 0x85f3cb95, 0x40e22cf6,
|
||||
0x0e03da0b, 0xc62bff16, 0x020bb401, 0xb0a153a0, 0x50129066, 0x48117a81, 0xb7a4647b, 0xb0a33c81, 0x89865caf, 0x9e6d0e55, 0xff178c07, 0xee01c62f, 0x1335b42a, 0xec2854e8, 0x3b683070, 0x66d46bb2,
|
||||
0xb3cde91c, 0x5680d12e, 0x44e142ff, 0x85a07136, 0xc5d301eb, 0x38c77fe2, 0x21337680, 0x5850a9d0, 0xfdd00833, 0x7b89e3bc, 0x853003b0, 0x008a02fe, 0xe503850b, 0xa3bd8672, 0x2e1c078e, 0xc637ff16,
|
||||
0x4b7b7401, 0x142a780c, 0x54020cd6, 0xda44dea0, 0xa6007618, 0x403b440a, 0x9f30a177, 0x61681c55, 0x62fec07b, 0xf27fe0f1, 0x12bc401d, 0x91ff1d30, 0x85c75d63, 0xb347dcff, 0xc342cfcc, 0x6e4b5830,
|
||||
0xb00934b7, 0x8c3d9244, 0x7686d32f, 0x42855d80, 0xa0716677, 0x01e2197d, 0xdee2c583, 0x85030398, 0x8b67823b, 0x411f71e3, 0x76116bc6, 0xd762c980, 0x431f8c47, 0xcd6142a7, 0x245ed020, 0x13050def,
|
||||
0x50c3d924, 0x3fed6881, 0x8e142850, 0x5a071764, 0x2b980f60, 0x8f4a8716, 0x8f17f6b9, 0x16745102, 0x0de378f7, 0x16546594, 0x97a7ebb8, 0x54e873f1, 0x17306c28, 0x1d547ee8, 0x4b010512, 0x8fb8154c,
|
||||
0x028500ec, 0x08907d7b, 0x012400f2, 0xb94f4b66, 0x12dc200e, 0xc3e6978e, 0xfac19f31, 0xeff0596d, 0x308ecfe1, 0x0a9d0e7e, 0x01cd9d85, 0x4bdea054, 0xd010508a, 0xd1e6dcce, 0xc26c687f, 0x1c65900e,
|
||||
0x4ff6d168, 0x2a1c0248, 0x0075cd7d, 0xf0e1e3e1, 0xcc70deb4, 0x870a7067, 0x203354f5, 0xe15d1fa3, 0x30c3439f, 0xf4083358, 0x15af286c, 0xeb7aa709, 0x89102a59, 0x7f6c05c3, 0x40f6071c, 0x6d00abbe,
|
||||
0x968c0248, 0x8075c6fe, 0xa76213c8, 0xff7cb647, 0xc7eab71f, 0x49520088, 0x6c255b8f, 0x787f9aac, 0x854e814f, 0x0714dec2, 0xc9d40094, 0xd6386330, 0x2bf2ad63, 0x07101848, 0x240e36c8, 0x063b6694,
|
||||
0x73bfa54b, 0x16b2201d, 0xf56c5938, 0x2bd27ec9, 0x49e0dfcd, 0xc8566715, 0x47a11ffe, 0x53f6ed0d, 0x1d00ffa1, 0x29bd8109, 0x1436780e, 0xda1d3475, 0x0c0a7bff, 0xc19b8815, 0xe0500ec8, 0x31648b14,
|
||||
0x5b3d9e56, 0xd73bfd2a, 0x00d2a201, 0x8fab3878, 0xb3d6fffa, 0x556b8871, 0x101f4692, 0xa0f40072, 0x96b2ac0f, 0x2854e814, 0xa80419ac, 0x3a012940, 0x42dea581, 0x968e0558, 0xfd8827cb, 0x71626d0b,
|
||||
0x8989db60, 0x35b76903, 0x94f4dab4, 0xe35e7f4a, 0x6cf7c039, 0xb5847d03, 0x5b30fd18, 0x3c9d7a7d, 0x51d47ea3, 0x26dd8d6c, 0xddd1c66c, 0x25860d2a, 0x142a7423, 0xa838a6f6, 0x7496a004, 0x291c0414,
|
||||
0x205587f4, 0x00e589b6, 0x10dc0e28, 0x384b4ef8, 0x9a32b4a1, 0x5fc0602a, 0x7a54a9a2, 0x888073c2, 0x16c94213, 0xc1ffe2dd, 0x776cb631, 0x70dd8141, 0x881c58ab, 0x435742d4, 0x18ac2469, 0xb0a153a0,
|
||||
0xcf01c537, 0x5072a286, 0x1635ff48, 0xd8150c0a, 0x42c31d88, 0x28dc0e2c, 0x244f1a13, 0xa0341caf, 0x4d0a17cb, 0x073c7ba5, 0xe681e760, 0x4ad0a3c8, 0x7f5904fd, 0xcf00f90b, 0x0428c3aa, 0x9cf64f40,
|
||||
0xa5a00380, 0x4254b3b6, 0xf0327f8a, 0x0012a01f, 0xd0183876, 0x70b1a8fd, 0x6cb0041c, 0xbcfd6f3c, 0xf181c760, 0x270e15eb, 0x601f6c17, 0xcc389696, 0xe143a290, 0x74132f08, 0x42079d94, 0xf49e1876,
|
||||
0xc47912d9, 0x07628e9e, 0xf8c8aacf, 0xd9f10333, 0x0774c422, 0x0d4a4f0e, 0x2062c55d, 0x091d0cbf, 0x00833581, 0x86550025, 0x7deeb31a, 0x709e0548, 0x38c10077, 0x0a12e710, 0x8da43d4d, 0x3fe131b8,
|
||||
0x1b52fd07, 0x1c17d0be, 0x34c33807, 0xccfa4e10, 0x0bda07a0, 0xd1238f04, 0x3ee49a56, 0xed38d3de, 0x8e97e238, 0x1d4fa011, 0x8386212c, 0x899a02aa, 0x060e1d85, 0x5a8a1b3d, 0x432c97a4, 0xda205487,
|
||||
0x0e394f95, 0xda071420, 0xa470a87f, 0xde71237f, 0xbe3809c0, 0xbb0038e3, 0x7a59041d, 0x8e9674a4, 0x76d0a6d2, 0xb1c5ed8d, 0x1e3b492e, 0x21768566, 0xc55cc290, 0xac1bd00e, 0x42a7401d, 0x1714dec5,
|
||||
0xcf02f3b5, 0xc2c7a286, 0x6f7cac27, 0x90f60550, 0x2846d95d, 0x9b87dc0e, 0x49330847, 0x012446c3, 0xfe6fc826, 0x978071c2, 0x3320fb2c, 0x1de3f6b4, 0x23fbbf7a, 0xf9ce38b4, 0x4904225d, 0x4f8f1e3b,
|
||||
0x99571217, 0xed2ff6c4, 0xe8466a09, 0x3348a854, 0xd4637cc8, 0xfdd0265c, 0x0f3c165a, 0x5eb4b0d8, 0x66920550, 0x07140730, 0xb2fb889e, 0xcbb06d38, 0xa4a9f8fa, 0x615e007b, 0xe5be6fc8, 0x28730038,
|
||||
0x7d678500, 0x9d3f52a5, 0x453925aa, 0x18844b9f, 0x0d591fc2, 0x6830baeb, 0x0e25e981, 0x581fda50, 0x4012a053, 0x6f0b2c64, 0xc8cc13a7, 0x4740a81a, 0x511cfbca, 0x61010567, 0x3ee1b815, 0x607151cf,
|
||||
0xfd0ae37f, 0xb4ddfadd, 0x898d1101, 0x157b00f6, 0xe33e142a, 0x80eb0038, 0x9ab459b8, 0x19d641ed, 0xd91a24f4, 0x112efddf, 0xac7910e4, 0x8763f8f7, 0xeeb64fa8, 0xcfa01cb1, 0x478060bf, 0x52a11842,
|
||||
0x24ff01f3, 0xca993d7e, 0x6fe860d9, 0xeb3804a8, 0x11c1b419, 0x68157efb, 0xb0b98335, 0xff09c0e2, 0xb502f8dc, 0x6c258c64, 0x8e737121, 0xc00e39ef, 0xa34f04c8, 0x7ed97975, 0x4f451d3c, 0x4b9f77f6,
|
||||
0xe12a4084, 0x6c47cc6c, 0x624fad86, 0x52b54b90, 0x2a74007b, 0xcb387594, 0xfe24c081, 0x97d3a928, 0x0bfac31b, 0x78d43678, 0xdf5ba34f, 0xfe6ab31b, 0x35681541, 0x846cb983, 0xb286c0e3, 0x9f70597f,
|
||||
0x480f7b62, 0x71ea0f90, 0x1ce7ce23, 0x2abc6007, 0xa067d908, 0xca675b01, 0x5b0cd3cb, 0xc82f368b, 0xa12ac16b, 0xcb896a54, 0xc0329317, 0xa500ed8c, 0x21f2be63, 0x75942a74, 0x6046db3e, 0xb8a9c61b,
|
||||
0xbbb1dc06, 0x4099bc10, 0x59453009, 0x01eed1db, 0x9941b815, 0x5e12b113, 0xa6044fd3, 0xd8a7dd46, 0xec124e5e, 0xb1e2de01, 0x708071c9, 0xc3ae6029, 0xa0b4e896, 0x366cb49b, 0x21f629cb, 0x915bf6b3,
|
||||
0x881c4c5d, 0xc77ec8fe, 0x525758fe, 0x54e845d9, 0x5688e328, 0xbd499bd2, 0xdc99a23c, 0x70fb23d2, 0x08405ec3, 0x1ce81500, 0xe2b7e6d5, 0x02a7da58, 0x973066ed, 0x8da0a970, 0x15bc7c64, 0x1bca81ab,
|
||||
0x89603d91, 0x3f12ecfa, 0x1e2d4431, 0x80768a7f, 0x06429bf0, 0x54bd18ec, 0xf626ebda, 0xc1bf9671, 0x460edb0a, 0x0a249598, 0x0446cbfc, 0xe152d683, 0x1593c35e, 0x68c00960, 0xe8113906, 0x1137c6ce,
|
||||
0x9c2692dd, 0x3ff0df62, 0x9456c04f, 0xdb46bc79, 0x1370ded6, 0x8f3ef4be, 0xfeca2377, 0x3139f085, 0xd02d5be8, 0x90ae62ad, 0xb7a35477, 0xc7b73407, 0xfc5e07ac, 0xb46bf850, 0x416a8403, 0x16761b78,
|
||||
0x48272ee8, 0xb43f6e3b, 0x3d6ba37b, 0x5bb92423, 0x14c56d2a, 0x398c700c, 0x003ae0d4, 0xbbb92e4e, 0xb42a740a, 0x44f6d0c8, 0xd6d151f2, 0x9f8e5384, 0x1e8042c7, 0x5e051dd0, 0x677bc91c, 0x010707da,
|
||||
0xdb65dcbb, 0xf9f7d15d, 0x43428077, 0xcbc40e30, 0xf09d3d53, 0xc6fff159, 0xb04b3504, 0x6f3aec14, 0x15a15a5e, 0x78b53f45, 0x00ed127c, 0x71e09ea1, 0x19b1f19c, 0xc773f670, 0x844b9eba, 0x34f99b40,
|
||||
0x5c74c4fe, 0x84891841, 0x78fecf2d, 0x0b7370c5, 0xaed0a9d0, 0x43d1fdb0, 0x373f42b6, 0x16434edd, 0x10b1c30a, 0x0084f258, 0xed768150, 0x6a7536f2, 0xf996a6e5, 0x2c2dcf66, 0x456b054e, 0x3a79784b,
|
||||
0xda7c2540, 0xdbe00969, 0xb3d84a03, 0xbffd9b1b, 0x5ffd413c, 0x31f87e3a, 0x478201da, 0xdfb92204, 0xce31c7b5, 0x1da99388, 0x48ed5670, 0x6f578789, 0x8c7f5cf2, 0xfd9e701e, 0x0f77bd71, 0x537400e5,
|
||||
0x942a7400, 0xbac40791, 0x074ed689, 0x578e791c, 0x780d1c54, 0x04a07925, 0x64902818, 0x76ed98dd, 0x152855ce, 0x398336e8, 0xcff46aec, 0x00059207, 0xe12706cb, 0x8713a253, 0x7cf2e378, 0x38395f79,
|
||||
0x3feed479, 0x6e5e8273, 0x80768d3e, 0xb7183540, 0xa7cf7801, 0x590f9cbb, 0x9d14af02, 0x9573efea, 0xf8414c5d, 0x7a5015a0, 0xd0014d50, 0xc1f0d0a9, 0x2f81e800, 0x5b518d37, 0x6e156fad, 0x02f30642,
|
||||
0x90f1e831, 0xe0be9ad4, 0x15287c95, 0x66d76138, 0xd9b7d03c, 0x0b22c547, 0xede1c2d6, 0xb0fe6301, 0x4603da91, 0x5be5fef1, 0x43b1c840, 0xa35fee1b, 0xc2858852, 0xf00ed1cf, 0x639e642a, 0x39d3f40d,
|
||||
0x56b53f69, 0x19d4b6ea, 0xec35f2d5, 0x62bf0e3a, 0x55c06384, 0x4d78039f, 0x50a9d001, 0x38100cdc, 0xf03c8194, 0x0a8ddedd, 0xef25f0ea, 0x818f8e9c, 0x9fb3ef17, 0xe8b7fc50, 0x8155dbad, 0xf5fe8dcd,
|
||||
0x5a1872dc, 0xbf5bb405, 0x4ffd25e6, 0x61c58238, 0x563cfede, 0xdabbf380, 0x09e2bee9, 0x7423a9ff, 0x97f0b10a, 0xb7f00768, 0x901ce003, 0x0d4bd0a7, 0xfc0ec5ad, 0x8f0ae334, 0xba6993f5, 0xf5a1737a,
|
||||
0x8facfb98, 0x3f71d2bb, 0xc17c20b7, 0xbc3c160e, 0x54e800a6, 0xf4007228, 0x1ed06c18, 0xedde0560, 0x10b8206e, 0x5e6de1d0, 0x40aa05da, 0x37050b97, 0x0105e3b5, 0xa51c0a94, 0xd419e24d, 0xecc7f0db,
|
||||
0xfa4bdf05, 0xd0877fd3, 0x862e1f64, 0x585dfbf7, 0x8cbfb85f, 0x4a1ec803, 0xf44fa015, 0xff80388b, 0x3a61b084, 0x34912f44, 0xc7eb21cd, 0xa0976dc7, 0xa8b8bd32, 0x69b7e8ef, 0x17e3e1d2, 0xddc64c0e,
|
||||
0x997ae53f, 0x9d0014db, 0xe24e2d0a, 0x992e8307, 0xbc0f58f5, 0xc811a037, 0x2dcbd0c4, 0x64b50934, 0x897828af, 0xab9ed5a6, 0x56a85702, 0x413c1700, 0x1bb53ce8, 0xa49c07ce, 0x733fb37f, 0x1721598c,
|
||||
0x37472bc0, 0x795c5ed9, 0x3b019d8b, 0xdfaff39b, 0xbe1d5747, 0xd2007414, 0xe71b4006, 0x7be5b5a0, 0xc0bd378f, 0x3f6ecd13, 0xfd7187ec, 0xc0976638, 0xe28e7af4, 0x400536e2, 0x838b42a7, 0x12a7e824,
|
||||
0x252c2769, 0xb42ce3dc, 0xa01d810d, 0xe86e4940, 0x6d92ca40, 0x1d5403cf, 0xc0aae316, 0x5ce3e0c6, 0xeec65db0, 0xbf75180a, 0xa5fd98dc, 0xfd492d28, 0x5d6215b5, 0xb0a92722, 0xdd1f6c90, 0x1fdebfee,
|
||||
0x423a7071, 0xe9300e7c, 0x26369199, 0xd5aef852, 0x72112ea8, 0x4dadc6c7, 0x60f7bf60, 0x81864bfb, 0x2701d009, 0x9a70a49e, 0xa153a002, 0x932a7168, 0x55d3cfa0, 0x85fb568d, 0x82179e2b, 0x6e5bcaa2,
|
||||
0x2717a097, 0x3e49600e, 0x151ce19f, 0xea4bef38, 0x38ad34b9, 0xbb9f7e62, 0x6a5f3842, 0x3466bc29, 0xc661c0e1, 0xdcc76589, 0x5ade6fc8, 0x7050dc2c, 0xc577cad4, 0xb49d003b, 0x6800dab1, 0xed1f2dac,
|
||||
0x4fcec38e, 0x178b16ce, 0x760f4fdc, 0x1e009b39, 0x313fb542, 0x0d164be3, 0x5ca83b17, 0xe60addbf, 0x800a69c7, 0x9022854e, 0x3dda9b7d, 0xd54a3fcd, 0x45ec7ae4, 0x47703eb6, 0x19b6e5ed, 0xce28839a,
|
||||
0x8bb6bfe1, 0x043a3e48, 0x09e05577, 0x4d800ed6, 0x6341be8a, 0x47426583, 0x6a5fda23, 0xe2ebf85f, 0x46b1b23e, 0xeec77f67, 0x2fece6d0, 0x7a0ff6fd, 0x71c3bec2, 0x63c3ba00, 0xf801b49c, 0xfcb6436c,
|
||||
0xdee7ea11, 0xfa8b8df3, 0x3f081478, 0x5aa4cbe1, 0x74e9ef6c, 0xf39e20e7, 0x47491aa1, 0x8d3334dc, 0x9d0014dd, 0x459c450a, 0x212b10b7, 0x709bb43b, 0x081d82ee, 0x54f784f6, 0x00b2b727, 0x8f1441cd,
|
||||
0x10d6ae3b, 0x2ad9dfc8, 0x03b99db0, 0xded01ed8, 0x281dad86, 0x3922fafc, 0xf6221e87, 0x2f9fec57, 0xc24eded9, 0x1983fc5d, 0xa0dc143b, 0x0e78cf5a, 0xe6549ff0, 0x036eca7e, 0x7e5b21a0, 0xc3e49d8b,
|
||||
0xab1e79b8, 0x6d603fa8, 0x2f57e802, 0x1543bfb8, 0x64499784, 0x43026def, 0x609018c1, 0x37400537, 0xb76cc461, 0x65adc375, 0x4e2bbdd0, 0xc7ebe820, 0x513f6e71, 0x608dcdce, 0xfe49d201, 0xf3f3e91c,
|
||||
0x054b7ddf, 0xc0bad0f6, 0x1be411cf, 0x8a5efd1b, 0xf6fc29d2, 0x268d36b0, 0x1676db92, 0xb37b6e86, 0x7c567058, 0x598e00bc, 0x9df291f2, 0xe00e786f, 0x021c7668, 0x436d06f6, 0x3a56fcb6, 0xd798e777,
|
||||
0x5bf7ea2a, 0x1d00c09b, 0xe3357a3d, 0x56e1f469, 0xb6e47eaa, 0x9ab1f982, 0xa153a002, 0x3f722d98, 0x45596d1b, 0x40acfd65, 0xa4b19db0, 0xaf997f62, 0x84ce025b, 0x0f3a0e21, 0xff9d52e8, 0x2054b5c9,
|
||||
0xba1cf9cb, 0x79695189, 0x0380f642, 0x42c15fcc, 0x41ffc177, 0x27e9ba3a, 0x4fea3d0e, 0xc03b463a, 0xacf95e1a, 0xfc521edc, 0x4e81412d, 0xb3d100ba, 0x89fbcc7e, 0xbb69de6d, 0x026d6fa8, 0x10a64ead,
|
||||
0x16cdd073, 0x6bbdb5a2, 0x70ec58ae, 0x86498416, 0x5348618b, 0x142a7400, 0x63853d63, 0xc54c3876, 0x9c10247c, 0xdd56240f, 0xd6d1363b, 0xd1020d08, 0x1afe48c2, 0xf06af36e, 0x0a96ec3f, 0x010aaff4,
|
||||
0x5003881a, 0x03d9043b, 0xab318256, 0x26f6d9f3, 0x5c2783fa, 0xa1204809, 0x70704060, 0x191fa01c, 0xfac715a5, 0x0d001b5e, 0xd02ff2de, 0x096e3beb, 0xf376b4e8, 0x8c438efd, 0x7def1d63, 0x13a382e2,
|
||||
0xc65baab1, 0x2365b01f, 0x72160ad5, 0x48f011b3, 0xf918e608, 0x904d36e7, 0x5a87a958, 0x78204906, 0xe144f982, 0x1944f535, 0x3548012c, 0x0b1240b0, 0x0de88133, 0x8606c0ab, 0x5dc0a0fc, 0x90eff40b,
|
||||
0x287b6fc2, 0x6a584873, 0xcac2dca7, 0xff50ad0c, 0x6a119c32, 0xb45bb80b, 0xf528ec03, 0x3437e923, 0xe1f15647, 0xead069b0, 0x7dba443c, 0x0096ec5d, 0x378fa8b7, 0x705f2181, 0x1c0d34e7, 0xc585256a,
|
||||
0x4fe2b765, 0x21f982b5, 0xa9d0014d, 0xdd08ca50, 0xdb422ca4, 0xec82049b, 0xe2449c40, 0xc4020965, 0xf3e2314a, 0x868e0341, 0xaf82e055, 0xbe661fb0, 0x205beedc, 0x318cefd0, 0x3820ac17, 0xfdf6682a,
|
||||
0x2c4856cb, 0x4e3773ec, 0x8d2a5014, 0x383f3ba2, 0xd001b74d, 0xee38ffa0, 0x12257885, 0x8afa4de5, 0xfaf1d6fa, 0x5627ded3, 0x0b1eb8ad, 0xc0fc0180, 0x825bda4f, 0x0fcc15af, 0x227408fa, 0xfad562c0,
|
||||
0x9bc01f07, 0x14fd2340, 0x5b03904c, 0x59388158, 0x0012e17f, 0xc86184b7, 0xa5fe60e1, 0x50c0ab1b, 0xe048320a, 0x7e231f59, 0x6cfec634, 0x1c6fdbe0, 0x47fd05f0, 0xadf0a288, 0xf8071c41, 0xd1f60a33,
|
||||
0x1e3e3c33, 0x859274f1, 0x09fe8879, 0xa2e9da89, 0xa8df093e, 0x1deedda5, 0x4439bf46, 0x3b61c184, 0xe40d9c12, 0x88a62999, 0xa0e0499b, 0x4837377d, 0x9bbfa7e7, 0x88111caa, 0x56788523, 0x6c5002c2,
|
||||
0x37610f25, 0x69ef90b9, 0x7cdab7ee, 0x8f1d1142, 0x534e5623, 0x843893e0, 0x81d77bf0, 0x1df2afd0, 0x3a4cb4a0, 0xdb98bab1, 0xf8cec933, 0x1f5c7762, 0x877acb40, 0x09bc71fb, 0xba4b2cf8, 0xc7657046,
|
||||
0x74f624da, 0xd7d1ba59, 0x3807e60a, 0xab614b95, 0xbda0b6fc, 0x8b3283bb, 0x5a046162, 0xe520b687, 0x42e45da0, 0x5bd7633e, 0x63013a75, 0xfc844c52, 0x6e620228, 0x50e1779f, 0xe54fffd0, 0xe33fc038,
|
||||
0xf1564ffb, 0x8e69a62d, 0x1613fe87, 0x796ec3f9, 0x877afc90, 0x1723dc5f, 0xf0ebee59, 0x112cc174, 0x30568105, 0x0004523f, 0x6a31d7a6, 0x5097ecb9, 0x609ca6f8, 0x0926c1de, 0xa0c24829, 0x7053f673,
|
||||
0xed0c6eef, 0x25e0f10a, 0xd16451ab, 0x5f856b20, 0x1507cedc, 0xf418a727, 0x6ffee42f, 0x5ccf6fa1, 0x57a44a00, 0xe01d17de, 0x376040fa, 0xb3e43d5f, 0xa0eeae2c, 0xf3bf7535, 0x091251c3, 0x18f944b6,
|
||||
0x75889c06, 0x1a1fb2e8, 0xb6f814fc, 0x1da8a5c1, 0x004247a0, 0x6fbc4360, 0x5b01b821, 0x3190b34f, 0x67bcb029, 0x1310964a, 0x44eda5e1, 0x38dddfbb, 0x01cb60e5, 0x117d734a, 0xe7af0cf2, 0x5c2e16be,
|
||||
0x150c181f, 0x92cc7df5, 0x9790cff4, 0x6091c019, 0x8fcc15b0, 0xc5902c8c, 0x8daec761, 0x4fa4be8d, 0x5419994f, 0x59ca7535, 0x78ad09fe, 0x3d0f9de3, 0x889f2c90, 0xd7744567, 0x4049f068, 0xf8071c26,
|
||||
0x1d218e77, 0x7ef8b5e3, 0x2d55bd60, 0x58c7376a, 0x5c5495dd, 0x50c12380, 0x068f982b, 0xa2706679, 0x47fe5dad, 0x0c092d0e, 0x2740cc1b, 0x1e4cfc11, 0x60dc6921, 0xf87f57e7, 0x6d760247, 0x8880d214,
|
||||
0xba56319e, 0x12d38680, 0x0e716ff6, 0x09754230, 0x1ebd605b, 0xec979bbd, 0x5657d9c7, 0x026b249a, 0xfbe00ca3, 0x6c1872a3, 0xfa84df66, 0x05617086, 0x621c8c3a, 0x36a211ff, 0x29f22b02, 0x0313eaf6,
|
||||
0x85a70be3, 0xeb1a14d3, 0x5d5dd300, 0xbbe1c301, 0xb0fec7d6, 0xc30dd605, 0x47210f3e, 0x8d76f0af, 0x1091d03d, 0xbe70c98a, 0x88c3499f, 0x0c3a8bc4, 0x6e8f429c, 0x489e4568, 0x854803be, 0xaffe16d3,
|
||||
0x96800e71, 0xc7ffc0e7, 0xe67e9349, 0x8aba1d27, 0xe00ffe83, 0x0ad83048, 0x0cde03e6, 0x0ece3142, 0x1d8cfdf7, 0xf8fcc0cc, 0xc605a3e2, 0x59ed2b83, 0x3067074e, 0x0ef1efe4, 0x2b6f6410, 0xacc7376f,
|
||||
0xe525056e, 0x2c15a32c, 0xd225dff0, 0xe0b319d1, 0xddc9f7d6, 0x0acc7dfb, 0xc23940ae, 0x8ffb0d19, 0x9a500ee4, 0xf3968dee, 0xd38ff411, 0xe03084f5, 0x8300d07e, 0xaba2d19d, 0x9b206fa7, 0xf5a1df87,
|
||||
0x3f98c26c, 0xa1c33873, 0x8070a5bf, 0x7d703434, 0x58c48f66, 0xa47261cc, 0xafc7a973, 0xaf7576c6, 0xcb4b0e76, 0xd818f139, 0xeabc51ea, 0xc3c6f0d3, 0x039396ff, 0x0f9f01f0, 0xe4d7491a, 0xd991c1c0,
|
||||
0x91d9a9a9, 0x0cc981e1, 0xa19a2cdc, 0xcb7db3fd, 0xd3ab33ab, 0xde0397ea, 0xa83f1101, 0x56413db6, 0xd44b5632, 0x11de024b, 0xb6ab9f31, 0x3f42413d, 0xa88cb6a8, 0x90ff3f36, 0x6daaa7a8, 0x0798918f,
|
||||
0x55848fd4, 0x1de02cc0, 0xb54f7713, 0xf3e031f1, 0x30663541, 0x3a500a79, 0x9f2283bc, 0x463e36a8, 0xae8e3f46, 0x27dbc6f4, 0xc5477873, 0x3e36a9ae, 0xa83f4646, 0x018fa8ae, 0x3b4587f8, 0x80a560f5,
|
||||
0x65f43287, 0x31f1b558, 0x40b06a9c, 0xe47b383d, 0xc7e98435, 0xb279bc4c, 0x140c5387, 0x8d6506aa, 0x2d60869c, 0x0240d219, 0xe9416b72, 0xa992018a, 0xa5b00962, 0x7598f6da, 0x8b40294e, 0x9e8cb05c,
|
||||
0xa9294d6c, 0x97863e36, 0xe3b1de09, 0x2fe6d56b, 0xa0d35f01, 0xdb55fb33, 0xd715f09e, 0x02a7d401, 0xac0258ab, 0x813db6aa, 0xb1dc0897, 0xfb6abee3, 0xe637a497, 0x16974369, 0x2df0b012, 0xfed601d7,
|
||||
0x7201daac, 0xa12bd029, 0x2de9b553, 0xf52079b8, 0x6be02099, 0xb046741a, 0xb86b3bad, 0x89f52079, 0xe111f000, 0xdaa032da, 0x9e9c36f2, 0x44ea8c60, 0x0e6cfc00, 0x6d56995d, 0x1a7e0b79, 0x7f8ec760,
|
||||
0x0c807628, 0xd2d573fb, 0xce459eca, 0xf6f83f9d, 0x0413dd57, 0x5f59a33d, 0xbcb6aace, 0x071887cd, 0xd212dc50, 0x994edaab, 0x929e3221, 0x5028fc07, 0x6d281c79, 0x8e375c30, 0x1e17d2e9, 0x2eaa0513,
|
||||
0x04ad5708, 0x786d5658, 0xb068ce07, 0x30e98a45, 0x0a9cc879, 0x910e8ad5, 0x81725de3, 0xa1661733, 0x75281eb4, 0xa627542a, 0xe1dddb54, 0xd5fd9c5d, 0xa7720186, 0xf2223542, 0xe1bcd85c, 0x2858050d,
|
||||
0x9ec9072d, 0x4985d50a, 0x6c60245d, 0x80c28010, 0xff67567f, 0xb542a62c, 0xc8091b40, 0x21cc213b, 0xec9094f6, 0x542a6ec8, 0x0207ea31, 0x012a621d, 0xc446bc98, 0x54eb5419, 0xb36a88e8, 0x54c66cbb,
|
||||
0xbb0a3002, 0x0a9bf4c2, 0x91955aed, 0x0c1ee099, 0x7efc2b9d, 0xc9750b30, 0x42a6fd60, 0x120bba07, 0x1875549a, 0xcde1b408, 0x4ba83a05, 0x15376b06, 0x372d87da, 0x1d4b760a, 0x626d0206, 0x6518c113,
|
||||
0xa9b3502a, 0xe57b71d0, 0x27a6819e, 0x542a8e23, 0x54068081, 0x92f502a8, 0x02dd8700, 0x0d6c0cfe, 0xe2d2a838, 0xa034447e, 0x4ea05cc2, 0xfd2da153, 0x051b7dd4, 0x062d337d, 0xf3e22d02, 0x87551880,
|
||||
0x15346804, 0xafc87ada, 0x67001adb, 0x1031ead7, 0x1a3bc168, 0x67514280, 0x21233eb0, 0x9b894367, 0x93dbf4fa, 0x36810316, 0x0ec11d31, 0xbac22a8a, 0xb30e854c, 0x0e9a779a, 0x8973fda7, 0x8ecf060f,
|
||||
0xb05ad8f5, 0xe2c3a285, 0x6d0a98f4, 0xccdaca89, 0x7a7efba4, 0xf05a040c, 0x51a3880e, 0x62d20a93, 0x2665b42a, 0x9f576eba, 0x8f4d5faa, 0x910b4081, 0x4d461034, 0x09035041, 0x5f97b030, 0xae499db6,
|
||||
0x08193505, 0x052810b4, 0x0111285a, 0x7850a9c0, 0x7f48d933, 0xa9bed56c, 0x404a6937, 0x0b408193, 0x68a00941, 0x1538043a, 0x26eb0bda, 0x1313ed6a, 0xc95b756b, 0x8193405c, 0x4cdc4240, 0x110a8788,
|
||||
0x1d0a9d00, 0xfe97d5dd, 0x8aaff797, 0x5a9cedcf, 0xe811b04e, 0x10481032, 0x04480095, 0x4004c828, 0xa14f42a7, 0x22dd3a2d, 0x309bde32, 0x7fd5db52, 0xa8353456, 0xcd140493, 0x88146002, 0x2854e000,
|
||||
0xa9f85379, 0x78fac1e4, 0x9bfca3ba, 0xd6453b46, 0x02065d01, 0x0059a209, 0x10a6828c, 0xfd85e360, 0x4486c082, 0xc703454d, 0xe8722f21, 0xe71b3d5e, 0xffe38704, 0x15887e4a, 0x2ff22c02, 0x42a74007,
|
||||
0x7bb6b5dd, 0x33612c4b, 0x42467879, 0xe8fd5ea7, 0x744b54f2, 0x40cba200, 0x10b04120, 0x80fb9160, 0x942a7418, 0xe69bc6da, 0xa062f93b, 0x5eef60eb, 0x4d9a6d99, 0x9d73a3dd, 0xe1c2c723, 0x81033681,
|
||||
0xa109ee04, 0x0f9f7241, 0x76854e02, 0xdb756e05, 0x2300e76a, 0xee1c1b5e, 0xce6d1e5c, 0xda472cca, 0x9757467a, 0x46a73ab7, 0x265a0786, 0x35070707, 0xe2c21339, 0x802f509d, 0x1dbce3c3, 0x58012800,
|
||||
0xeabb174d, 0x2ead8cf7, 0x76756ef7, 0x9a1ef56e, 0xa9ed199b, 0x972b29d7, 0xb1253f3b, 0xe0d9ee7f, 0xef22607e, 0xabdbea90, 0x6079c23f, 0x41039c8b, 0x36a854e8, 0x92da77b3, 0xe4c40824, 0x9d0617dc,
|
||||
0xde29d50a, 0x412493d6, 0xbe5ce620, 0x60c7e1cd, 0xfaa63ff6, 0x37cfeaf6, 0xdf201d09, 0x07a10303, 0x73556843, 0x5bee13d3, 0x9ae45802, 0x854e840c, 0xd772956a, 0x30999112, 0x01eeb93f, 0x8d50a9d0,
|
||||
0x2534eefa, 0x22d01a51, 0x38003dcf, 0x034c1212, 0xde244219, 0x0d6d7201, 0x8e854e85, 0xdabdbea8, 0x4a0eda23, 0x3dbf24f3, 0xaa153a00, 0xba1c01cf, 0xc8076292, 0x4e800f73, 0xdfc7f685, 0xc5271a81,
|
||||
0x1c67900e, 0x350a9d00, 0x9218a069, 0xf22c8166, 0x5380038b, 0xefaa2da1, 0xce24f6af, 0x55e45902, 0x854e800f, 0x0c50349a, 0x0e00eb49, 0x5203d579, 0x68d9dd8f, 0x27ad7f34, 0x47c44771, 0x184d5791,
|
||||
0xd26a153a, 0xac243140, 0x74e47b04, 0x2a700856, 0x6281a4d4, 0x84173b10, 0x22033e45, 0x11d0a9d0, 0x775837d5, 0x424207c4, 0x145e72e4, 0xa4d42a74, 0xd4486281, 0x9727ea0d, 0x5df43074, 0xc40d26a1,
|
||||
0xd81a4d27, 0x00549721, 0x26a15df4, 0x6527c40d, 0x8722c012, 0xa74208d7, 0x881a4d42, 0x24ca66cf, 0xed0e4580, 0x50a9d0e1, 0x93e20693, 0x443c1dac, 0xfa1032f6, 0x069350ae, 0x809003e2, 0x422bec98,
|
||||
0x08f82380, 0xb0efaadd, 0x05ef24de, 0xeb2e73f3, 0x2a74206c, 0x81a4c874, 0x0f1d08b8, 0x6ceb23cd, 0x742a7420, 0xd61df556, 0x8113649b, 0x897eb22c, 0xa15df414, 0x25c40d26, 0xb15125fe, 0x86145c64,
|
||||
0xa4c391be, 0xa7ac7881, 0xf3f2056a, 0x43fb5334, 0x1a4d42a7, 0xb85bcb88, 0x048e33fd, 0x5aa153a1, 0x1fa5c31d, 0x22d018c0, 0xe810bed3, 0xea9f6854, 0xe935ac5b, 0xac83017a, 0x0c5e7965, 0xa4d42a70,
|
||||
0x3824b881, 0x86478e18, 0xebf04135, 0x881a4dc2, 0x0c707bc3, 0xbb2e7168, 0x81972373, 0x69341ff6, 0x5ba90e20, 0x776482c1, 0x2a743076, 0x3881a4d4, 0x016921fc, 0x0c1f32c8, 0x6931091d, 0x46a00e20,
|
||||
0x9d593f00, 0x577e071a, 0x312756a8, 0x6973c66a, 0x4b76400b, 0xa15df800, 0x5bf07d35, 0x8017120c, 0xe80096cc, 0x0349a854, 0x01732345, 0x80096cc8, 0x0693004a, 0x02ea468a, 0x0012d590, 0x49a8577d,
|
||||
0x77224503, 0x0968c801, 0xd42bbf00, 0x012281a4, 0xc9048237, 0x9d001722, 0x7d541d0a, 0x5e45f597, 0x8b21c00e, 0x2a742074, 0x2281a4d4, 0xf4049691, 0x0022a0c8, 0x9ce8577d, 0x2dacdbea, 0x3400aab2,
|
||||
0xe0828bf2, 0x349a8577, 0xca921450, 0xf7a47e80, 0x42a74005, 0x281a4c3b, 0x007d3902, 0xb764d641, 0x42a74106, 0xb32f7a75, 0x0469485e, 0x4e7b230a, 0xba153a0c, 0xeb3efaa5, 0x2c1a700a, 0xc20db91a,
|
||||
0x9350a9d0, 0x53608a06, 0x9b302b42, 0xc5a752fb, 0xc5a153a1, 0x5a77d566, 0x02cc2453, 0x21352144, 0x350a9d0c, 0xb2362069, 0x5234c093, 0xa9d041b3, 0x77d529d0, 0xc832535a, 0x0c487901, 0xa153a105,
|
||||
0xe6c40d26, 0x00170cb3, 0x3bca0a14, 0x153a1a41, 0x4c40d26a, 0xd2cc7fd6, 0x8e4f32fe, 0x9a854e83, 0xc0131034, 0x48627099, 0x4e87171b, 0x10349a85, 0x13a0778b, 0xa5904481, 0xa153c103, 0x22c40d26,
|
||||
0x21680553, 0xa7420749, 0xaa638b42, 0x648eb5ef, 0xe46d00ab, 0x54e840e8, 0x0be65168, 0xec85abe0, 0xf7348072, 0x418774a5, 0x55c742a7, 0x491d6cdf, 0xe4a06af5, 0x010d68c8, 0x349a854f, 0xda2c9850,
|
||||
0xa8c85840, 0x42a7430b, 0xcc281a4d, 0xe055467a, 0x45e0f730, 0xa854e821, 0xc9850349, 0x041408b0, 0x1d0c22de, 0xa0693109, 0x006d7910, 0x0026f018, 0x69350a9e, 0x6df920a0, 0x67681800, 0xb42a7800,
|
||||
0xd6fdf557, 0x00371c8e, 0x8012300c, 0xf716854e, 0xbadfbeaa, 0x1b8e55f1, 0x16580600, 0x93004a84, 0x99b00a06, 0xcc301171, 0x083a5013, 0xd26a153a, 0xcf240140, 0xa9008b02, 0x42a78009, 0xe1bea82f,
|
||||
0x0d4b919a, 0x75e00820, 0xd0a9d032, 0x3beab4e2, 0x72ef17ae, 0x390401a9, 0x0c567e97, 0x6c5a153a, 0xf5cb7d50, 0xb0499322, 0x0427d278, 0x26a153a1, 0xf323e40d, 0xd228a02e, 0xa9e082c6, 0xb7d561d0,
|
||||
0x8ef22b5c, 0x52d63d00, 0xa7410a8e, 0x881a4d42, 0xd008ff26, 0x187f6523, 0x38b42a74, 0xeba6faaa, 0x605d0e44, 0x254e3cd1, 0x805b8603, 0xe9bea9d4, 0x004ca11a, 0xad7aa458, 0xe239b35c, 0x04ea1a59,
|
||||
0xaa5ac580, 0x519b406c, 0x935092f1, 0x9749a001, 0x201e300d, 0x19457587, 0x3d949a00, 0xdf54a7a2, 0xa720aabb, 0x293e502e, 0xea662b5f, 0x2ade7079, 0x29360016, 0x0a4641f3, 0x002d5142, 0x4109d21d,
|
||||
0xa8a00423, 0x690e8017, 0xccdb045b, 0xac011f5b, 0xeedaacff, 0x16d24f1e, 0x4c148d06, 0x600cd28f, 0xfb697b90, 0x108dea83, 0x4dce4948, 0x7ea471a0, 0x8291b0c3, 0x0024d0e9, 0x139548f0, 0x982918c6,
|
||||
0x603d2506, 0x211fd27c, 0x6260a467, 0x20fcc8fe, 0x0da4e490, 0xb8a61106, 0x027d1097, 0xa8c01a40, 0x89829180, 0x0a75ccd8, 0xe9739c4c, 0x8dbb0627, 0x43a38807, 0xea4d8805, 0x82918074, 0x012ad049,
|
||||
0xe03ee7e0, 0x05233108, 0x04305105, 0xfce40e24, 0x85052320, 0x1c02a2d0, 0x6094ea4d, 0x8484e4c9, 0x18012cd0, 0x03c031e6, 0xe58c148c, 0x4012fd17, 0x0a35d241, 0x1829185b, 0x1fd80543, 0x0a4601e6,
|
||||
0x12a9f972, 0xc763bfec, 0x18078853, 0x854d1829, 0x01e81fd8, 0x51460a46, 0xee07f631, 0x0846dd02, 0xfb20a930, 0x230162c3, 0x84549905, 0x7900f3fe, 0x61829180, 0xb0fecc2a, 0x1a19908c, 0xa56df108,
|
||||
0x17561fd9, 0x80305230, 0x365ff9e6, 0x9bef41f7, 0x63c04237, 0xb6d50bfd, 0xd013c74c, 0x03c6c289, 0xae35d61c, 0x0739f2ff, 0x0cd44e3b, 0x3536100d, 0x0a49001a, 0x63104fa0, 0xb9e220a4, 0xe08023c2,
|
||||
0x375ec1ac, 0xe160a46d, 0x9ffd96bd, 0x2f3d4809, 0x2179a840, 0xfd8699f0, 0x0a7909df, 0xf8d4084a, 0xa54568fc, 0x07b8a37f, 0x2d68d77b, 0xaaefc14b, 0x70d0fec1, 0x068776b0, 0xfc362b36, 0x160e720b,
|
||||
0x14a8d40c, 0xf8e9ae7c, 0x60d61a47, 0x49a9986f, 0xf2055829, 0x0526068f, 0x583cb06b, 0x068ff215, 0xb5a81956, 0xad75b14e, 0x01d23fa7, 0x25350214, 0x70579f05, 0xb59a37f6, 0x1b2f41af, 0x582921ac,
|
||||
0xc7bfdb65, 0xa0465063, 0x0560a466, 0xf2887f36, 0xac1e5604, 0xa9b82909, 0x0cb7f0ed, 0x0d60f180, 0x2acfc148, 0x0713f8bd, 0x76a81b6c, 0xc55eb829, 0x2c03bfcb, 0xf9eea81a, 0xff54ead1, 0x873ed641,
|
||||
0x2cd50344, 0xab543f05, 0x1f720ffa, 0x55ab05a4, 0x68566e0a, 0xd61a67eb, 0xa3f3307e, 0xfd5eaa41, 0xc907b9f9, 0x4e61570c, 0x4a4ab368, 0xfdace2ff, 0x5408b003, 0x67e8fcdd, 0x99f9dd15, 0x3e807b92,
|
||||
0x8292ea91, 0x5bf8f7b5, 0x15409480, 0xdb1ac149, 0xe12069fd, 0xc148b540, 0xf36a2fcd, 0xfb58b7f1, 0x48a37d3c, 0xb7c14875, 0x47fb12b5, 0xd4b7e4f1, 0x4205501e, 0xaeaa8fe0, 0x38f208fc, 0x74ac18b5,
|
||||
0xf155a80f, 0x0fb00417, 0xc0d0f454, 0x7f15dadb, 0x1ea49e41, 0xf9dcac21, 0x5135f7d1, 0x5ee611f8, 0x42a078da, 0x6fbbe0a5, 0xe01feacc, 0x70e4ca69, 0xcd810a25, 0xfb5d6b6f, 0x052b48b3, 0xd47e6f2a,
|
||||
0x9c11fe6c, 0x5e16a1fb, 0x8aa1ff45, 0xf3a4be46, 0xa8895d24, 0x67e0a482, 0x79f1fb46, 0x2e34b7f2, 0xf0522950, 0xf68c5ffd, 0x1a7ee58b, 0x2908a817, 0xbf3195f8, 0x405ca918, 0xcc68297b, 0x1b34809f,
|
||||
0xd052de81, 0x4f213f98, 0x1a044792, 0x307c0d0f, 0xe7392fd2, 0x433a4f3e, 0x5c14a9a2, 0x1b16a9ff, 0xf6b064be, 0x58826134, 0xeef82947, 0x01f6935b, 0x64b7ef70, 0x29374062, 0xfba6bef8, 0xe4f0a47d,
|
||||
0x813b44eb, 0xeb629d4e, 0xe6367f6f, 0xd3dac097, 0x00f027bf, 0xf3e0a46d, 0x2fdaccef, 0x883ffb8d, 0xcc5a032f, 0x307fae8f, 0xd65c9f61, 0x01ab0b1e, 0xfdf052f5, 0x9bdca637, 0x173ee701, 0x4a940a0d,
|
||||
0x98bf77c1, 0xdc665f72, 0x6dac5aff, 0xdc149944, 0xfd2cc9fc, 0x07ef7319, 0x92501f11, 0xfb7cda13, 0x0e7eb1a5, 0x40f889ac, 0x58d052ee, 0xc7ee573f, 0xa55c81ea, 0xcc5ff3e0, 0xe73b9fca, 0xafc6fe9e,
|
||||
0x0524e517, 0xeefabfd7, 0x357d6353, 0xfafbddac, 0x61c1395f, 0xf9f0520e, 0x889a5f4f, 0x1ee72d4f, 0xb67223ff, 0xf8295b2c, 0xa637c3ee, 0xe707a7cc, 0x96c0ff1e, 0x251d9904, 0x37edfcf2, 0x5f759a3f,
|
||||
0xfe3dce2b, 0xf9c23ffc, 0xe0a40ce2, 0x7cbf57fa, 0x9afcb269, 0xd7e9e4f2, 0xd9902f41, 0xd5feb629, 0xc118df4f, 0x1e4f3da7, 0x7fb7fe7f, 0x9ca1b4f3, 0x1fe781a1, 0xd8c2fdbe, 0xbb5882be, 0xefe0dc8f,
|
||||
0x829702ff, 0xe9b1ef9b, 0x50afd48d, 0xf83f21ce, 0x9eafb7e1, 0xfc3627af, 0x7e1ff7bb, 0x9fcbeef9, 0x7d4f313f, 0xbfa7f055, 0x2f97fa7e, 0x97f6f9bf, 0xf57d9fb7, 0xb64dbbc7, 0xfbbe6c3b, 0x1f67fde3,
|
||||
0xbbf6fa7e, 0xa9f2fe2f, 0xf3757bb1, 0xf27ebfa7, 0x7e9f8fc9, 0x08cfe9fa, 0xfe3f3ff4, 0x8d5fc9f8, 0x83060dc5, 0x183060c1, 0xc183060c, 0x0c183060, 0x60c18306, 0xff1f5430, 0x3cd2fa0f, 0x05b0d517,
|
||||
0x000000b2, 0x4e454900, 0x6042ae44, 0x00000082,
|
||||
};
|
||||
|
||||
const uint32_t uprof_512_len = 12813;
|
||||
|
||||
#endif //MICROPROFILE_EMBED_HTML
|
||||
File diff suppressed because it is too large
Load Diff
@@ -48,7 +48,7 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<PlatformToolset>v145</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -9,10 +9,6 @@
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="stdafx.h">
|
||||
|
||||
Reference in New Issue
Block a user