+sub newyuv8 {
+ # convert from YPbPr values 0..255 (or hex string)
+ my $class = shift;
+ my ($y, $cb, $cr) = @_ >= 3 ? @_ : (map {hex} $_[0] =~ /(..)/g);
+
+ $_ -= 128 for $cb, $cr;
+ $_ /= 255 for $y, $cb, $cr;
+
+ $class->newyuv($y, $cb, $cr);
+}
+