Skip to content

Commit 44375cf

Browse files
authored
misc: add support for 128x16 colorizations (#3)
1 parent 6055ec2 commit 44375cf

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

src/vni.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,21 @@ uint32_t Vni_Colorize(Vni_Context* ctx, const uint8_t* frame, uint32_t width,
967967
}
968968
}
969969

970-
auto planes = split_planes(frame, width, height, bitlen);
970+
const uint8_t* effective_frame = frame;
971+
std::vector<uint8_t> padded_frame;
972+
973+
Dimensions standard;
974+
if (dim.width < standard.width || dim.height < standard.height) {
975+
padded_frame.resize(standard.surface(), 0);
976+
FrameUtil::Helper::CenterIndexed(
977+
padded_frame.data(), static_cast<uint16_t>(standard.width),
978+
static_cast<uint8_t>(standard.height), frame,
979+
static_cast<uint16_t>(dim.width), static_cast<uint8_t>(dim.height));
980+
effective_frame = padded_frame.data();
981+
dim = standard;
982+
}
983+
984+
auto planes = split_planes(effective_frame, dim.width, dim.height, bitlen);
971985

972986
if (!context->pal->mappings.empty()) {
973987
trigger_animation(context, dim, planes, false);

0 commit comments

Comments
 (0)