Skip to content

Commit d6eb2cf

Browse files
committed
Fix KDU
1 parent 0b18458 commit d6eb2cf

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

cmake/LibraryDefine.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ function(OPENEXR_DEFINE_LIBRARY libname)
2121
if(KDU_LIBRARY)
2222
message("Using Kakadu SDK instead of OpenJPH")
2323
target_include_directories(${objlib} PRIVATE ${KDU_INCLUDE_DIR})
24-
target_compile_definitions(${objlib} PRIVATE KDU_AVAILABLE=1)
25-
target_link_libraries(${objlib} PUBLIC ${PROJECT_NAME}::Config ${OPENEXR_CURLIB_DEPENDENCIES} ${KDU_LIBRARY} ${CMAKE_DL_LIBS} openjph)
24+
target_compile_definitions(${objlib} PRIVATE KDU_AVAILABLE)
25+
target_link_libraries(${objlib} PUBLIC ${PROJECT_NAME}::Config ${OPENEXR_CURLIB_DEPENDENCIES} ${KDU_LIBRARY} ${CMAKE_DL_LIBS})
2626
else()
2727
target_link_libraries(${objlib} PUBLIC ${PROJECT_NAME}::Config ${OPENEXR_CURLIB_DEPENDENCIES} ${CMAKE_DL_LIBS} openjph)
2828
endif()

src/lib/OpenEXRCore/internal_ht.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,14 @@ internal_exr_apply_ht (exr_encode_pipeline_t* encode)
150150
int width = encode->chunk.width;
151151

152152
std::vector<int> heights (encode->channel_count);
153+
std::fill (heights.begin (), heights.end (), height);
154+
153155
std::vector<int> sample_offsets (encode->channel_count);
156+
for (int i = 0; i < sample_offsets.size (); i++)
157+
{
158+
sample_offsets[i] = cs_to_file_ch[i].file_index * width;
159+
}
160+
154161
std::vector<int> row_gaps (encode->channel_count);
155162
std::fill (
156163
row_gaps.begin (), row_gaps.end (), width * encode->channel_count);
@@ -164,9 +171,6 @@ internal_exr_apply_ht (exr_encode_pipeline_t* encode)
164171
static_cast<kdu_params&> (siz).finalize ();
165172

166173
kdu_codestream codestream;
167-
// kdu_simple_file_target output("/tmp/out.j2c");
168-
// codestream.create (&siz, &output);
169-
170174
mem_compressed_target output;
171175
codestream.create (&siz, &output);
172176

@@ -191,7 +195,6 @@ internal_exr_apply_ht (exr_encode_pipeline_t* encode)
191195
kdu_stripe_compressor compressor;
192196
compressor.start (codestream);
193197

194-
std::fill (heights.begin (), heights.end (), height);
195198
compressor.push_stripe (
196199
(kdu_int16*) encode->packed_buffer,
197200
heights.data (),

0 commit comments

Comments
 (0)