Quote:
Originally Posted by JoeyMonco
I fail to see how it's less messy than your solution which is an over-engineered mess. The switch statement in C is entirely created to do what you want which is to map some action to an integeral value.
|
I want to know BitsPerComponent of the destination format passed as a string. How am I to know whether it's 8-bit, 10-bit or 16-bit? It could be YV12, YUV444P10, YUVAP16... doing it the "if" or "switch" way is a direct road to hell. If you want to write long series of conditions each time you want to do such an operation, then go ahead, but I'm not going down that road.