24 N_(
"Align text to the left")},
29 N_(
"Align text to the center")},
34 N_(
"Align text to the right")},
35 {0,
nullptr, 0,
nullptr,
nullptr},
43 N_(
"Align text to the top")},
48 N_(
"Align text to the top line's baseline")},
53 N_(
"Align text to the middle")},
57 N_(
"Bottom Baseline"),
58 N_(
"Align text to the bottom line's baseline")},
63 N_(
"Align text to the bottom")},
64 {0,
nullptr, 0,
nullptr,
nullptr},
69 b.use_custom_socket_order();
70 b.allow_any_socket_order();
73 .structure_type(StructureType::Dynamic)
74 .
description(
"The image containing the paragraph of text");
82 .default_value(128.0f)
85 .description(
"The height of each line in pixels");
104 .
description(
"Wrap text into new lines if it exceeds the specified width");
110 "The maximum width of each line in pixels. Lines with larger widths will be wrapped "
135 if (!string_image.is_allocated()) {
141 output.share_data(string_image);
147 this->
get_input(
"Horizontal Alignment").get_single_value_default<MenuValue>().value);
148 switch (horizontal_alignment) {
164 this->
get_input(
"Vertical Alignment").get_single_value_default<MenuValue>().value);
165 switch (vertical_alignment) {
203 ntype.
ui_name =
"String To Image";
204 ntype.
ui_description =
"Generates an image containing the given paragraph of text";
#define NOD_REGISTER_NODE(REGISTER_FUNC)
#define BLI_assert_unreachable()
StaticCacheManager & cache_manager()
NodeOperation(Context &context, const bNode &node)
Result & get_result(StringRef identifier)
void allocate_default_remaining_outputs()
Context & context() const
Result & get_input(StringRef identifier) const
T get_single_value_default() const
StringImageContainer string_images
Result & get(Context &context, const std::string string, const VFont *font, const float size, const HorizontalAlignment horizontal_alignment, const VerticalAlignment vertical_alignment, const std::optional< int > wrap_width)
DeclType::Builder & add_input(UString name, UString identifier=""_ustr)
NodeOperation(Context &context, const bNode &node)
HorizontalAlignment get_horizontal_alignment()
std::optional< int > get_wrap_width()
VerticalAlignment get_vertical_alignment()
void node_register_type(bNodeType &ntype)
T max(const T &a, const T &b)
static NodeOperation * get_compositor_operation(Context &context, const bNode &node)
static const EnumPropertyItem rna_node_compositor_string_to_image_vertical_alignment_items[]
static const EnumPropertyItem rna_node_compositor_string_to_image_horizontal_alignment_items[]
static void node_declare(NodeDeclarationBuilder &b)
static void node_register()
VFont * BKE_vfont_builtin_ensure()
CMPNodeStringToImageHorizontalAlignment
@ CMP_NODE_STRING_TO_IMAGE_HORIZONTAL_ALIGNMENT_LEFT
@ CMP_NODE_STRING_TO_IMAGE_HORIZONTAL_ALIGNMENT_RIGHT
@ CMP_NODE_STRING_TO_IMAGE_HORIZONTAL_ALIGNMENT_CENTER
CMPNodeStringToImageVerticalAlignment
@ CMP_NODE_STRING_TO_IMAGE_VERTICAL_ALIGNMENT_BOTTOM_BASELINE
@ CMP_NODE_STRING_TO_IMAGE_VERTICAL_ALIGNMENT_TOP_BASELINE
@ CMP_NODE_STRING_TO_IMAGE_VERTICAL_ALIGNMENT_BOTTOM
@ CMP_NODE_STRING_TO_IMAGE_VERTICAL_ALIGNMENT_TOP
@ CMP_NODE_STRING_TO_IMAGE_VERTICAL_ALIGNMENT_MIDDLE
void cmp_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
std::string ui_description
NodeGetCompositorOperationFunction get_compositor_operation
NodeDeclareFunction declare