Skip to content

Commit

Permalink
修复多个OIR序列连接后,后续原头文件包含REF块没有排除的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
埃博拉酱 committed Feb 16, 2023
1 parent 235d60f commit da5ccf2
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
2 changes: 1 addition & 1 deletion +Image5D/Version.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function V=Version
V.Me='1.4.3';
V.Me='1.4.4';
V.MatlabExtension=MATLAB.Version;
V.MATLAB='R2022b';
22 changes: 18 additions & 4 deletions Image5DLib/Oir读入器.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,15 +324,28 @@ Oir读入器::Oir读入器(LPCWSTR 头文件路径)
基块索引 += 2;
}
const 文件列表类::const_iterator 文件结束 = 文件列表.cend();
#ifdef _DEBUG
uint8_t 文件序号 = 0;
#endif
while (++当前文件 < 文件结束)
{
#ifdef _DEBUG
if (++文件序号 == 80)
文件序号 = 文件序号;
#endif
文件头 = (Oir文件头*)(*当前文件)->映射指针();
尾指针 = (char*)文件头 + (*当前文件)->文件大小();
if (文件头 + 1 > 尾指针)
continue;
基块索引 = (uint64_t*)((char*)文件头 + 文件头->索引位置 + 4);
if (基块索引 + 每层基块数 > 尾指针)
continue;
[[unlikely]] continue;
基块索引 = (uint64_t*)((char*)文件头 + 文件头->索引位置 + 4);
do
{
if (基块索引 + 1 > 尾指针)
[[unlikely]] goto 绝对跳出;
}
while (((Oir基块*)((char*)文件头 + *(基块索引++)))->类型 != Oir基块类型::帧属性);//跳过REF块
if ((基块索引--) + 每层基块数 > 尾指针)
[[unlikely]] continue;
for (uint8_t a = 0; a < 每层像素块数; ++a)
块指针.push_back((uint16_t*)((Oir基块*)((char*)文件头 + *(基块索引 += 2)) + 1));
基块索引 += 3;
Expand All @@ -342,6 +355,7 @@ Oir读入器::Oir读入器(LPCWSTR 头文件路径)
块指针.push_back((uint16_t*)((Oir基块*)((char*)文件头 + *(基块索引 += 2)) + 1));
基块索引 += 2;
}
绝对跳出:;
}
新索引.每帧分块数 = 每层像素块数 / SizeC;
const uint32_t 块总数 = 块指针.size();
Expand Down
8 changes: 4 additions & 4 deletions Image5D工具箱.prj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<deployment-project plugin="plugin.toolbox" plugin-version="1.0">
<configuration build-checksum="2492683188" file="C:\Users\张天夫\Documents\MATLAB\Image5D\Image5D工具箱.prj" location="C:\Users\张天夫\Documents\MATLAB\Image5D" name="Image5D工具箱" target="target.toolbox" target-name="打包为工具箱">
<configuration build-checksum="2492683188" file="C:\Users\vhtmf\Documents\MATLAB\Image5D\Image5D工具箱.prj" location="C:\Users\vhtmf\Documents\MATLAB\Image5D" name="Image5D工具箱" target="target.toolbox" target-name="打包为工具箱">
<param.appname>Image5D</param.appname>
<param.authnamewatermark>埃博拉酱</param.authnamewatermark>
<param.email>vhtmfu@outlook.com</param.email>
Expand All @@ -11,7 +11,7 @@

依赖:pugixml,AVX2以上指令集,Windows系统(推荐Win11,低版本未测试)</param.description>
<param.screenshot>${PROJECT_ROOT}\工具箱图像.png</param.screenshot>
<param.version>1.4.3</param.version>
<param.version>1.4.4</param.version>
<param.output>${PROJECT_ROOT}\Image5D.mltbx</param.output>
<param.products.name />
<param.products.id />
Expand Down Expand Up @@ -119,11 +119,11 @@ x64
<fileset.depfun.excluded />
<fileset.package />
<build-deliverables>
<file location="${PROJECT_ROOT}" name="Image5D.mltbx" optional="false">C:\Users\张天夫\Documents\MATLAB\Image5D\Image5D.mltbx</file>
<file location="${PROJECT_ROOT}" name="Image5D.mltbx" optional="false">C:\Users\vhtmf\Documents\MATLAB\Image5D\Image5D.mltbx</file>
</build-deliverables>
<workflow />
<matlab>
<root>C:\Program Files\MATLAB\R2022b</root>
<root>C:\Program Files\MATLAB\R2023a</root>
<toolboxes />
</matlab>
<platform>
Expand Down
Binary file modified doc/GettingStarted.mlx
Binary file not shown.

0 comments on commit da5ccf2

Please sign in to comment.