+static inline void to_mono(VFrame *data)
+{
+ if( !data ) return;
+ int w = data->get_w(), h = data->get_h();
+ uint8_t **rows = data->get_rows();
+ for( int y=0; y<h; ++y ) {
+ uint8_t *dp = rows[y];
+ for( int x=0; x<w; ++x,++dp ) *dp = *dp >= 0x80 ? 0xff : 0;
+ }
+}
+