X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Ffileexr.C;h=9c782a112f8340e8f62023c4398ead416be07c35;hp=2a54f3ed7ad668a7de36e682336a3f3c0f40b4fd;hb=HEAD;hpb=f1fc28e0bbb5a7c0e153ef9c1abdbfb1186e1acc diff --git a/cinelerra-5.1/cinelerra/fileexr.C b/cinelerra-5.1/cinelerra/fileexr.C index 2a54f3ed..a705f6c8 100644 --- a/cinelerra-5.1/cinelerra/fileexr.C +++ b/cinelerra-5.1/cinelerra/fileexr.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -50,8 +51,8 @@ public: ~EXRIStream(); bool read (char c[], int n); - Imf::Int64 tellg (); - void seekg (Imf::Int64 pos); + uint64_t tellg (); + void seekg (uint64_t pos); void clear (); private: @@ -67,8 +68,8 @@ public: ~EXROStream(); virtual void write(const char c[], int n); - virtual Imf::Int64 tellp(); - virtual void seekp(Imf::Int64 pos); + virtual uint64_t tellp(); + virtual void seekp(uint64_t pos); private: VFrame *data; @@ -106,12 +107,12 @@ bool EXRIStream::read(char c[], int n) return position >= size; } -Imf::Int64 EXRIStream::tellg () +uint64_t EXRIStream::tellg () { return position; } -void EXRIStream::seekg(Imf::Int64 pos) +void EXRIStream::seekg(uint64_t pos) { position = pos; } @@ -141,12 +142,12 @@ void EXROStream::write(const char c[], int n) data->set_compressed_size(MAX(position, data->get_compressed_size())); } -Imf::Int64 EXROStream::tellp() +uint64_t EXROStream::tellp() { return position; } -void EXROStream::seekp(Imf::Int64 pos) +void EXROStream::seekp(uint64_t pos) { position = pos; } @@ -311,6 +312,9 @@ int FileEXR::read_frame_header(char *path) int FileEXR::read_frame(VFrame *frame, VFrame *data) { + + try { + Imf::setGlobalThreadCount(file->cpus); EXRIStream exr_stream((char*)data->get_data(), data->get_compressed_size()); Imf::InputFile file(exr_stream); @@ -425,6 +429,10 @@ int FileEXR::read_frame(VFrame *frame, VFrame *data) } } return 0; + } catch (const std::exception &e) { + std::cerr << "error reading EXR image file:" << e.what() << std::endl; + return 1; + } } @@ -506,6 +514,15 @@ int FileEXR::write_frame(VFrame *frame, VFrame *data, FrameWriterUnit *unit) return 0; } +int FileEXR::can_copy_from(Asset *asset, int64_t position) +{ + if(asset->format == FILE_EXR || + asset->format == FILE_EXR_LIST) + return 1; + + return 0; +} + FrameWriterUnit* FileEXR::new_writer_unit(FrameWriter *writer) { return new EXRUnit(this, writer); @@ -532,6 +549,8 @@ EXRConfigVideo::EXRConfigVideo(BC_WindowBase *parent_window, Asset *asset) { this->parent_window = parent_window; this->asset = asset; +// *** CONTEXT_HELP *** + context_help_set_keyword("Single File Rendering"); } EXRConfigVideo::~EXRConfigVideo()