[GEM-dev] [pix_video]: issue with swapped colors

IOhannes m zmoelnig zmoelnig at iem.at
Wed May 9 19:58:30 CEST 2007


Roman Haefeli wrote:
> On Wed, 2007-05-09 at 09:01 +0200, IOhannes m zmoelnig wrote:
> 
>>> is it possible to _slightly_ change the source code of [pix_video], so
>>> that R- and G-subpixels are swapped?
>> the change is trivial and has been done a lot of times, until it was
>> confirmed that it is just the detection of the device's colorspace that
>> is wrong.
> 
> if it is only one line, can you tell me what i have to change? it was
> only meant to have it different locally, not to be changed in the gem
> source code.


several ways:
the most efficient would be to decode the video correctly directly;
i don't know exactly which colorspace gets detected by Gem for your
device, but try changing one (or all) of the following:
videoV4L.cpp:158 change to fromYUV420P() to fromYU12()
videoV4L.cpp:160 change to fromBGR() to fromRGB()
videoV4L.cpp:161 change to fromBGRA() to fromRGBA()
videoV4L.cpp:162 change fromYVYU() to fromYUY2()

OR

another way (less efficient, and wrong if matju is right):
videoV4L.cpp:173: add "m_image.image.swapRedBlue();"

> 
> sorry for the confusion, i didn't meant it as a feature request or as
> something you you ae asked to implement in gem. i am not a c coder nor
> did i write an external for pd yet, but i hoped, i could copy the file
> pix_video.c to pix_videoLOCAL.c, which is slightly modified, so that i
> have two [pix_video] objects on (only) my box. if it's only the work of
> changing some strings from pix_video  to pix_videoLOCAL o similar, i'd
> like to do it, but i don't know, if adding a new object to gem is that
> simple. 

adding a new object to gem is as simple as putting a .cpp file into one
of the directories; configure/make will automatically add this to the
build-system; voila


mfg.asdr
IOhannes




More information about the GEM-dev mailing list