params.textures[n]->bind(n);
if(params.local_key)
- params.local_key->bind(texture_id::local_key);
+ params.local_key->bind(static_cast<int>(texture_id::local_key));
if(params.layer_key)
- params.layer_key->bind(texture_id::layer_key);
+ params.layer_key->bind(static_cast<int>(texture_id::layer_key));
// Setup shader
shader_->set("plane[1]", texture_id::plane1);
shader_->set("plane[2]", texture_id::plane2);
shader_->set("plane[3]", texture_id::plane3);
- for(int n = 0; n < params.textures.size(); ++n)
+ for (int n = 0; n < params.textures.size(); ++n)
shader_->set("plane_size[" + boost::lexical_cast<std::string>(n) + "]",
static_cast<float>(params.textures[n]->width()),
static_cast<float>(params.textures[n]->height()));
shader_->set("is_hd", params.pix_desc.planes.at(0).height > 700 ? 1 : 0);
shader_->set("has_local_key", static_cast<bool>(params.local_key));
shader_->set("has_layer_key", static_cast<bool>(params.layer_key));
- shader_->set("pixel_format", params.pix_desc.format.value());
+ shader_->set("pixel_format", params.pix_desc.format);
shader_->set("opacity", params.transform.is_key ? 1.0 : params.transform.opacity);
if(blend_modes_)
{
- params.background->bind(texture_id::background);
+ params.background->bind(static_cast<int>(texture_id::background));
shader_->set("background", texture_id::background);
- shader_->set("blend_mode", params.blend_mode.value());
- shader_->set("keyer", params.keyer.value());
+ shader_->set("blend_mode", params.blend_mode);
+ shader_->set("keyer", params.keyer);
}
else
{
GL(glEnable(GL_BLEND));
- switch(params.keyer.value())
+ switch(params.keyer)
{
case keyer::additive:
GL(glBlendFunc(GL_ONE, GL_ONE));
switch(params.geometry.type())
{
- case core::frame_geometry::quad:
+ case core::frame_geometry::geometry_type::quad:
{
const std::vector<float>& data = params.geometry.data();
float v_left = data[0], v_top = data[1], t_left = data[2], t_top = data[3];
}
break;
- case core::frame_geometry::quad_list:
+ case core::frame_geometry::geometry_type::quad_list:
{
glClientActiveTexture(GL_TEXTURE0);
#include <core/mixer/image/blend_modes.h>
-#include <common/enum_class.h>
#include <common/memory.h>
#include <core/frame/pixel_format.h>
namespace caspar { namespace accelerator { namespace ogl {
-struct keyer_def
+enum class keyer
{
- enum type
- {
- linear = 0,
- additive,
- };
+ linear = 0,
+ additive,
};
-typedef enum_class<keyer_def> keyer;
struct draw_params final
{
class shader;
class device;
-struct texture_id
+enum class texture_id
{
- enum type
- {
- plane0 = 0,
- plane1,
- plane2,
- plane3,
- local_key,
- layer_key,
- background,
- };
+ plane0 = 0,
+ plane1,
+ plane2,
+ plane3,
+ local_key,
+ layer_key,
+ background
};
std::shared_ptr<shader> get_image_shader(
#pragma once
#include <common/memory.h>
-#include <common/enum_class.h>
#include <cstdint>
// Static Members
- struct usage_def
+ enum class usage
{
- enum type
- {
- write_only,
- read_only
- };
+ write_only,
+ read_only
};
- typedef enum_class<usage_def> usage;
// Constructors
{
CASPAR_VERIFY(size > 0);
- auto pool = &host_pools_[usage.value()][size];
+ auto pool = &host_pools_[static_cast<int>(usage)][size];
std::shared_ptr<buffer> buf;
if(!pool->try_pop(buf))
#include <string>
+#include <type_traits>
+
namespace caspar { namespace accelerator { namespace ogl {
class shader final
void set(const std::string& name, float value);
void set(const std::string& name, float value0, float value1);
void set(const std::string& name, double value);
+
+ template<typename E>
+ typename std::enable_if<
+ std::is_enum<E>::value,
+ void
+ >::type set(const std::string& name, E value)
+ {
+ set(name, static_cast<typename std::underlying_type<E>::type>(value));
+ }
+
void use() const;
// Properties
#pragma once
-namespace caspar {
+#include <type_traits>
-template<typename def, typename inner = typename def::type>
-class enum_class : public def
-{
- typedef typename def::type type;
- inner val_;
-public:
- explicit enum_class(int v) : val_(static_cast<type>(v)) {}
- enum_class(type v) : val_(v) {}
- inner value() const { return val_; }
-
- bool operator==(const enum_class& s) const { return val_ == s.val_; }
- bool operator!=(const enum_class& s) const { return val_ != s.val_; }
- bool operator<(const enum_class& s) const { return val_ < s.val_; }
- bool operator<=(const enum_class& s) const { return val_ <= s.val_; }
- bool operator>(const enum_class& s) const { return val_ > s.val_; }
- bool operator>=(const enum_class& s) const { return val_ >= s.val_; }
-
- bool operator==(const int& val) const { return val_ == val; }
- bool operator!=(const int& val) const { return val_ != val; }
- bool operator<(const int& val) const { return val_ < val; }
- bool operator<=(const int& val) const { return val_ <= val; }
- bool operator>(const int& val) const { return val_ > val; }
- bool operator>=(const int& val) const { return val_ >= val; }
+// Macro that defines & and &= for an enum class. Add more when needed.
- enum_class operator&(const enum_class& s) const
- {
- return enum_class(static_cast<type>(val_ & s.val_));
- }
-
- enum_class& operator&=(const enum_class& s)
- {
- val_ = static_cast<type>(val_ & s.val_);
- return *this;
- }
-
- enum_class operator|(const enum_class& s) const
- {
- return enum_class(static_cast<type>(val_ | s.val_));
- }
-
- enum_class& operator|=(const enum_class& s)
- {
- val_ = static_cast<type>(val_ | s.val_);
- return *this;
- }
-
- //operator inner()
- //{
- // return val_;
- //}
-};
-
-}
\ No newline at end of file
+#define ENUM_ENABLE_BITWISE(enum_class) \
+ static enum_class operator&(enum_class lhs, enum_class rhs) \
+ { \
+ return static_cast<enum_class>( \
+ static_cast<std::underlying_type<enum_class>::type>(lhs) \
+ & static_cast<std::underlying_type<enum_class>::type>(rhs)); \
+ }; \
+ static enum_class& operator&=(enum_class& lhs, enum_class rhs) \
+ { \
+ lhs = lhs & rhs; \
+ return lhs; \
+ };
#pragma once
#include "except.h"
-#include "enum_class.h"
#include "log.h"
#include "blocking_bounded_queue_adapter.h"
#include "blocking_priority_queue.h"
namespace caspar {
-struct task_priority_def
+enum class task_priority
{
- enum type
- {
- lowest_priority = 0,
- lower_priority,
- low_priority,
- normal_priority,
- high_priority,
- higher_priority
- };
+ lowest_priority = 0,
+ lower_priority,
+ low_priority,
+ normal_priority,
+ high_priority,
+ higher_priority
};
-typedef enum_class<task_priority_def> task_priority;
class executor final
{
#include "memory.h"
#include "future_fwd.h"
+#include "enum_class.h"
namespace caspar {
/**
* The possible filesystem events.
*/
-enum filesystem_event
+enum class filesystem_event
{
CREATED = 1,
REMOVED = 2,
// Only used for describing a bitmask where all events are wanted. Never used when calling a handler.
ALL = 7
};
+ENUM_ENABLE_BITWISE(filesystem_event);
/**
* Handles filesystem events.
void reemmit_all()
{
- if ((events_mask_ & MODIFIED) == 0)
+ if (static_cast<int>(events_mask_ & filesystem_event::MODIFIED) == 0)
return;
for (auto& file : files_)
- handler_(MODIFIED, file.first);
+ handler_(filesystem_event::MODIFIED, file.first);
}
void reemmit(const boost::filesystem::wpath& file)
{
- if ((events_mask_ & MODIFIED) == 0)
+ if (static_cast<int>(events_mask_ & filesystem_event::MODIFIED) == 0)
return;
if (files_.find(file) != files_.end() && boost::filesystem::exists(file))
- handler_(MODIFIED, file);
+ handler_(filesystem_event::MODIFIED, file);
}
void scan(const boost::function<bool ()>& should_abort)
static const std::time_t NO_LONGER_WRITING_AGE = 3; // Assume std::time_t is expressed in seconds
using namespace boost::filesystem;
- bool interested_in_removed = (events_mask_ & REMOVED) > 0;
- bool interested_in_created = (events_mask_ & CREATED) > 0;
- bool interested_in_modified = (events_mask_ & MODIFIED) > 0;
+ bool interested_in_removed = static_cast<int>(events_mask_ & filesystem_event::REMOVED) > 0;
+ bool interested_in_created = static_cast<int>(events_mask_ & filesystem_event::CREATED) > 0;
+ bool interested_in_modified = static_cast<int>(events_mask_ & filesystem_event::MODIFIED) > 0;
std::set<wpath> removed_files;
boost::copy(
if (modified && can_read_file(path))
{
if (interested_in_modified)
- handler_(MODIFIED, path);
+ handler_(filesystem_event::MODIFIED, path);
files_[path] = current_mtime;
being_written_sizes_.erase(path);
else if (no_longer_being_written_to && can_read_file(path))
{
if (interested_in_created && (report_already_existing_ || !first_scan_))
- handler_(CREATED, path);
+ handler_(filesystem_event::CREATED, path);
if (first_scan_)
initial_files.insert(path);
being_written_sizes_.erase(path);
if (interested_in_removed)
- handler_(REMOVED, path);
+ handler_(filesystem_event::REMOVED, path);
}
if (first_scan_)
namespace caspar { namespace core {
-enum tags
+enum class tags
{
frame_tag = 0,
empty_tag,
levels.min_output = std::max(levels.min_output, other.levels.min_output);
levels.max_output = std::min(levels.max_output, other.levels.max_output);
levels.gamma *= other.levels.gamma;
- field_mode = static_cast<core::field_mode>(field_mode & other.field_mode);
+ field_mode = field_mode & other.field_mode;
is_key |= other.is_key;
is_mix |= other.is_mix;
is_still |= other.is_still;
frame_geometry::frame_geometry() {}
frame_geometry::frame_geometry(geometry_type t, std::vector<float> d) : impl_(new impl(t, std::move(d))) {}
-frame_geometry::geometry_type frame_geometry::type() const { return impl_ ? impl_->type_ : none; }
+frame_geometry::geometry_type frame_geometry::type() const { return impl_ ? impl_->type_ : geometry_type::none; }
const std::vector<float>& frame_geometry::data() const
{
if (impl_)
const frame_geometry& frame_geometry::get_default()
{
const float d[] = {0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f};
- static frame_geometry g(frame_geometry::quad, std::vector<float>(std::begin(d), std::end(d)));
+ static frame_geometry g(frame_geometry::geometry_type::quad, std::vector<float>(std::begin(d), std::end(d)));
return g;
}
class frame_geometry
{
public:
- enum geometry_type
+ enum class geometry_type
{
none,
quad,
#include "../video_format.h"
-#include <common/enum_class.h>
-
#include <cstddef>
#include <vector>
namespace caspar { namespace core {
-struct pixel_format_def
+enum class pixel_format
{
- enum type
- {
- gray = 0,
- bgra,
- rgba,
- argb,
- abgr,
- ycbcr,
- ycbcra,
- luma,
- bgr,
- rgb,
- count,
- invalid,
- };
+ gray = 0,
+ bgra,
+ rgba,
+ argb,
+ abgr,
+ ycbcr,
+ ycbcra,
+ luma,
+ bgr,
+ rgb,
+ count,
+ invalid,
};
-typedef enum_class<pixel_format_def> pixel_format;
struct pixel_format_desc final
{
#pragma once
-#include <common/enum_class.h>
-
namespace caspar { namespace core {
-struct blend_mode_def
+enum class blend_mode
{
- enum type
- {
- normal = 0,
- lighten,
- darken,
- multiply,
- average,
- add,
- subtract,
- difference,
- negation,
- exclusion,
- screen,
- overlay,
- soft_light,
- hard_light,
- color_dodge,
- color_burn,
- linear_dodge,
- linear_burn,
- linear_light,
- vivid_light,
- pin_light,
- hard_mix,
- reflect,
- glow,
- phoenix,
- contrast,
- saturation,
- color,
- luminosity,
- mix,
- blend_mode_count
- };
+ normal = 0,
+ lighten,
+ darken,
+ multiply,
+ average,
+ add,
+ subtract,
+ difference,
+ negation,
+ exclusion,
+ screen,
+ overlay,
+ soft_light,
+ hard_light,
+ color_dodge,
+ color_burn,
+ linear_dodge,
+ linear_burn,
+ linear_light,
+ vivid_light,
+ pin_light,
+ hard_mix,
+ reflect,
+ glow,
+ phoenix,
+ contrast,
+ saturation,
+ color,
+ luminosity,
+ mix,
+ blend_mode_count
};
-typedef enum_class<blend_mode_def> blend_mode;
blend_mode get_blend_mode(const std::wstring& str);
draw_frame create_frame()
{
- pixel_format_desc desc(pixel_format_def::bgra);
+ pixel_format_desc desc(pixel_format::bgra);
desc.planes.push_back(pixel_format_desc::plane(
static_cast<int>(constraints_.width.get()),
static_cast<int>(constraints_.height.get()),
#include <common/forward.h>
#include <common/future_fwd.h>
#include <common/memory.h>
-#include <common/enum_class.h>
#include <cstdint>
#include <limits>
struct op
{
- enum op_type
+ enum class op_type
{
UNARY,
BINARY,
{
case L'+':
++cursor;
- return op(ch, 6, op::BINARY);
+ return op(ch, 6, op::op_type::BINARY);
case L'*':
case L'/':
case L'%':
++cursor;
- return op(ch, 5, op::BINARY);
+ return op(ch, 5, op::op_type::BINARY);
case L'?':
case L':':
++cursor;
- return op(ch, 15, op::TERNARY);
+ return op(ch, 15, op::op_type::TERNARY);
case L'-':
if (first == L'-')
CASPAR_THROW_EXCEPTION(caspar_exception() << msg_info(
if (first == L'=')
{
++cursor;
- return op(L"==", 9, op::BINARY);
+ return op(L"==", 9, op::op_type::BINARY);
}
else if (first == L'!')
{
++cursor;
- return op(L"!=", 9, op::BINARY);
+ return op(L"!=", 9, op::op_type::BINARY);
}
else if (first == L'>')
{
++cursor;
- return op(L">=", 8, op::BINARY);
+ return op(L">=", 8, op::op_type::BINARY);
}
else if (first == L'<')
{
++cursor;
- return op(L"<=", 8, op::BINARY);
+ return op(L"<=", 8, op::op_type::BINARY);
}
else if (first == NONE)
{
if (first == L'|')
{
++cursor;
- return op(L"||", 14, op::BINARY);
+ return op(L"||", 14, op::op_type::BINARY);
}
else if (first == NONE)
{
if (first == L'&')
{
++cursor;
- return op(L"&&", 13, op::BINARY);
+ return op(L"&&", 13, op::op_type::BINARY);
}
else if (first == NONE)
{
case L' ':
case L'\t':
if (first == L'-')
- return op(L'-', 6, op::BINARY);
+ return op(L'-', 6, op::op_type::BINARY);
else if (first == L'!')
- return op(L'!', 3, op::UNARY);
+ return op(L'!', 3, op::op_type::UNARY);
default:
if (first == L'<')
- return op(L'<', 8, op::BINARY);
+ return op(L'<', 8, op::op_type::BINARY);
else if (first == L'>')
- return op(L'>', 8, op::BINARY);
+ return op(L'>', 8, op::op_type::BINARY);
else if (first == L'-')
- return op(L"unary-", 3, op::UNARY);
+ return op(L"unary-", 3, op::op_type::UNARY);
else if (first == L'!')
- return op(L'!', 3, op::UNARY);
+ return op(L'!', 3, op::op_type::UNARY);
else
CASPAR_THROW_EXCEPTION(caspar_exception() << msg_info(
L"Expected second character of operator"
switch (op_token.type)
{
- case op::UNARY:
+ case op::op_type::UNARY:
if (op_token.characters == L"unary-")
{
tokens.at(i) = negative(token_after);
tokens.erase(tokens.begin() + index_after);
break;
- case op::BINARY:
+ case op::op_type::BINARY:
{
auto& token_before = tokens.at(i - 1);
--i;
break;
- case op::TERNARY:
+ case op::op_type::TERNARY:
if (op_token.characters == L"?")
{
auto& token_before = tokens.at(i - 1);
, dirty_(false)
{
//TODO: examine str to determine which unicode_blocks to load
- font_.load_glyphs(text::Basic_Latin, text_info.color);
- font_.load_glyphs(text::Latin_1_Supplement, text_info.color);
- font_.load_glyphs(text::Latin_Extended_A, text_info.color);
+ font_.load_glyphs(text::unicode_block::Basic_Latin, text_info.color);
+ font_.load_glyphs(text::unicode_block::Latin_1_Supplement, text_info.color);
+ font_.load_glyphs(text::unicode_block::Latin_Extended_A, text_info.color);
tracking_.value().set(text_info.tracking);
text_subscription_ = text_.value().on_change([this]()
auto vertex_stream = font_.create_vertex_stream(text_.value().get(), x_, y_, parent_width_, parent_height_, &metrics);
auto frame = frame_factory_->create_frame(vertex_stream.data(), pfd);
memcpy(frame.image_data().data(), atlas_.data(), frame.image_data().size());
- frame.set_geometry(frame_geometry(frame_geometry::quad_list, std::move(vertex_stream)));
+ frame.set_geometry(frame_geometry(frame_geometry::geometry_type::quad_list, std::move(vertex_stream)));
this->constraints_.width.set(metrics.width);
this->constraints_.height.set(metrics.height);
{
switch(block)
{
- case Basic_Latin: return unicode_range(0x0000, 0x007F);
- case Latin_1_Supplement: return unicode_range(0x0080, 0x00FF);
- case Latin_Extended_A: return unicode_range(0x0100, 0x017F);
- case Latin_Extended_B: return unicode_range(0x0180, 0x024F);
- case IPA_Extensions: return unicode_range(0x0250, 0x02AF);
- case Spacing_Modifier_Letters: return unicode_range(0x02B0, 0x02FF);
- case Combining_Diacritical_Marks: return unicode_range(0x0300, 0x036F);
- case Greek_and_Coptic: return unicode_range(0x0370, 0x03FF);
- case Cyrillic: return unicode_range(0x0400, 0x04FF);
- case Cyrillic_Supplement: return unicode_range(0x0500, 0x052F);
- case Armenian: return unicode_range(0x0530, 0x058F);
- case Hebrew: return unicode_range(0x0590, 0x05FF);
- case Arabic: return unicode_range(0x0600, 0x06FF);
- case Syriac: return unicode_range(0x0700, 0x074F);
- case Arabic_Supplement: return unicode_range(0x0750, 0x077F);
- case Thaana: return unicode_range(0x0780, 0x07BF);
- case NKo: return unicode_range(0x07C0, 0x07FF);
- case Samaritan: return unicode_range(0x0800, 0x083F);
- case Mandaic: return unicode_range(0x0840, 0x085F);
- case Arabic_Extended_A: return unicode_range(0x08A0, 0x08FF);
- case Devanagari: return unicode_range(0x0900, 0x097F);
- case Bengali: return unicode_range(0x0980, 0x09FF);
- case Gurmukhi: return unicode_range(0x0A00, 0x0A7F);
- case Gujarati: return unicode_range(0x0A80, 0x0AFF);
- case Oriya: return unicode_range(0x0B00, 0x0B7F);
- case Tamil: return unicode_range(0x0B80, 0x0BFF);
- case Telugu: return unicode_range(0x0C00, 0x0C7F);
- case Kannada: return unicode_range(0x0C80, 0x0CFF);
- case Malayalam: return unicode_range(0x0D00, 0x0D7F);
- case Sinhala: return unicode_range(0x0D80, 0x0DFF);
- case Thai: return unicode_range(0x0E00, 0x0E7F);
- case Lao: return unicode_range(0x0E80, 0x0EFF);
- case Tibetan: return unicode_range(0x0F00, 0x0FFF);
- case Myanmar: return unicode_range(0x1000, 0x109F);
- case Georgian: return unicode_range(0x10A0, 0x10FF);
- case Hangul_Jamo: return unicode_range(0x1100, 0x11FF);
- case Ethiopic: return unicode_range(0x1200, 0x137F);
- case Ethiopic_Supplement: return unicode_range(0x1380, 0x139F);
- case Cherokee: return unicode_range(0x13A0, 0x13FF);
- case Unified_Canadian_Aboriginal_Syllabics: return unicode_range(0x1400, 0x167F);
- case Ogham: return unicode_range(0x1680, 0x169F);
- case Runic: return unicode_range(0x16A0, 0x16FF);
- case Tagalog: return unicode_range(0x1700, 0x171F);
- case Hanunoo: return unicode_range(0x1720, 0x173F);
- case Buhid: return unicode_range(0x1740, 0x175F);
- case Tagbanwa: return unicode_range(0x1760, 0x177F);
- case Khmer: return unicode_range(0x1780, 0x17FF);
- case Mongolian: return unicode_range(0x1800, 0x18AF);
- case Unified_Canadian_Aboriginal_Syllabics_Extended: return unicode_range(0x18B0, 0x18FF);
- case Limbu: return unicode_range(0x1900, 0x194F);
- case Tai_Le: return unicode_range(0x1950, 0x197F);
- case New_Tai_Lue: return unicode_range(0x1980, 0x19DF);
- case Khmer_Symbols: return unicode_range(0x19E0, 0x19FF);
- case Buginese: return unicode_range(0x1A00, 0x1A1F);
- case Tai_Tham: return unicode_range(0x1A20, 0x1AAF);
- case Balinese: return unicode_range(0x1B00, 0x1B7F);
- case Sundanese: return unicode_range(0x1B80, 0x1BBF);
- case Batak: return unicode_range(0x1BC0, 0x1BFF);
- case Lepcha: return unicode_range(0x1C00, 0x1C4F);
- case Ol_Chiki: return unicode_range(0x1C50, 0x1C7F);
- case Sundanese_Supplement: return unicode_range(0x1CC0, 0x1CCF);
- case Vedic_Extensions: return unicode_range(0x1CD0, 0x1CFF);
- case Phonetic_Extensions: return unicode_range(0x1D00, 0x1D7F);
- case Phonetic_Extensions_Supplement: return unicode_range(0x1D80, 0x1DBF);
- case Combining_Diacritical_Marks_Supplement: return unicode_range(0x1DC0, 0x1DFF);
- case Latin_Extended_Additional: return unicode_range(0x1E00, 0x1EFF);
- case Greek_Extended: return unicode_range(0x1F00, 0x1FFF);
- case General_Punctuation: return unicode_range(0x2000, 0x206F);
- case Superscripts_and_Subscripts: return unicode_range(0x2070, 0x209F);
- case Currency_Symbols: return unicode_range(0x20A0, 0x20CF);
- case Combining_Diacritical_Marks_for_Symbols: return unicode_range(0x20D0, 0x20FF);
- case Letterlike_Symbols: return unicode_range(0x2100, 0x214F);
- case Number_Forms: return unicode_range(0x2150, 0x218F);
- case Arrows: return unicode_range(0x2190, 0x21FF);
- case Mathematical_Operators: return unicode_range(0x2200, 0x22FF);
- case Miscellaneous_Technical: return unicode_range(0x2300, 0x23FF);
- case Control_Pictures: return unicode_range(0x2400, 0x243F);
- case Optical_Character_Recognition: return unicode_range(0x2440, 0x245F);
- case Enclosed_Alphanumerics: return unicode_range(0x2460, 0x24FF);
- case Box_Drawing: return unicode_range(0x2500, 0x257F);
- case Block_Elements: return unicode_range(0x2580, 0x259F);
- case Geometric_Shapes: return unicode_range(0x25A0, 0x25FF);
- case Miscellaneous_Symbols: return unicode_range(0x2600, 0x26FF);
- case Dingbats: return unicode_range(0x2700, 0x27BF);
- case Miscellaneous_Mathematical_Symbols_A: return unicode_range(0x27C0, 0x27EF);
- case Supplemental_Arrows_A: return unicode_range(0x27F0, 0x27FF);
- case Braille_Patterns: return unicode_range(0x2800, 0x28FF);
- case Supplemental_Arrows_B: return unicode_range(0x2900, 0x297F);
- case Miscellaneous_Mathematical_Symbols_B: return unicode_range(0x2980, 0x29FF);
- case Supplemental_Mathematical_Operators: return unicode_range(0x2A00, 0x2AFF);
- case Miscellaneous_Symbols_and_Arrows: return unicode_range(0x2B00, 0x2BFF);
- case Glagolitic: return unicode_range(0x2C00, 0x2C5F);
- case Latin_Extended_C: return unicode_range(0x2C60, 0x2C7F);
- case Coptic: return unicode_range(0x2C80, 0x2CFF);
- case Georgian_Supplement: return unicode_range(0x2D00, 0x2D2F);
- case Tifinagh: return unicode_range(0x2D30, 0x2D7F);
- case Ethiopic_Extended: return unicode_range(0x2D80, 0x2DDF);
- case Cyrillic_Extended_A: return unicode_range(0x2DE0, 0x2DFF);
- case Supplemental_Punctuation: return unicode_range(0x2E00, 0x2E7F);
- case CJK_Radicals_Supplement: return unicode_range(0x2E80, 0x2EFF);
- case Kangxi_Radicals: return unicode_range(0x2F00, 0x2FDF);
- case Ideographic_Description_Characters: return unicode_range(0x2FF0, 0x2FFF);
- case CJK_Symbols_and_Punctuation: return unicode_range(0x3000, 0x303F);
- case Hiragana: return unicode_range(0x3040, 0x309F);
- case Katakana: return unicode_range(0x30A0, 0x30FF);
- case Bopomofo: return unicode_range(0x3100, 0x312F);
- case Hangul_Compatibility_Jamo: return unicode_range(0x3130, 0x318F);
- case Kanbun: return unicode_range(0x3190, 0x319F);
- case Bopomofo_Extended: return unicode_range(0x31A0, 0x31BF);
- case CJK_Strokes: return unicode_range(0x31C0, 0x31EF);
- case Katakana_Phonetic_Extensions: return unicode_range(0x31F0, 0x31FF);
- case Enclosed_CJK_Letters_and_Months: return unicode_range(0x3200, 0x32FF);
- case CJK_Compatibility: return unicode_range(0x3300, 0x33FF);
- case CJK_Unified_Ideographs_Extension_A: return unicode_range(0x3400, 0x4DBF);
- case Yijing_Hexagram_Symbols: return unicode_range(0x4DC0, 0x4DFF);
- case CJK_Unified_Ideographs: return unicode_range(0x4E00, 0x9FFF);
- case Yi_Syllables: return unicode_range(0xA000, 0xA48F);
- case Yi_Radicals: return unicode_range(0xA490, 0xA4CF);
- case Lisu: return unicode_range(0xA4D0, 0xA4FF);
- case Vai: return unicode_range(0xA500, 0xA63F);
- case Cyrillic_Extended_B: return unicode_range(0xA640, 0xA69F);
- case Bamum: return unicode_range(0xA6A0, 0xA6FF);
- case Modifier_Tone_Letters: return unicode_range(0xA700, 0xA71F);
- case Latin_Extended_D: return unicode_range(0xA720, 0xA7FF);
- case Syloti_Nagri: return unicode_range(0xA800, 0xA82F);
- case Common_Indic_Number_Forms: return unicode_range(0xA830, 0xA83F);
- case Phags_pa: return unicode_range(0xA840, 0xA87F);
- case Saurashtra: return unicode_range(0xA880, 0xA8DF);
- case Devanagari_Extended: return unicode_range(0xA8E0, 0xA8FF);
- case Kayah_Li: return unicode_range(0xA900, 0xA92F);
- case Rejang: return unicode_range(0xA930, 0xA95F);
- case Hangul_Jamo_Extended_A: return unicode_range(0xA960, 0xA97F);
- case Javanese: return unicode_range(0xA980, 0xA9DF);
- case Cham: return unicode_range(0xAA00, 0xAA5F);
- case Myanmar_Extended_A: return unicode_range(0xAA60, 0xAA7F);
- case Tai_Viet: return unicode_range(0xAA80, 0xAADF);
- case Meetei_Mayek_Extensions: return unicode_range(0xAAE0, 0xAAFF);
- case Ethiopic_Extended_A: return unicode_range(0xAB00, 0xAB2F);
- case Meetei_Mayek: return unicode_range(0xABC0, 0xABFF);
- case Hangul_Syllables: return unicode_range(0xAC00, 0xD7AF);
- case Hangul_Jamo_Extended_B: return unicode_range(0xD7B0, 0xD7FF);
- case High_Surrogates: return unicode_range(0xD800, 0xDB7F);
- case High_Private_Use_Surrogates: return unicode_range(0xDB80, 0xDBFF);
- case Low_Surrogates: return unicode_range(0xDC00, 0xDFFF);
- case Private_Use_Area: return unicode_range(0xE000, 0xF8FF);
- case CJK_Compatibility_Ideographs: return unicode_range(0xF900, 0xFAFF);
- case Alphabetic_Presentation_Forms: return unicode_range(0xFB00, 0xFB4F);
- case Arabic_Presentation_Forms_A: return unicode_range(0xFB50, 0xFDFF);
- case Variation_Selectors: return unicode_range(0xFE00, 0xFE0F);
- case Vertical_Forms: return unicode_range(0xFE10, 0xFE1F);
- case Combining_Half_Marks: return unicode_range(0xFE20, 0xFE2F);
- case CJK_Compatibility_Forms: return unicode_range(0xFE30, 0xFE4F);
- case Small_Form_Variants: return unicode_range(0xFE50, 0xFE6F);
- case Arabic_Presentation_Forms_B: return unicode_range(0xFE70, 0xFEFF);
- case Halfwidth_and_Fullwidth_Forms: return unicode_range(0xFF00, 0xFFEF);
- case Specials: return unicode_range(0xFFF0, 0xFFFF);
- case Linear_B_Syllabary: return unicode_range(0x10000, 0x1007F);
- case Linear_B_Ideograms: return unicode_range(0x10080, 0x100FF);
- case Aegean_Numbers: return unicode_range(0x10100, 0x1013F);
- case Ancient_Greek_Numbers: return unicode_range(0x10140, 0x1018F);
- case Ancient_Symbols: return unicode_range(0x10190, 0x101CF);
- case Phaistos_Disc: return unicode_range(0x101D0, 0x101FF);
- case Lycian: return unicode_range(0x10280, 0x1029F);
- case Carian: return unicode_range(0x102A0, 0x102DF);
- case Old_Italic: return unicode_range(0x10300, 0x1032F);
- case Gothic: return unicode_range(0x10330, 0x1034F);
- case Ugaritic: return unicode_range(0x10380, 0x1039F);
- case Old_Persian: return unicode_range(0x103A0, 0x103DF);
- case Deseret: return unicode_range(0x10400, 0x1044F);
- case Shavian: return unicode_range(0x10450, 0x1047F);
- case Osmanya: return unicode_range(0x10480, 0x104AF);
- case Cypriot_Syllabary: return unicode_range(0x10800, 0x1083F);
- case Imperial_Aramaic: return unicode_range(0x10840, 0x1085F);
- case Phoenician: return unicode_range(0x10900, 0x1091F);
- case Lydian: return unicode_range(0x10920, 0x1093F);
- case Meroitic_Hieroglyphs: return unicode_range(0x10980, 0x1099F);
- case Meroitic_Cursive: return unicode_range(0x109A0, 0x109FF);
- case Kharoshthi: return unicode_range(0x10A00, 0x10A5F);
- case Old_South_Arabian: return unicode_range(0x10A60, 0x10A7F);
- case Avestan: return unicode_range(0x10B00, 0x10B3F);
- case Inscriptional_Parthian: return unicode_range(0x10B40, 0x10B5F);
- case Inscriptional_Pahlavi: return unicode_range(0x10B60, 0x10B7F);
- case Old_Turkic: return unicode_range(0x10C00, 0x10C4F);
- case Rumi_Numeral_Symbols: return unicode_range(0x10E60, 0x10E7F);
- case Brahmi: return unicode_range(0x11000, 0x1107F);
- case Kaithi: return unicode_range(0x11080, 0x110CF);
- case Sora_Sompeng: return unicode_range(0x110D0, 0x110FF);
- case Chakma: return unicode_range(0x11100, 0x1114F);
- case Sharada: return unicode_range(0x11180, 0x111DF);
- case Takri: return unicode_range(0x11680, 0x116CF);
- case Cuneiform: return unicode_range(0x12000, 0x123FF);
- case Cuneiform_Numbers_and_Punctuation: return unicode_range(0x12400, 0x1247F);
- case Egyptian_Hieroglyphs: return unicode_range(0x13000, 0x1342F);
- case Bamum_Supplement: return unicode_range(0x16800, 0x16A3F);
- case Miao: return unicode_range(0x16F00, 0x16F9F);
- case Kana_Supplement: return unicode_range(0x1B000, 0x1B0FF);
- case Byzantine_Musical_Symbols: return unicode_range(0x1D000, 0x1D0FF);
- case Musical_Symbols: return unicode_range(0x1D100, 0x1D1FF);
- case Ancient_Greek_Musical_Notation: return unicode_range(0x1D200, 0x1D24F);
- case Tai_Xuan_Jing_Symbols: return unicode_range(0x1D300, 0x1D35F);
- case Counting_Rod_Numerals: return unicode_range(0x1D360, 0x1D37F);
- case Mathematical_Alphanumeric_Symbols: return unicode_range(0x1D400, 0x1D7FF);
- case Arabic_Mathematical_Alphabetic_Symbols: return unicode_range(0x1EE00, 0x1EEFF);
- case Mahjong_Tiles: return unicode_range(0x1F000, 0x1F02F);
- case Domino_Tiles: return unicode_range(0x1F030, 0x1F09F);
- case Playing_Cards: return unicode_range(0x1F0A0, 0x1F0FF);
- case Enclosed_Alphanumeric_Supplement: return unicode_range(0x1F100, 0x1F1FF);
- case Enclosed_Ideographic_Supplement: return unicode_range(0x1F200, 0x1F2FF);
- case Miscellaneous_Symbols_And_Pictographs: return unicode_range(0x1F300, 0x1F5FF);
- case Emoticons: return unicode_range(0x1F600, 0x1F64F);
- case Transport_And_Map_Symbols: return unicode_range(0x1F680, 0x1F6FF);
- case Alchemical_Symbols: return unicode_range(0x1F700, 0x1F77F);
- case CJK_Unified_Ideographs_Extension_B: return unicode_range(0x20000, 0x2A6DF);
- case CJK_Unified_Ideographs_Extension_C: return unicode_range(0x2A700, 0x2B73F);
- case CJK_Unified_Ideographs_Extension_D: return unicode_range(0x2B740, 0x2B81F);
- case CJK_Compatibility_Ideographs_Supplement: return unicode_range(0x2F800, 0x2FA1F);
- case Tags: return unicode_range(0xE0000, 0xE007F);
- case Variation_Selectors_Supplement: return unicode_range(0xE0100, 0xE01EF);
- case Supplementary_Private_Use_Area_A: return unicode_range(0xF0000, 0xFFFFF);
- case Supplementary_Private_Use_Area_B: return unicode_range(0x100000, 0x10FFFF);
+ case unicode_block::Basic_Latin: return unicode_range(0x0000, 0x007F);
+ case unicode_block::Latin_1_Supplement: return unicode_range(0x0080, 0x00FF);
+ case unicode_block::Latin_Extended_A: return unicode_range(0x0100, 0x017F);
+ case unicode_block::Latin_Extended_B: return unicode_range(0x0180, 0x024F);
+ case unicode_block::IPA_Extensions: return unicode_range(0x0250, 0x02AF);
+ case unicode_block::Spacing_Modifier_Letters: return unicode_range(0x02B0, 0x02FF);
+ case unicode_block::Combining_Diacritical_Marks: return unicode_range(0x0300, 0x036F);
+ case unicode_block::Greek_and_Coptic: return unicode_range(0x0370, 0x03FF);
+ case unicode_block::Cyrillic: return unicode_range(0x0400, 0x04FF);
+ case unicode_block::Cyrillic_Supplement: return unicode_range(0x0500, 0x052F);
+ case unicode_block::Armenian: return unicode_range(0x0530, 0x058F);
+ case unicode_block::Hebrew: return unicode_range(0x0590, 0x05FF);
+ case unicode_block::Arabic: return unicode_range(0x0600, 0x06FF);
+ case unicode_block::Syriac: return unicode_range(0x0700, 0x074F);
+ case unicode_block::Arabic_Supplement: return unicode_range(0x0750, 0x077F);
+ case unicode_block::Thaana: return unicode_range(0x0780, 0x07BF);
+ case unicode_block::NKo: return unicode_range(0x07C0, 0x07FF);
+ case unicode_block::Samaritan: return unicode_range(0x0800, 0x083F);
+ case unicode_block::Mandaic: return unicode_range(0x0840, 0x085F);
+ case unicode_block::Arabic_Extended_A: return unicode_range(0x08A0, 0x08FF);
+ case unicode_block::Devanagari: return unicode_range(0x0900, 0x097F);
+ case unicode_block::Bengali: return unicode_range(0x0980, 0x09FF);
+ case unicode_block::Gurmukhi: return unicode_range(0x0A00, 0x0A7F);
+ case unicode_block::Gujarati: return unicode_range(0x0A80, 0x0AFF);
+ case unicode_block::Oriya: return unicode_range(0x0B00, 0x0B7F);
+ case unicode_block::Tamil: return unicode_range(0x0B80, 0x0BFF);
+ case unicode_block::Telugu: return unicode_range(0x0C00, 0x0C7F);
+ case unicode_block::Kannada: return unicode_range(0x0C80, 0x0CFF);
+ case unicode_block::Malayalam: return unicode_range(0x0D00, 0x0D7F);
+ case unicode_block::Sinhala: return unicode_range(0x0D80, 0x0DFF);
+ case unicode_block::Thai: return unicode_range(0x0E00, 0x0E7F);
+ case unicode_block::Lao: return unicode_range(0x0E80, 0x0EFF);
+ case unicode_block::Tibetan: return unicode_range(0x0F00, 0x0FFF);
+ case unicode_block::Myanmar: return unicode_range(0x1000, 0x109F);
+ case unicode_block::Georgian: return unicode_range(0x10A0, 0x10FF);
+ case unicode_block::Hangul_Jamo: return unicode_range(0x1100, 0x11FF);
+ case unicode_block::Ethiopic: return unicode_range(0x1200, 0x137F);
+ case unicode_block::Ethiopic_Supplement: return unicode_range(0x1380, 0x139F);
+ case unicode_block::Cherokee: return unicode_range(0x13A0, 0x13FF);
+ case unicode_block::Unified_Canadian_Aboriginal_Syllabics: return unicode_range(0x1400, 0x167F);
+ case unicode_block::Ogham: return unicode_range(0x1680, 0x169F);
+ case unicode_block::Runic: return unicode_range(0x16A0, 0x16FF);
+ case unicode_block::Tagalog: return unicode_range(0x1700, 0x171F);
+ case unicode_block::Hanunoo: return unicode_range(0x1720, 0x173F);
+ case unicode_block::Buhid: return unicode_range(0x1740, 0x175F);
+ case unicode_block::Tagbanwa: return unicode_range(0x1760, 0x177F);
+ case unicode_block::Khmer: return unicode_range(0x1780, 0x17FF);
+ case unicode_block::Mongolian: return unicode_range(0x1800, 0x18AF);
+ case unicode_block::Unified_Canadian_Aboriginal_Syllabics_Extended: return unicode_range(0x18B0, 0x18FF);
+ case unicode_block::Limbu: return unicode_range(0x1900, 0x194F);
+ case unicode_block::Tai_Le: return unicode_range(0x1950, 0x197F);
+ case unicode_block::New_Tai_Lue: return unicode_range(0x1980, 0x19DF);
+ case unicode_block::Khmer_Symbols: return unicode_range(0x19E0, 0x19FF);
+ case unicode_block::Buginese: return unicode_range(0x1A00, 0x1A1F);
+ case unicode_block::Tai_Tham: return unicode_range(0x1A20, 0x1AAF);
+ case unicode_block::Balinese: return unicode_range(0x1B00, 0x1B7F);
+ case unicode_block::Sundanese: return unicode_range(0x1B80, 0x1BBF);
+ case unicode_block::Batak: return unicode_range(0x1BC0, 0x1BFF);
+ case unicode_block::Lepcha: return unicode_range(0x1C00, 0x1C4F);
+ case unicode_block::Ol_Chiki: return unicode_range(0x1C50, 0x1C7F);
+ case unicode_block::Sundanese_Supplement: return unicode_range(0x1CC0, 0x1CCF);
+ case unicode_block::Vedic_Extensions: return unicode_range(0x1CD0, 0x1CFF);
+ case unicode_block::Phonetic_Extensions: return unicode_range(0x1D00, 0x1D7F);
+ case unicode_block::Phonetic_Extensions_Supplement: return unicode_range(0x1D80, 0x1DBF);
+ case unicode_block::Combining_Diacritical_Marks_Supplement: return unicode_range(0x1DC0, 0x1DFF);
+ case unicode_block::Latin_Extended_Additional: return unicode_range(0x1E00, 0x1EFF);
+ case unicode_block::Greek_Extended: return unicode_range(0x1F00, 0x1FFF);
+ case unicode_block::General_Punctuation: return unicode_range(0x2000, 0x206F);
+ case unicode_block::Superscripts_and_Subscripts: return unicode_range(0x2070, 0x209F);
+ case unicode_block::Currency_Symbols: return unicode_range(0x20A0, 0x20CF);
+ case unicode_block::Combining_Diacritical_Marks_for_Symbols: return unicode_range(0x20D0, 0x20FF);
+ case unicode_block::Letterlike_Symbols: return unicode_range(0x2100, 0x214F);
+ case unicode_block::Number_Forms: return unicode_range(0x2150, 0x218F);
+ case unicode_block::Arrows: return unicode_range(0x2190, 0x21FF);
+ case unicode_block::Mathematical_Operators: return unicode_range(0x2200, 0x22FF);
+ case unicode_block::Miscellaneous_Technical: return unicode_range(0x2300, 0x23FF);
+ case unicode_block::Control_Pictures: return unicode_range(0x2400, 0x243F);
+ case unicode_block::Optical_Character_Recognition: return unicode_range(0x2440, 0x245F);
+ case unicode_block::Enclosed_Alphanumerics: return unicode_range(0x2460, 0x24FF);
+ case unicode_block::Box_Drawing: return unicode_range(0x2500, 0x257F);
+ case unicode_block::Block_Elements: return unicode_range(0x2580, 0x259F);
+ case unicode_block::Geometric_Shapes: return unicode_range(0x25A0, 0x25FF);
+ case unicode_block::Miscellaneous_Symbols: return unicode_range(0x2600, 0x26FF);
+ case unicode_block::Dingbats: return unicode_range(0x2700, 0x27BF);
+ case unicode_block::Miscellaneous_Mathematical_Symbols_A: return unicode_range(0x27C0, 0x27EF);
+ case unicode_block::Supplemental_Arrows_A: return unicode_range(0x27F0, 0x27FF);
+ case unicode_block::Braille_Patterns: return unicode_range(0x2800, 0x28FF);
+ case unicode_block::Supplemental_Arrows_B: return unicode_range(0x2900, 0x297F);
+ case unicode_block::Miscellaneous_Mathematical_Symbols_B: return unicode_range(0x2980, 0x29FF);
+ case unicode_block::Supplemental_Mathematical_Operators: return unicode_range(0x2A00, 0x2AFF);
+ case unicode_block::Miscellaneous_Symbols_and_Arrows: return unicode_range(0x2B00, 0x2BFF);
+ case unicode_block::Glagolitic: return unicode_range(0x2C00, 0x2C5F);
+ case unicode_block::Latin_Extended_C: return unicode_range(0x2C60, 0x2C7F);
+ case unicode_block::Coptic: return unicode_range(0x2C80, 0x2CFF);
+ case unicode_block::Georgian_Supplement: return unicode_range(0x2D00, 0x2D2F);
+ case unicode_block::Tifinagh: return unicode_range(0x2D30, 0x2D7F);
+ case unicode_block::Ethiopic_Extended: return unicode_range(0x2D80, 0x2DDF);
+ case unicode_block::Cyrillic_Extended_A: return unicode_range(0x2DE0, 0x2DFF);
+ case unicode_block::Supplemental_Punctuation: return unicode_range(0x2E00, 0x2E7F);
+ case unicode_block::CJK_Radicals_Supplement: return unicode_range(0x2E80, 0x2EFF);
+ case unicode_block::Kangxi_Radicals: return unicode_range(0x2F00, 0x2FDF);
+ case unicode_block::Ideographic_Description_Characters: return unicode_range(0x2FF0, 0x2FFF);
+ case unicode_block::CJK_Symbols_and_Punctuation: return unicode_range(0x3000, 0x303F);
+ case unicode_block::Hiragana: return unicode_range(0x3040, 0x309F);
+ case unicode_block::Katakana: return unicode_range(0x30A0, 0x30FF);
+ case unicode_block::Bopomofo: return unicode_range(0x3100, 0x312F);
+ case unicode_block::Hangul_Compatibility_Jamo: return unicode_range(0x3130, 0x318F);
+ case unicode_block::Kanbun: return unicode_range(0x3190, 0x319F);
+ case unicode_block::Bopomofo_Extended: return unicode_range(0x31A0, 0x31BF);
+ case unicode_block::CJK_Strokes: return unicode_range(0x31C0, 0x31EF);
+ case unicode_block::Katakana_Phonetic_Extensions: return unicode_range(0x31F0, 0x31FF);
+ case unicode_block::Enclosed_CJK_Letters_and_Months: return unicode_range(0x3200, 0x32FF);
+ case unicode_block::CJK_Compatibility: return unicode_range(0x3300, 0x33FF);
+ case unicode_block::CJK_Unified_Ideographs_Extension_A: return unicode_range(0x3400, 0x4DBF);
+ case unicode_block::Yijing_Hexagram_Symbols: return unicode_range(0x4DC0, 0x4DFF);
+ case unicode_block::CJK_Unified_Ideographs: return unicode_range(0x4E00, 0x9FFF);
+ case unicode_block::Yi_Syllables: return unicode_range(0xA000, 0xA48F);
+ case unicode_block::Yi_Radicals: return unicode_range(0xA490, 0xA4CF);
+ case unicode_block::Lisu: return unicode_range(0xA4D0, 0xA4FF);
+ case unicode_block::Vai: return unicode_range(0xA500, 0xA63F);
+ case unicode_block::Cyrillic_Extended_B: return unicode_range(0xA640, 0xA69F);
+ case unicode_block::Bamum: return unicode_range(0xA6A0, 0xA6FF);
+ case unicode_block::Modifier_Tone_Letters: return unicode_range(0xA700, 0xA71F);
+ case unicode_block::Latin_Extended_D: return unicode_range(0xA720, 0xA7FF);
+ case unicode_block::Syloti_Nagri: return unicode_range(0xA800, 0xA82F);
+ case unicode_block::Common_Indic_Number_Forms: return unicode_range(0xA830, 0xA83F);
+ case unicode_block::Phags_pa: return unicode_range(0xA840, 0xA87F);
+ case unicode_block::Saurashtra: return unicode_range(0xA880, 0xA8DF);
+ case unicode_block::Devanagari_Extended: return unicode_range(0xA8E0, 0xA8FF);
+ case unicode_block::Kayah_Li: return unicode_range(0xA900, 0xA92F);
+ case unicode_block::Rejang: return unicode_range(0xA930, 0xA95F);
+ case unicode_block::Hangul_Jamo_Extended_A: return unicode_range(0xA960, 0xA97F);
+ case unicode_block::Javanese: return unicode_range(0xA980, 0xA9DF);
+ case unicode_block::Cham: return unicode_range(0xAA00, 0xAA5F);
+ case unicode_block::Myanmar_Extended_A: return unicode_range(0xAA60, 0xAA7F);
+ case unicode_block::Tai_Viet: return unicode_range(0xAA80, 0xAADF);
+ case unicode_block::Meetei_Mayek_Extensions: return unicode_range(0xAAE0, 0xAAFF);
+ case unicode_block::Ethiopic_Extended_A: return unicode_range(0xAB00, 0xAB2F);
+ case unicode_block::Meetei_Mayek: return unicode_range(0xABC0, 0xABFF);
+ case unicode_block::Hangul_Syllables: return unicode_range(0xAC00, 0xD7AF);
+ case unicode_block::Hangul_Jamo_Extended_B: return unicode_range(0xD7B0, 0xD7FF);
+ case unicode_block::High_Surrogates: return unicode_range(0xD800, 0xDB7F);
+ case unicode_block::High_Private_Use_Surrogates: return unicode_range(0xDB80, 0xDBFF);
+ case unicode_block::Low_Surrogates: return unicode_range(0xDC00, 0xDFFF);
+ case unicode_block::Private_Use_Area: return unicode_range(0xE000, 0xF8FF);
+ case unicode_block::CJK_Compatibility_Ideographs: return unicode_range(0xF900, 0xFAFF);
+ case unicode_block::Alphabetic_Presentation_Forms: return unicode_range(0xFB00, 0xFB4F);
+ case unicode_block::Arabic_Presentation_Forms_A: return unicode_range(0xFB50, 0xFDFF);
+ case unicode_block::Variation_Selectors: return unicode_range(0xFE00, 0xFE0F);
+ case unicode_block::Vertical_Forms: return unicode_range(0xFE10, 0xFE1F);
+ case unicode_block::Combining_Half_Marks: return unicode_range(0xFE20, 0xFE2F);
+ case unicode_block::CJK_Compatibility_Forms: return unicode_range(0xFE30, 0xFE4F);
+ case unicode_block::Small_Form_Variants: return unicode_range(0xFE50, 0xFE6F);
+ case unicode_block::Arabic_Presentation_Forms_B: return unicode_range(0xFE70, 0xFEFF);
+ case unicode_block::Halfwidth_and_Fullwidth_Forms: return unicode_range(0xFF00, 0xFFEF);
+ case unicode_block::Specials: return unicode_range(0xFFF0, 0xFFFF);
+ case unicode_block::Linear_B_Syllabary: return unicode_range(0x10000, 0x1007F);
+ case unicode_block::Linear_B_Ideograms: return unicode_range(0x10080, 0x100FF);
+ case unicode_block::Aegean_Numbers: return unicode_range(0x10100, 0x1013F);
+ case unicode_block::Ancient_Greek_Numbers: return unicode_range(0x10140, 0x1018F);
+ case unicode_block::Ancient_Symbols: return unicode_range(0x10190, 0x101CF);
+ case unicode_block::Phaistos_Disc: return unicode_range(0x101D0, 0x101FF);
+ case unicode_block::Lycian: return unicode_range(0x10280, 0x1029F);
+ case unicode_block::Carian: return unicode_range(0x102A0, 0x102DF);
+ case unicode_block::Old_Italic: return unicode_range(0x10300, 0x1032F);
+ case unicode_block::Gothic: return unicode_range(0x10330, 0x1034F);
+ case unicode_block::Ugaritic: return unicode_range(0x10380, 0x1039F);
+ case unicode_block::Old_Persian: return unicode_range(0x103A0, 0x103DF);
+ case unicode_block::Deseret: return unicode_range(0x10400, 0x1044F);
+ case unicode_block::Shavian: return unicode_range(0x10450, 0x1047F);
+ case unicode_block::Osmanya: return unicode_range(0x10480, 0x104AF);
+ case unicode_block::Cypriot_Syllabary: return unicode_range(0x10800, 0x1083F);
+ case unicode_block::Imperial_Aramaic: return unicode_range(0x10840, 0x1085F);
+ case unicode_block::Phoenician: return unicode_range(0x10900, 0x1091F);
+ case unicode_block::Lydian: return unicode_range(0x10920, 0x1093F);
+ case unicode_block::Meroitic_Hieroglyphs: return unicode_range(0x10980, 0x1099F);
+ case unicode_block::Meroitic_Cursive: return unicode_range(0x109A0, 0x109FF);
+ case unicode_block::Kharoshthi: return unicode_range(0x10A00, 0x10A5F);
+ case unicode_block::Old_South_Arabian: return unicode_range(0x10A60, 0x10A7F);
+ case unicode_block::Avestan: return unicode_range(0x10B00, 0x10B3F);
+ case unicode_block::Inscriptional_Parthian: return unicode_range(0x10B40, 0x10B5F);
+ case unicode_block::Inscriptional_Pahlavi: return unicode_range(0x10B60, 0x10B7F);
+ case unicode_block::Old_Turkic: return unicode_range(0x10C00, 0x10C4F);
+ case unicode_block::Rumi_Numeral_Symbols: return unicode_range(0x10E60, 0x10E7F);
+ case unicode_block::Brahmi: return unicode_range(0x11000, 0x1107F);
+ case unicode_block::Kaithi: return unicode_range(0x11080, 0x110CF);
+ case unicode_block::Sora_Sompeng: return unicode_range(0x110D0, 0x110FF);
+ case unicode_block::Chakma: return unicode_range(0x11100, 0x1114F);
+ case unicode_block::Sharada: return unicode_range(0x11180, 0x111DF);
+ case unicode_block::Takri: return unicode_range(0x11680, 0x116CF);
+ case unicode_block::Cuneiform: return unicode_range(0x12000, 0x123FF);
+ case unicode_block::Cuneiform_Numbers_and_Punctuation: return unicode_range(0x12400, 0x1247F);
+ case unicode_block::Egyptian_Hieroglyphs: return unicode_range(0x13000, 0x1342F);
+ case unicode_block::Bamum_Supplement: return unicode_range(0x16800, 0x16A3F);
+ case unicode_block::Miao: return unicode_range(0x16F00, 0x16F9F);
+ case unicode_block::Kana_Supplement: return unicode_range(0x1B000, 0x1B0FF);
+ case unicode_block::Byzantine_Musical_Symbols: return unicode_range(0x1D000, 0x1D0FF);
+ case unicode_block::Musical_Symbols: return unicode_range(0x1D100, 0x1D1FF);
+ case unicode_block::Ancient_Greek_Musical_Notation: return unicode_range(0x1D200, 0x1D24F);
+ case unicode_block::Tai_Xuan_Jing_Symbols: return unicode_range(0x1D300, 0x1D35F);
+ case unicode_block::Counting_Rod_Numerals: return unicode_range(0x1D360, 0x1D37F);
+ case unicode_block::Mathematical_Alphanumeric_Symbols: return unicode_range(0x1D400, 0x1D7FF);
+ case unicode_block::Arabic_Mathematical_Alphabetic_Symbols: return unicode_range(0x1EE00, 0x1EEFF);
+ case unicode_block::Mahjong_Tiles: return unicode_range(0x1F000, 0x1F02F);
+ case unicode_block::Domino_Tiles: return unicode_range(0x1F030, 0x1F09F);
+ case unicode_block::Playing_Cards: return unicode_range(0x1F0A0, 0x1F0FF);
+ case unicode_block::Enclosed_Alphanumeric_Supplement: return unicode_range(0x1F100, 0x1F1FF);
+ case unicode_block::Enclosed_Ideographic_Supplement: return unicode_range(0x1F200, 0x1F2FF);
+ case unicode_block::Miscellaneous_Symbols_And_Pictographs: return unicode_range(0x1F300, 0x1F5FF);
+ case unicode_block::Emoticons: return unicode_range(0x1F600, 0x1F64F);
+ case unicode_block::Transport_And_Map_Symbols: return unicode_range(0x1F680, 0x1F6FF);
+ case unicode_block::Alchemical_Symbols: return unicode_range(0x1F700, 0x1F77F);
+ case unicode_block::CJK_Unified_Ideographs_Extension_B: return unicode_range(0x20000, 0x2A6DF);
+ case unicode_block::CJK_Unified_Ideographs_Extension_C: return unicode_range(0x2A700, 0x2B73F);
+ case unicode_block::CJK_Unified_Ideographs_Extension_D: return unicode_range(0x2B740, 0x2B81F);
+ case unicode_block::CJK_Compatibility_Ideographs_Supplement: return unicode_range(0x2F800, 0x2FA1F);
+ case unicode_block::Tags: return unicode_range(0xE0000, 0xE007F);
+ case unicode_block::Variation_Selectors_Supplement: return unicode_range(0xE0100, 0xE01EF);
+ case unicode_block::Supplementary_Private_Use_Area_A: return unicode_range(0xF0000, 0xFFFFF);
+ case unicode_block::Supplementary_Private_Use_Area_B: return unicode_range(0x100000, 0x10FFFF);
}
return unicode_range(0,0);
}
namespace caspar { namespace core { namespace text {
class texture_atlas;
-enum unicode_block;
+enum class unicode_block;
class texture_font
{
spl::shared_ptr<impl> impl_;
};
-enum unicode_block
+enum class unicode_block
{
Basic_Latin,
Latin_1_Supplement,
*monitor_subject_ << monitor::message("/transition/frame") % current_frame_ % info_.duration
<< monitor::message("/transition/type") % [&]() -> std::string
{
- switch(info_.type.value())
+ switch(info_.type)
{
case transition_type::mix: return "mix";
case transition_type::wipe: return "wipe";
#include "../../video_format.h"
-#include <common/enum_class.h>
#include <common/memory.h>
#include <common/tweener.h>
namespace caspar { namespace core {
-struct transition_type_def
+enum class transition_type
{
- enum type
- {
- cut,
- mix,
- push,
- slide,
- wipe,
- count
- };
+ cut,
+ mix,
+ push,
+ slide,
+ wipe,
+ count
};
-typedef enum_class<transition_type_def> transition_type;
-struct transition_direction_def
+enum class transition_direction
{
- enum type
- {
- from_left,
- from_right,
- count
- };
+ from_left,
+ from_right,
+ count
};
-typedef enum_class<transition_direction_def> transition_direction;
struct transition_info
{
, thumbnail_creator_(thumbnail_creator)
, monitor_(monitor_factory.create(
media_path,
- ALL,
+ filesystem_event::ALL,
true,
[this] (filesystem_event event, const boost::filesystem::wpath& file)
{
{
switch (event)
{
- case CREATED:
+ case filesystem_event::CREATED:
if (needs_to_be_generated(file))
generate_thumbnail(file);
break;
- case MODIFIED:
+ case filesystem_event::MODIFIED:
generate_thumbnail(file);
break;
- case REMOVED:
+ case filesystem_event::REMOVED:
auto relative_without_extension = get_relative_without_extension(file, media_path_);
boost::filesystem::remove(thumbnails_path_ / (relative_without_extension + L".png"));
: format(video_format::invalid)
, field_mode(field_mode::empty)
{
- *this = format_descs.at(format.value());
+ *this = format_descs.at(static_cast<int>(format));
}
video_format_desc::video_format_desc(const std::wstring& name)
#pragma once
-#include <common/enum_class.h>
-
#include <vector>
#include <string>
#include <cstddef>
+#include <common/enum_class.h>
+
namespace caspar { namespace core {
-struct video_format_def
+enum class video_format
{
- enum type
- {
- pal,
- ntsc,
- x576p2500,
- x720p2500,
- x720p5000,
- x720p2398,
- x720p2400,
- x720p2997,
- x720p5994,
- x720p3000,
- x720p6000,
- x1080p2398,
- x1080p2400,
- x1080i5000,
- x1080i5994,
- x1080i6000,
- x1080p2500,
- x1080p2997,
- x1080p3000,
- x1080p5000,
- x1080p5994,
- x1080p6000,
- x2k2398,
- x2k2400,
- x2k2500,
- x4k2398,
- x4k2400,
- x4k2500,
- x4k2997,
- x4k3000,
- invalid,
- count
- };
+ pal,
+ ntsc,
+ x576p2500,
+ x720p2500,
+ x720p5000,
+ x720p2398,
+ x720p2400,
+ x720p2997,
+ x720p5994,
+ x720p3000,
+ x720p6000,
+ x1080p2398,
+ x1080p2400,
+ x1080i5000,
+ x1080i5994,
+ x1080i6000,
+ x1080p2500,
+ x1080p2997,
+ x1080p3000,
+ x1080p5000,
+ x1080p5994,
+ x1080p6000,
+ x2k2398,
+ x2k2400,
+ x2k2500,
+ x4k2398,
+ x4k2400,
+ x4k2500,
+ x4k2997,
+ x4k3000,
+ invalid,
+ count
};
-typedef enum_class<video_format_def> video_format;
-struct field_mode_def
+enum class field_mode
{
- enum type
- {
- empty = 0,
- lower = 1,
- upper = 2,
- progressive = 3, // NOTE: progressive == lower | upper;
- };
- static_assert((lower | upper) == progressive, "");
+ empty = 0,
+ lower = 1,
+ upper = 2,
+ progressive = 3 // NOTE: progressive == lower | upper;
};
-typedef enum_class<field_mode_def> field_mode;
+ENUM_ENABLE_BITWISE(field_mode);
+//static_assert((field_mode::lower | field_mode::upper) == field_mode::progressive, "");
struct video_format_desc final
{
EVideoMode vid_fmt_from_video_format(const core::video_format& fmt)
{
- switch(fmt.value())
+ switch(fmt)
{
case core::video_format::pal: return VID_FMT_PAL;
case core::video_format::ntsc: return VID_FMT_NTSC;
struct configuration
{
- enum keyer_t
+ enum class keyer_t
{
internal_keyer,
external_keyer,
default_keyer
};
- enum latency_t
+ enum class latency_t
{
low_latency,
normal_latency,
configuration()
: device_index(1)
, embedded_audio(true)
- , keyer(default_keyer)
- , latency(default_latency)
+ , keyer(keyer_t::default_keyer)
+ , latency(latency_t::default_latency)
, key_only(false)
, base_buffer_depth(3)
{
int buffer_depth() const
{
- return base_buffer_depth + (latency == low_latency ? 0 : 1) + (embedded_audio ? 1 : 0);
+ return base_buffer_depth + (latency == latency_t::low_latency ? 0 : 1) + (embedded_audio ? 1 : 0);
}
};
void set_latency(configuration::latency_t latency)
{
- if(latency == configuration::low_latency)
+ if(latency == configuration::latency_t::low_latency)
{
configuration_->SetFlag(bmdDeckLinkConfigLowLatencyVideoOutput, true);
CASPAR_LOG(info) << print() << L" Enabled low-latency mode.";
}
- else if(latency == configuration::normal_latency)
+ else if(latency == configuration::latency_t::normal_latency)
{
configuration_->SetFlag(bmdDeckLinkConfigLowLatencyVideoOutput, false);
CASPAR_LOG(info) << print() << L" Disabled low-latency mode.";
void set_keyer(configuration::keyer_t keyer)
{
- if(keyer == configuration::internal_keyer)
+ if(keyer == configuration::keyer_t::internal_keyer)
{
BOOL value = true;
if(SUCCEEDED(attributes_->GetFlag(BMDDeckLinkSupportsInternalKeying, &value)) && !value)
else
CASPAR_LOG(info) << print() << L" Enabled internal keyer.";
}
- else if(keyer == configuration::external_keyer)
+ else if(keyer == configuration::keyer_t::external_keyer)
{
BOOL value = true;
if(SUCCEEDED(attributes_->GetFlag(BMDDeckLinkSupportsExternalKeying, &value)) && !value)
info.add(L"type", L"decklink");
info.add(L"key-only", config_.key_only);
info.add(L"device", config_.device_index);
- info.add(L"low-latency", config_.low_latency);
+ info.add(L"low-latency", config_.latency == configuration::latency_t::low_latency);
info.add(L"embedded-audio", config_.embedded_audio);
- info.add(L"low-latency", config_.low_latency);
//info.add(L"internal-key", config_.internal_key);
return info;
}
config.device_index = boost::lexical_cast<int>(params[1]);
if(std::find(params.begin(), params.end(), L"INTERNAL_KEY") != params.end())
- config.keyer = configuration::internal_keyer;
+ config.keyer = configuration::keyer_t::internal_keyer;
else if(std::find(params.begin(), params.end(), L"EXTERNAL_KEY") != params.end())
- config.keyer = configuration::external_keyer;
+ config.keyer = configuration::keyer_t::external_keyer;
else
- config.keyer = configuration::default_keyer;
+ config.keyer = configuration::keyer_t::default_keyer;
if(std::find(params.begin(), params.end(), L"LOW_LATENCY") != params.end())
- config.latency = configuration::low_latency;
+ config.latency = configuration::latency_t::low_latency;
config.embedded_audio = std::find(params.begin(), params.end(), L"EMBEDDED_AUDIO") != params.end();
config.key_only = std::find(params.begin(), params.end(), L"KEY_ONLY") != params.end();
auto keyer = ptree.get(L"keyer", L"default");
if(keyer == L"external")
- config.keyer = configuration::external_keyer;
+ config.keyer = configuration::keyer_t::external_keyer;
else if(keyer == L"internal")
- config.keyer = configuration::internal_keyer;
+ config.keyer = configuration::keyer_t::internal_keyer;
auto latency = ptree.get(L"latency", L"normal");
if(latency == L"low")
- config.latency = configuration::low_latency;
+ config.latency = configuration::latency_t::low_latency;
else if(latency == L"normal")
- config.latency = configuration::normal_latency;
+ config.latency = configuration::latency_t::normal_latency;
config.key_only = ptree.get(L"key-only", config.key_only);
config.device_index = ptree.get(L"device", config.device_index);
static BMDDisplayMode get_decklink_video_format(core::video_format fmt)
{
- switch(fmt.value())
+ switch(fmt)
{
case core::video_format::pal: return bmdModePAL;
case core::video_format::ntsc: return bmdModeNTSC;
namespace caspar { namespace ffmpeg {
-enum display_mode
+enum class display_mode
{
simple,
duplicate,
{
switch(value)
{
- case simple: return o << L"simple";
- case duplicate: return o << L"duplicate";
- case half: return o << L"half";
- case interlace: return o << L"interlace";
- case deinterlace_bob: return o << L"deinterlace_bob";
- case deinterlace_bob_reinterlace: return o << L"deinterlace_bob_reinterlace";
- case deinterlace: return o << L"deinterlace";
- default: return o << L"invalid";
+ case display_mode::simple: return o << L"simple";
+ case display_mode::duplicate: return o << L"duplicate";
+ case display_mode::half: return o << L"half";
+ case display_mode::interlace: return o << L"interlace";
+ case display_mode::deinterlace_bob: return o << L"deinterlace_bob";
+ case display_mode::deinterlace_bob_reinterlace: return o << L"deinterlace_bob_reinterlace";
+ case display_mode::deinterlace: return o << L"deinterlace";
+ default: return o << L"invalid";
}
}
core::pixel_format_desc desc = get_pixel_format(pix_fmt);
- switch(desc.format.value())
+ switch(desc.format)
{
case core::pixel_format::gray:
case core::pixel_format::luma:
avcodec_get_frame_defaults(av_frame.get());
auto planes = pix_desc.planes;
- auto format = pix_desc.format.value();
+ auto format = pix_desc.format;
av_frame->width = planes[0].width;
av_frame->height = planes[0].height;
double fps = static_cast<double>(time_base.den) / static_cast<double>(time_base.num);
double closest_fps = 0.0;
- for(int n = 0; n < core::video_format::count; ++n)
+ for(int n = 0; n < static_cast<int>(core::video_format::count); ++n)
{
auto format = core::video_format_desc(core::video_format(n));
stream.read_unicode_string();
stream.read_id_string();
unsigned long element_count = stream.read_long();
- for(int element_index = 0; element_index < element_count; ++element_index)
+ for (unsigned long element_index = 0; element_index < element_count; ++element_index)
{
std::wstring key = stream.read_id_string();
read_value(key, stream);
}
}
- catch(std::exception& ex)
+ catch(std::exception&)
{
result = false;
}
case 'VlLs':
{
context::scoped_holder list(key, context_);
- unsigned long count = stream.read_long();
- for(int i = 0; i < count; ++i)
+ auto count = stream.read_long();
+ for(unsigned long i = 0; i < count; ++i)
{
read_value(L"li", stream);
}
namespace caspar { namespace psd {
-psd_document::psd_document() : channels_(0), width_(0), height_(0), depth_(0), color_mode_(InvalidColorMode)
+psd_document::psd_document() : channels_(0), width_(0), height_(0), depth_(0), color_mode_(color_mode::InvalidColorMode)
{
}
read_image_resources();
read_layers();
}
- catch(std::exception& ex)
+ catch(std::exception&)
{
result = false;
}
void psd_document::read_header()
{
- unsigned long signature = input_.read_long();
- unsigned short version = input_.read_short();
+ auto signature = input_.read_long();
+ auto version = input_.read_short();
if(!(signature == '8BPS' && version == 1))
throw PSDFileFormatException();
void psd_document::read_color_mode()
{
- unsigned long length = input_.read_long();
+ auto length = input_.read_long();
input_.discard_bytes(length);
}
if(section_length > 0)
{
- unsigned long end_of_section = input_.current_position() + section_length;
+ std::streamoff end_of_section = input_.current_position() + section_length;
try
{
while(input_.current_position() < end_of_section)
{
- unsigned long signature = input_.read_long();
+ auto signature = input_.read_long();
if(signature != '8BIM')
throw PSDFileFormatException();
- unsigned short resource_id = input_.read_short();
+ auto resource_id = input_.read_short();
std::wstring name = input_.read_pascal_string(2);
- unsigned long resource_length = input_.read_long();
- unsigned long end_of_chunk = input_.current_position() + resource_length;
+ auto resource_length = input_.read_long();
+ auto end_of_chunk = input_.current_position() + resource_length;
try
{
break;
case 1075: //timeline information
{
- int desc_ver = input_.read_long(); //descriptor version, should be 16
+ input_.read_long(); //descriptor version, should be 16
descriptor timeline_descriptor;
if(!timeline_descriptor.populate(input_))
throw PSDFileFormatException();
}
}
}
- catch(PSDFileFormatException& ex)
+ catch(PSDFileFormatException&)
{
//if an error occurs, just skip this section
input_.set_position(end_of_section);
void psd_document::read_layers()
{
//"Layer And Mask information"
- unsigned long total_length = input_.read_long(); //length of "Layer and Mask information"
- unsigned long end_of_layers = input_.current_position() + total_length;
+ auto total_length = input_.read_long(); //length of "Layer and Mask information"
+ auto end_of_layers = input_.current_position() + total_length;
try
{
//"Layer info section"
{
- unsigned long layer_info_length = input_.read_long(); //length of "Layer info" section
- unsigned long end_of_layers_info = input_.current_position() + layer_info_length;
+ auto layer_info_length = input_.read_long(); //length of "Layer info" section
+ auto end_of_layers_info = input_.current_position() + layer_info_length;
- short layers_count = abs(static_cast<short>(input_.read_short()));
+ auto layers_count = std::abs(static_cast<short>(input_.read_short()));
//std::clog << "Expecting " << layers_count << " layers" << std::endl;
- for(short layer_index = 0; layer_index < layers_count; ++layer_index)
+ for(int layer_index = 0; layer_index < layers_count; ++layer_index)
{
if(layer_index == layers_.size())
layers_.push_back(std::make_shared<layer>());
//std::clog << "Added layer: " << std::string(layers_[layerIndex]->name().begin(), layers_[layerIndex]->name().end()) << std::endl;
}
- unsigned long channel_data_start = input_.current_position(); //TODO: remove. For debug purposes only
-
auto end = layers_.end();
for(auto layer_it = layers_.begin(); layer_it != end; ++layer_it)
{
input_.set_position(end_of_layers_info);
}
- unsigned long cp = input_.current_position();
//global layer mask info
- unsigned long global_layer_mask_length = input_.read_long();
+ auto global_layer_mask_length = input_.read_long();
input_.discard_bytes(global_layer_mask_length);
}
- catch(std::exception& ex)
+ catch(std::exception&)
{
input_.set_position(end_of_layers);
}
{
friend class layer;
- impl() : blend_mode_(InvalidBlendMode), link_group_id_(0), opacity_(255), sheet_color_(0), baseClipping_(false), flags_(0), protection_flags_(0), masks_count_(0), text_scale_(1.0f)
+ impl() : blend_mode_(blend_mode::InvalidBlendMode), link_group_id_(0), opacity_(255), sheet_color_(0), baseClipping_(false), flags_(0), protection_flags_(0), masks_count_(0), text_scale_(1.0f)
{}
private:
stream.discard_bytes(1); //padding
unsigned long extras_size = stream.read_long();
- long position = stream.current_position();
+ auto position = stream.current_position();
mask_.read_mask_data(stream);
read_blending_ranges(stream);
name_ = stream.read_pascal_string(4);
//Aditional Layer Information
- long end_of_layer_info = position + extras_size;
+ auto end_of_layer_info = position + extras_size;
try
{
while(stream.current_position() < end_of_layer_info)
void read_chunk(BEFileInputStream& stream, const psd_document& doc, bool isMetadata = false)
{
- unsigned long signature = stream.read_long();
+ auto signature = stream.read_long();
if(signature != '8BIM' && signature != '8B64')
throw PSDFileFormatException();
- unsigned long key = stream.read_long();
+ auto key = stream.read_long();
if(isMetadata) stream.read_long();
- unsigned long length = stream.read_long();
- unsigned long end_of_chunk = stream.current_position() + length;
+ auto length = stream.read_long();
+ auto end_of_chunk = stream.current_position() + length;
try
{
{
typedef std::pair<unsigned long, unsigned long> path_point;
- unsigned long version = stream.read_long();
- unsigned long flags = stream.read_long();
+ stream.read_long(); // version
+ stream.read_long(); // flags
int path_records = (length-8) / 26;
- long position = stream.current_position();
+ auto position = stream.current_position();
std::vector<path_point> knots;
for(int i=1; i <= path_records; ++i)
{
- unsigned short selector = stream.read_short();
+ auto selector = stream.read_short();
if(selector == 2) //we only concern ourselves with closed paths
{
- unsigned long p_y = stream.read_long();
- unsigned long p_x = stream.read_long();
+ auto p_y = stream.read_long();
+ auto p_x = stream.read_long();
path_point cp_prev(p_x, p_y);
- unsigned long a_y = stream.read_long();
- unsigned long a_x = stream.read_long();
+ auto a_y = stream.read_long();
+ auto a_x = stream.read_long();
path_point anchor(a_x, a_y);
- unsigned long n_y = stream.read_long();
- unsigned long n_x = stream.read_long();
+ auto n_y = stream.read_long();
+ auto n_x = stream.read_long();
path_point cp_next(n_x, n_y);
if(anchor == cp_prev && anchor == cp_next)
void read_metadata(BEFileInputStream& stream, const psd_document& doc)
{
- unsigned long count = stream.read_long();
+ auto count = stream.read_long();
for(unsigned long index = 0; index < count; ++index)
read_chunk(stream, doc, true);
}
stream.read_short(); //should be 1
//transformation info
- double xx = stream.read_double();
- double xy = stream.read_double();
- double yx = stream.read_double();
- double yy = stream.read_double();
- double tx = stream.read_double();
- double ty = stream.read_double();
+ auto xx = stream.read_double();
+ auto xy = stream.read_double();
+ auto yx = stream.read_double();
+ auto yy = stream.read_double();
+ stream.read_double(); // tx
+ stream.read_double(); // ty
if(xx != yy || (xy != 0 && yx != 0))
throw PSDFileFormatException("Rotation and non-uniform scaling of dynamic textfields is not supported yet");
throw PSDFileFormatException("Failed to read text warp-data");
else
{
- double w_top = stream.read_double();
- double w_left = stream.read_double();
- double w_right = stream.read_double();
- double w_bottom = stream.read_double();
+ stream.read_double(); // w_top
+ stream.read_double(); // w_left
+ stream.read_double(); // w_right
+ stream.read_double(); // w_bottom
}
}
//TODO: implement
void read_blending_ranges(BEFileInputStream& stream)
{
- unsigned long length = stream.read_long();
+ auto length = stream.read_long();
stream.discard_bytes(length);
}
bool has_channel(channel_type type)
{
- return std::find_if(channels_.begin(), channels_.end(), [=](const channel& c) { return c.id == type; }) != channels_.end();
+ return std::find_if(channels_.begin(), channels_.end(), [=](const channel& c) { return c.id == static_cast<int>(type); }) != channels_.end();
}
void read_channel_data(BEFileInputStream& stream)
image8bit_ptr bitmap;
image8bit_ptr mask;
- bool has_transparency = has_channel(psd::transparency);
+ bool has_transparency = has_channel(channel_type::transparency);
rect<long> clip_rect;
if(!bitmap_rect_.empty())
{
psd::rect<long> src_rect;
image8bit_ptr target;
- unsigned char offset;
+ unsigned char offset = 0;
bool discard_channel = false;
//determine target bitmap and offset
else if((*it).id >= -1) //BGRA-data
{
target = bitmap;
- offset = ((*it).id >= 0) ? 2 - (*it).id : 3;
+ offset = static_cast<unsigned char>(((*it).id >= 0) ? 2 - (*it).id : 3);
src_rect = bitmap_rect_;
}
else if(mask) //mask
if(!target || src_rect.empty())
discard_channel = true;
- unsigned long end_of_data = stream.current_position() + (*it).data_length;
+ auto end_of_data = stream.current_position() + (*it).data_length;
if(!discard_channel)
{
- unsigned short encoding = stream.read_short();
+ auto encoding = stream.read_short();
if(target)
{
if(encoding == 0)
if(total_length != data_length)
throw PSDFileFormatException();
- unsigned char* data = target->data();
+ auto data = target->data();
- unsigned char stride = target->channel_count();
+ auto stride = target->channel_count();
if(stride == 1)
stream.read(reinterpret_cast<char*>(data + offset), total_length);
else
void read_rle_image_data(BEFileInputStream& stream, const rect<long>&src_rect, const rect<long>&clip_rect, image8bit_ptr target, unsigned char offset)
{
- unsigned long width = src_rect.size.width;
- unsigned long height = src_rect.size.height;
- unsigned char stride = target->channel_count();
+ auto width = src_rect.size.width;
+ auto height = src_rect.size.height;
+ auto stride = target->channel_count();
int offset_x = clip_rect.location.x - src_rect.location.x;
int offset_y = clip_rect.location.y - src_rect.location.y;
std::vector<unsigned short> scanline_lengths;
scanline_lengths.reserve(height);
- for(unsigned long scanlineIndex=0; scanlineIndex < height; ++scanlineIndex)
+ for (long scanlineIndex = 0; scanlineIndex < height; ++scanlineIndex)
scanline_lengths.push_back(stream.read_short());
- unsigned char *target_data = target->data();
+ auto target_data = target->data();
std::vector<unsigned char> line(width);
if(scanlineIndex >= target->height()+offset_y)
break;
- unsigned long colIndex = 0;
+ long colIndex = 0;
do
{
blend_mode int_to_blend_mode(unsigned long x)
{
- blend_mode retVal = InvalidBlendMode;
- switch(x)
+ blend_mode mode = static_cast<blend_mode>(x);
+
+ switch (mode)
{
- case Normal: retVal = Normal; break;
- case Darken: retVal = Darken; break;
- case Lighten: retVal = Lighten; break;
- case Hue: retVal = Hue; break;
- case Saturation: retVal = Saturation; break;
- case Color: retVal = Color; break;
- case Luminosity: retVal = Luminosity; break;
- case Multiply: retVal = Multiply; break;
- case Screen: retVal = Screen; break;
- case Dissolve: retVal = Dissolve; break;
- case Overlay: retVal = Overlay; break;
- case HardLight: retVal = HardLight; break;
- case SoftLight: retVal = SoftLight; break;
- case Difference: retVal = Difference; break;
- case Exclusion: retVal = Exclusion; break;
- case ColorDodge: retVal = ColorDodge; break;
- case ColorBurn: retVal = ColorBurn; break;
+ case blend_mode::Normal:
+ case blend_mode::Darken:
+ case blend_mode::Lighten:
+ case blend_mode::Hue:
+ case blend_mode::Saturation:
+ case blend_mode::Color:
+ case blend_mode::Luminosity:
+ case blend_mode::Multiply:
+ case blend_mode::Screen:
+ case blend_mode::Dissolve:
+ case blend_mode::Overlay:
+ case blend_mode::HardLight:
+ case blend_mode::SoftLight:
+ case blend_mode::Difference:
+ case blend_mode::Exclusion:
+ case blend_mode::ColorDodge:
+ case blend_mode::ColorBurn:
+ return mode;
+ default:
+ return blend_mode::InvalidBlendMode;
}
-
- return retVal;
}
std::wstring blend_mode_to_string(blend_mode b)
{
- std::wstring retVal = L"Invalid";
switch(b)
{
- case Normal: retVal = L"Normal"; break;
- case Darken: retVal = L"Darken"; break;
- case Lighten: retVal = L"Lighten"; break;
- case Hue: retVal = L"Hue"; break;
- case Saturation: retVal = L"Saturation"; break;
- case Color: retVal = L"Color"; break;
- case Luminosity: retVal = L"Luminosity"; break;
- case Multiply: retVal = L"Multiply"; break;
- case Screen: retVal = L"Screen"; break;
- case Dissolve: retVal = L"Dissolve"; break;
- case Overlay: retVal = L"Overlay"; break;
- case HardLight: retVal = L"HardLight"; break;
- case SoftLight: retVal = L"SoftLight"; break;
- case Difference: retVal = L"Difference"; break;
- case Exclusion: retVal = L"Exclusion"; break;
- case ColorDodge: retVal = L"ColorDodge"; break;
- case ColorBurn: retVal = L"ColorBurn"; break;
+ case blend_mode::Normal: return L"Normal";
+ case blend_mode::Darken: return L"Darken";
+ case blend_mode::Lighten: return L"Lighten";
+ case blend_mode::Hue: return L"Hue";
+ case blend_mode::Saturation: return L"Saturation";
+ case blend_mode::Color: return L"Color";
+ case blend_mode::Luminosity: return L"Luminosity";
+ case blend_mode::Multiply: return L"Multiply";
+ case blend_mode::Screen: return L"Screen";
+ case blend_mode::Dissolve: return L"Dissolve";
+ case blend_mode::Overlay: return L"Overlay";
+ case blend_mode::HardLight: return L"HardLight";
+ case blend_mode::SoftLight: return L"SoftLight";
+ case blend_mode::Difference: return L"Difference";
+ case blend_mode::Exclusion: return L"Exclusion";
+ case blend_mode::ColorDodge: return L"ColorDodge";
+ case blend_mode::ColorBurn: return L"ColorBurn";
+ default: return L"Invalid";
}
-
- return retVal;
}
color_mode int_to_color_mode(unsigned short x)
{
- color_mode retVal = InvalidColorMode;
- switch(x)
+ color_mode mode = static_cast<color_mode>(x);
+
+ switch(mode)
{
- case Bitmap: retVal = Bitmap; break;
- case Grayscale: retVal = Grayscale; break;
- case Indexed: retVal = Indexed; break;
- case RGB: retVal = RGB; break;
- case CMYK: retVal = CMYK; break;
- case Multichannel: retVal = Multichannel; break;
- case Duotone: retVal = Duotone; break;
- case Lab: retVal = Lab; break;
+ case color_mode::Bitmap:
+ case color_mode::Grayscale:
+ case color_mode::Indexed:
+ case color_mode::RGB:
+ case color_mode::CMYK:
+ case color_mode::Multichannel:
+ case color_mode::Duotone:
+ case color_mode::Lab:
+ return mode;
+ default:
+ return color_mode::InvalidColorMode;
};
-
- return retVal;
}
+
std::wstring color_mode_to_string(color_mode c)
{
- std::wstring retVal = L"Invalid";
switch(c)
{
- case Bitmap: retVal = L"Bitmap"; break;
- case Grayscale: retVal = L"Grayscale"; break;
- case Indexed: retVal = L"Indexed"; break;
- case RGB: retVal = L"RGB"; break;
- case CMYK: retVal = L"CMYK"; break;
- case Multichannel: retVal = L"Multichannel"; break;
- case Duotone: retVal = L"Duotone"; break;
- case Lab: retVal = L"Lab"; break;
+ case color_mode::Bitmap: return L"Bitmap";
+ case color_mode::Grayscale: return L"Grayscale";
+ case color_mode::Indexed: return L"Indexed";
+ case color_mode::RGB: return L"RGB";
+ case color_mode::CMYK: return L"CMYK";
+ case color_mode::Multichannel: return L"Multichannel";
+ case color_mode::Duotone: return L"Duotone";
+ case color_mode::Lab: return L"Lab";
+ default: return L"Invalid";
};
-
- return retVal;
}
} //namespace psd
}
};
-enum channel_type
+enum class channel_type
{
total_user_mask = -3,
user_mask = -2,
color_blue = 2
};
-enum blend_mode
+enum class blend_mode
{
InvalidBlendMode = -1,
Normal = 'norm',
blend_mode int_to_blend_mode(unsigned long x);
std::wstring blend_mode_to_string(blend_mode b);
-enum color_mode
+enum class color_mode
{
InvalidColorMode = -1,
Bitmap = 0,
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>SFML_STATIC;BOOST_THREAD_VERSION=4;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>Async</ExceptionHandling>
<FloatingPointModel>Fast</FloatingPointModel>
+ <TreatWarningAsError>true</TreatWarningAsError>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ForcedIncludeFiles>common/compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<OmitFramePointers>true</OmitFramePointers>
<ExceptionHandling>Async</ExceptionHandling>
<FloatingPointModel>Fast</FloatingPointModel>
+ <TreatWarningAsError>true</TreatWarningAsError>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ForcedIncludeFiles>common/compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
return out;
}
-unsigned short SWAP16(unsigned short inVal)
-{
- return caspar::swap_byte_order(inVal);
-}
-
-unsigned long SWAP32(unsigned long inVal)
-{
- return caspar::swap_byte_order(inVal);
-}
-
unsigned short BEFileInputStream::read_short()
{
unsigned short out;
read((char*)&out, 2);
- return SWAP16(out);
+ return caspar::swap_byte_order(out);
}
unsigned long BEFileInputStream::read_long()
unsigned long in;
read((char*)&in, 4);
- return SWAP32(in);
+ return caspar::swap_byte_order(in);
}
double BEFileInputStream::read_double()
{
return *reinterpret_cast<double*>(data);
}
-void BEFileInputStream::read(char* buf, unsigned long length)
+void BEFileInputStream::read(char* buf, std::streamsize length)
{
if(length > 0)
{
if(ifs_.eof())
throw UnexpectedEOFException();
- ifs_.read(buf, (std::streamsize)length);
+ ifs_.read(buf, length);
- if(ifs_.gcount() < (std::streamsize)length)
+ if(ifs_.gcount() < length)
throw UnexpectedEOFException();
}
}
-long BEFileInputStream::current_position()
+std::streamoff BEFileInputStream::current_position()
{
return ifs_.tellg();
}
-void BEFileInputStream::set_position(unsigned long offset)
+void BEFileInputStream::set_position(std::streamoff offset)
{
- ifs_.seekg(static_cast<std::streamsize>(offset), std::ios_base::beg);
+ ifs_.seekg(offset, std::ios_base::beg);
}
-void BEFileInputStream::discard_bytes(unsigned long length)
+void BEFileInputStream::discard_bytes(std::streamoff length)
{
- ifs_.seekg(static_cast<std::streamsize>(length), std::ios_base::cur);
+ ifs_.seekg(length, std::ios_base::cur);
}
void BEFileInputStream::discard_to_next_word()
{
result.reserve(length);
//can be optimized. Reads and swaps byte-order, one char at the time
- for(int i=0;i<length; ++i)
+ for (unsigned long i = 0; i < length; ++i)
result.append(1, static_cast<wchar_t>(read_short()));
}
{
result.reserve(length);
- for(int i=0;i<length;++i)
+ for (unsigned long i = 0; i < length; ++i)
result.append(1, read_byte());
}
else
{
result.reserve(4);
- for(int i=0;i<4;++i)
+ for(int i = 0; i < 4; ++i)
result.append(1, read_byte());
}
void Open(const std::wstring& filename);
- void read(char*, unsigned long);
+ void read(char*, std::streamsize);
unsigned char read_byte();
unsigned short read_short();
unsigned long read_long();
std::wstring read_id_string();
double read_double();
- void discard_bytes(unsigned long);
+ void discard_bytes(std::streamoff);
void discard_to_next_word();
void discard_to_next_dword();
- long current_position();
- void set_position(unsigned long);
+ std::streamoff current_position();
+ void set_position(std::streamoff);
void close();
private:
class StreamPositionBackup
{
public:
- StreamPositionBackup(BEFileInputStream* pStream, unsigned long newPos) : pStream_(pStream)
+ StreamPositionBackup(BEFileInputStream* pStream, std::streamoff newPos) : pStream_(pStream)
{
oldPosition_ = pStream->current_position();
pStream_->set_position(newPos);
pStream_->set_position(oldPosition_);
}
private:
- unsigned long oldPosition_;
+ std::streamoff oldPosition_;
BEFileInputStream* pStream_;
};
if(result)
tree.swap(g.context.root);
}
- catch(std::exception& ex)
+ catch(std::exception&)
{}
return result;
namespace caspar { namespace screen {
-enum stretch
+enum class stretch
{
none,
uniform,
struct configuration
{
- enum aspect_ratio
+ enum class aspect_ratio
{
aspect_4_3 = 0,
aspect_16_9,
configuration()
: name(L"ogl")
, screen_index(0)
- , stretch(fill)
+ , stretch(stretch::fill)
, windowed(true)
, auto_deinterlace(true)
, key_only(false)
- , aspect(aspect_invalid)
+ , aspect(aspect_ratio::aspect_invalid)
, vsync(true)
, interactive(true)
{
format_desc.field_mode == core::field_mode::progressive || !config.auto_deinterlace ? "" : "YADIF=1:-1");
}())
{
- if(format_desc_.format == core::video_format::ntsc && config_.aspect == configuration::aspect_4_3)
+ if (format_desc_.format == core::video_format::ntsc && config_.aspect == configuration::aspect_ratio::aspect_4_3)
{
// Use default values which are 4:3.
}
else
{
- if(config_.aspect == configuration::aspect_16_9)
+ if (config_.aspect == configuration::aspect_ratio::aspect_16_9)
square_width_ = (format_desc.height*16)/9;
- else if(config_.aspect == configuration::aspect_4_3)
+ else if (config_.aspect == configuration::aspect_ratio::aspect_4_3)
square_width_ = (format_desc.height*4)/3;
}
GL(glViewport(0, 0, screen_width_, screen_height_));
std::pair<float, float> target_ratio = None();
- if(config_.stretch == fill)
+ if (config_.stretch == stretch::fill)
target_ratio = Fill();
- else if(config_.stretch == uniform)
+ else if (config_.stretch == stretch::uniform)
target_ratio = Uniform();
- else if(config_.stretch == uniform_to_fill)
+ else if (config_.stretch == stretch::uniform_to_fill)
target_ratio = UniformToFill();
width_ = target_ratio.first;
auto aspect_str = ptree.get(L"aspect-ratio", L"default");
if(aspect_str == L"16:9")
- config.aspect = configuration::aspect_16_9;
+ config.aspect = configuration::aspect_ratio::aspect_16_9;
else if(aspect_str == L"4:3")
- config.aspect = configuration::aspect_4_3;
+ config.aspect = configuration::aspect_ratio::aspect_4_3;
return spl::make_shared<screen_consumer_proxy>(config, sink);
}
~impl() {}
- enum parser_state {
+ enum class parser_state {
New = 0,
GetSwitch,
GetCommand,
GetParameters
};
- enum error_state {
+ enum class error_state {
no_error = 0,
command_error,
channel_error,
struct command_interpreter_result
{
- command_interpreter_result() : error(no_error) {}
+ command_interpreter_result() : error(error_state::no_error) {}
std::shared_ptr<caspar::IO::lock_container> lock;
std::wstring command_name;
if(interpret_command_string(message, result, client))
{
if(result.lock && !result.lock->check_access(client))
- result.error = access_error;
+ result.error = error_state::access_error;
else
result.queue->AddCommand(result.command);
}
- if(result.error != no_error)
+ if (result.error != error_state::no_error)
{
std::wstringstream answer;
boost::to_upper(result.command_name);
switch(result.error)
{
- case command_error:
+ case error_state::command_error:
answer << L"400 ERROR\r\n" << message << "\r\n";
break;
- case channel_error:
+ case error_state::channel_error:
answer << L"401 " << result.command_name << " ERROR\r\n";
break;
- case parameters_error:
+ case error_state::parameters_error:
answer << L"402 " << result.command_name << " ERROR\r\n";
break;
- case access_error:
+ case error_state::access_error:
answer << L"503 " << result.command_name << " FAILED\r\n";
break;
default:
try
{
std::vector<std::wstring> tokens;
- parser_state state = New;
+ parser_state state = parser_state::New;
tokenize(message, &tokens);
//parse the message one token at the time
auto end = tokens.end();
auto it = tokens.begin();
- while(it != end && result.error == no_error)
+ while (it != end && result.error == error_state::no_error)
{
switch(state)
{
- case New:
+ case parser_state::New:
if((*it)[0] == TEXT('/'))
- state = GetSwitch;
+ state = parser_state::GetSwitch;
else
- state = GetCommand;
+ state = parser_state::GetCommand;
break;
- case GetSwitch:
+ case parser_state::GetSwitch:
//command_switch = (*it); //we dont care for the switch anymore
- state = GetCommand;
+ state = parser_state::GetCommand;
++it;
break;
- case GetCommand:
+ case parser_state::GetCommand:
{
result.command_name = (*it);
result.command = create_command(result.command_name, client);
if(result.command) //the command doesn't need a channel
{
result.queue = commandQueues_[0];
- state = GetParameters;
+ state = parser_state::GetParameters;
}
else
{
if(it == end)
{
if(create_channel_command(result.command_name, client, channels_.at(0), 0, 0)) //check if there is a command like this
- result.error = channel_error;
+ result.error = error_state::channel_error;
else
- result.error = command_error;
+ result.error = error_state::command_error;
break;
}
}
catch(...)
{
- result.error = channel_error;
+ result.error = error_state::channel_error;
break;
}
}
}
else
{
- result.error = command_error;
+ result.error = error_state::command_error;
break;
}
}
else
{
- result.error = channel_error;
+ result.error = error_state::channel_error;
break;
}
}
- state = GetParameters;
+ state = parser_state::GetParameters;
++it;
}
break;
- case GetParameters:
+ case parser_state::GetParameters:
{
int parameterCount=0;
while(it != end)
}
}
- if(result.command && result.error == no_error && result.command->parameters().size() < result.command->minimum_parameters()) {
- result.error = parameters_error;
+ if(result.command && result.error == error_state::no_error && result.command->parameters().size() < result.command->minimum_parameters()) {
+ result.error = error_state::parameters_error;
}
}
catch(...)
{
CASPAR_LOG_CURRENT_EXCEPTION();
- result.error = unknown_error;
+ result.error = error_state::unknown_error;
}
- return result.error == no_error;
+ return result.error == error_state::no_error;
}
std::size_t tokenize(const std::wstring& message, std::vector<std::wstring>* pTokenVector)
CLKProtocolStrategy(
const IO::client_connection<wchar_t>::ptr& client_connection,
clk_command_processor& command_processor)
- : currentState_(ExpectingNewCommand)
+ : currentState_(ParserState::ExpectingNewCommand)
, command_processor_(command_processor)
, client_connection_(client_connection)
{
{
switch (currentState_)
{
- case ExpectingNewCommand:
+ case ParserState::ExpectingNewCommand:
if (currentByte == 1)
- currentState_ = ExpectingCommand;
+ currentState_ = ParserState::ExpectingCommand;
//just throw anything else away
break;
- case ExpectingCommand:
+ case ParserState::ExpectingCommand:
if (currentByte == 2)
- currentState_ = ExpectingParameter;
+ currentState_ = ParserState::ExpectingParameter;
else
command_name_ += currentByte;
break;
- case ExpectingParameter:
+ case ParserState::ExpectingParameter:
//allocate new parameter
if (parameters_.size() == 0 || currentByte == 2)
parameters_.push_back(std::wstring());
private:
void reset()
{
- currentState_ = ExpectingNewCommand;
+ currentState_ = ParserState::ExpectingNewCommand;
currentCommandString_.str(L"");
command_name_.clear();
parameters_.clear();
}
- enum ParserState
+ enum class ParserState
{
ExpectingNewCommand,
ExpectingCommand,
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>SFML_STATIC;BOOST_THREAD_VERSION=4;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>Async</ExceptionHandling>
<FloatingPointModel>Fast</FloatingPointModel>
+ <TreatWarningAsError>true</TreatWarningAsError>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>SFML_STATIC;BOOST_THREAD_VERSION=4;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>Async</ExceptionHandling>
<FloatingPointModel>Fast</FloatingPointModel>
+ <TreatWarningAsError>true</TreatWarningAsError>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>