summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2026-04-09 00:00:11 +0200
committerCarl Hetherington <cth@carlh.net>2026-04-09 00:00:11 +0200
commit46be9998a8551e8a42841c8336cbcec2818d4134 (patch)
tree072928a9079fcd4afa2e33623d60166131ddbf8f /src
parent572c6e8f8c6801c89f7fefd44c0445e365537a2f (diff)
White space: image_content.{cc,h}
Diffstat (limited to 'src')
-rw-r--r--src/lib/image_content.cc66
-rw-r--r--src/lib/image_content.h28
2 files changed, 47 insertions, 47 deletions
diff --git a/src/lib/image_content.cc b/src/lib/image_content.cc
index 8d3092196..4e9eff237 100644
--- a/src/lib/image_content.cc
+++ b/src/lib/image_content.cc
@@ -46,33 +46,33 @@ using boost::optional;
using namespace dcpomatic;
-ImageContent::ImageContent (boost::filesystem::path p)
+ImageContent::ImageContent(boost::filesystem::path p)
{
video = make_shared<VideoContent>(this);
if (dcp::filesystem::is_regular_file(p) && valid_image_file(p)) {
- add_path (p);
+ add_path(p);
} else {
_path_to_scan = p;
}
- set_default_colour_conversion ();
+ set_default_colour_conversion();
}
ImageContent::ImageContent(cxml::ConstNodePtr node, boost::optional<boost::filesystem::path> film_directory, int version)
: Content(node, film_directory)
{
- video = VideoContent::from_xml (this, node, version, VideoRange::FULL);
+ video = VideoContent::from_xml(this, node, version, VideoRange::FULL);
}
string
-ImageContent::summary () const
+ImageContent::summary() const
{
- string s = path_summary () + " ";
+ string s = path_summary() + " ";
/* Get the string() here so that the name does not have quotes around it */
- if (still ()) {
+ if (still()) {
s += _("[still]");
} else {
s += _("[moving images]");
@@ -83,12 +83,12 @@ ImageContent::summary () const
string
-ImageContent::technical_summary () const
+ImageContent::technical_summary() const
{
string s = Content::technical_summary() + " - "
+ video->technical_summary() + " - ";
- if (still ()) {
+ if (still()) {
s += _("still");
} else {
s += _("moving");
@@ -114,92 +114,92 @@ void
ImageContent::examine(shared_ptr<const Film> film, shared_ptr<Job> job, bool tolerant)
{
if (_path_to_scan) {
- job->sub (_("Scanning image files"));
+ job->sub(_("Scanning image files"));
vector<boost::filesystem::path> paths;
int n = 0;
for (auto i: dcp::filesystem::directory_iterator(*_path_to_scan)) {
if (dcp::filesystem::is_regular_file(i.path()) && valid_image_file(i.path())) {
- paths.push_back (i.path());
+ paths.push_back(i.path());
}
++n;
if ((n % 1000) == 0) {
- job->set_progress_unknown ();
+ job->set_progress_unknown();
}
}
if (paths.empty()) {
- throw FileError (_("No valid image files were found in the folder."), *_path_to_scan);
+ throw FileError(_("No valid image files were found in the folder."), *_path_to_scan);
}
- sort (paths.begin(), paths.end(), ImageFilenameSorter());
- set_paths (paths);
+ sort(paths.begin(), paths.end(), ImageFilenameSorter());
+ set_paths(paths);
}
Content::examine(film, job, tolerant);
auto examiner = make_shared<ImageExaminer>(film, shared_from_this(), job);
video->take_from_examiner(film, examiner);
- set_default_colour_conversion ();
+ set_default_colour_conversion();
}
DCPTime
-ImageContent::full_length (shared_ptr<const Film> film) const
+ImageContent::full_length(shared_ptr<const Film> film) const
{
- FrameRateChange const frc (film, shared_from_this());
- return DCPTime::from_frames (llrint(video->length_after_3d_combine() * frc.factor()), film->video_frame_rate());
+ FrameRateChange const frc(film, shared_from_this());
+ return DCPTime::from_frames(llrint(video->length_after_3d_combine() * frc.factor()), film->video_frame_rate());
}
DCPTime
-ImageContent::approximate_length () const
+ImageContent::approximate_length() const
{
- return DCPTime::from_frames (video->length_after_3d_combine(), 24);
+ return DCPTime::from_frames(video->length_after_3d_combine(), 24);
}
string
-ImageContent::identifier () const
+ImageContent::identifier() const
{
char buffer[256];
- snprintf (buffer, sizeof(buffer), "%s_%s_%" PRId64, Content::identifier().c_str(), video->identifier().c_str(), video->length());
+ snprintf(buffer, sizeof(buffer), "%s_%s_%" PRId64, Content::identifier().c_str(), video->identifier().c_str(), video->length());
return buffer;
}
bool
-ImageContent::still () const
+ImageContent::still() const
{
return number_of_paths() == 1;
}
void
-ImageContent::set_default_colour_conversion ()
+ImageContent::set_default_colour_conversion()
{
for (auto i: paths()) {
if (valid_j2k_file (i)) {
/* We default to no colour conversion if we have JPEG2000 files */
- video->unset_colour_conversion ();
+ video->unset_colour_conversion();
return;
}
}
- bool const s = still ();
+ bool const s = still();
- boost::mutex::scoped_lock lm (_mutex);
+ boost::mutex::scoped_lock lm(_mutex);
if (s) {
- video->set_colour_conversion (PresetColourConversion::from_id ("srgb").conversion);
+ video->set_colour_conversion(PresetColourConversion::from_id("srgb").conversion);
} else {
- video->set_colour_conversion (PresetColourConversion::from_id ("rec709").conversion);
+ video->set_colour_conversion(PresetColourConversion::from_id("rec709").conversion);
}
}
void
-ImageContent::add_properties (shared_ptr<const Film> film, list<UserProperty>& p) const
+ImageContent::add_properties(shared_ptr<const Film> film, list<UserProperty>& p) const
{
- Content::add_properties (film, p);
- video->add_properties (p);
+ Content::add_properties(film, p);
+ video->add_properties(p);
}
diff --git a/src/lib/image_content.h b/src/lib/image_content.h
index 4b3b13380..04318ae0d 100644
--- a/src/lib/image_content.h
+++ b/src/lib/image_content.h
@@ -26,20 +26,20 @@
class ImageContent : public Content
{
public:
- ImageContent (boost::filesystem::path);
- ImageContent (cxml::ConstNodePtr, boost::optional<boost::filesystem::path> film_directory, int);
+ ImageContent(boost::filesystem::path);
+ ImageContent(cxml::ConstNodePtr, boost::optional<boost::filesystem::path> film_directory, int);
- std::shared_ptr<ImageContent> shared_from_this () {
- return std::dynamic_pointer_cast<ImageContent> (Content::shared_from_this ());
+ std::shared_ptr<ImageContent> shared_from_this() {
+ return std::dynamic_pointer_cast<ImageContent>(Content::shared_from_this());
};
- std::shared_ptr<const ImageContent> shared_from_this () const {
- return std::dynamic_pointer_cast<const ImageContent> (Content::shared_from_this ());
+ std::shared_ptr<const ImageContent> shared_from_this() const {
+ return std::dynamic_pointer_cast<const ImageContent>(Content::shared_from_this());
};
void examine(std::shared_ptr<const Film> film, std::shared_ptr<Job>, bool tolerant) override;
- std::string summary () const override;
- std::string technical_summary () const override;
+ std::string summary() const override;
+ std::string technical_summary() const override;
void as_xml(
xmlpp::Element* element,
@@ -48,17 +48,17 @@ public:
boost::optional<boost::filesystem::path> film_directory
) const override;
- dcpomatic::DCPTime full_length (std::shared_ptr<const Film> film) const override;
- dcpomatic::DCPTime approximate_length () const override;
+ dcpomatic::DCPTime full_length(std::shared_ptr<const Film> film) const override;
+ dcpomatic::DCPTime approximate_length() const override;
- std::string identifier () const override;
+ std::string identifier() const override;
- void set_default_colour_conversion ();
+ void set_default_colour_conversion();
- bool still () const;
+ bool still() const;
private:
- void add_properties (std::shared_ptr<const Film> film, std::list<UserProperty>& p) const override;
+ void add_properties(std::shared_ptr<const Film> film, std::list<UserProperty>& p) const override;
boost::optional<boost::filesystem::path> _path_to_scan;
};