rework histogram_bezier, init wm icon set_icon(gg), update de.po+msg/txt
[goodguy/history.git] / cinelerra-5.1 / guicast / bccmdl.py
index bae50c50a119b5c9245e702a89d7d5b833f1e030..6b5b9363ee6adc68b03bbcf504b691441ae33fb9 100755 (executable)
@@ -327,17 +327,17 @@ base = {
 
   "gbrp": {
     "i8": {
-      "r": " int g = *gip++, b = *bip++, r = *rip++;",
-      "w": " *gop++ = g; *bop++ = b; *rop++ = r;",
+      "r": " int g = *rip++, b = *gip++, r = *bip++;",
+      "w": " *rop++ = g; *gop++ = b; *bop++ = r;",
     },
     "i16": {
-      "r": " int ig = *gip++, g = (ig<<8) | ig, ib = *bip++, b = (ib<<8) | ib," +
-           " ir = *rip++, r = (ir<<8) | ir;",
-      "w": " *gop++ = g >> 8; *bop++ = b >> 8; *rop++ = r >> 8;",
+      "r": " int ig = *rip++, g = (ig<<8) | ig, ib = *gip++, b = (ib<<8) | ib," +
+           " ir = *bip++, r = (ir<<8) | ir;",
+      "w": " *rop++ = g >> 8; *gop++ = b >> 8; *bop++ = r >> 8;",
     },
     "fp": {
-      "r": " float g = *gip++/255.f, b = *bip++/255.f, r = *rip++/255.f;",
-      "w": " *gop++ = clp(256,g); *bop++ = clp(256,b); *rop++ = clp(256,r);",
+      "r": " float g = *rip++/255.f, b = *gip++/255.f, r = *bip++/255.f;",
+      "w": " *rop++ = clp(256,g); *gop++ = clp(256,b); *bop++ = clp(256,r);",
     },
   },
 
@@ -420,6 +420,49 @@ base = {
       "w": " *aop++ = fa;",
     },
   },
+  # no src alpha blend
+  "x8": {
+    "i8": {
+      "r": " ++inp;",
+      "w": " *out++ = 0xff;",
+    },
+    "i16": {
+      "r": " ++inp;",
+      "w": " *out++ = 0xff;",
+    },
+    "fp": {
+      "r": " ++inp;",
+      "w": " *out++ = 0xff;",
+    },
+  },
+  "x16": {
+    "i8": {
+      "r": " ++inp;",
+      "w": " *out++ = 0xffff;",
+    },
+    "i16": {
+      "r": " ++inp;",
+      "w": " *out++ = 0xffff;",
+    },
+    "fp": {
+      "r": " ++inp;",
+      "w": " *out++ = 0xffff;",
+    },
+  },
+  "xfp": {
+    "i8": {
+      "r": " ++inp;",
+      "w": " *out++ = 1.f;",
+    },
+    "i16": {
+      "r": " ++inp;",
+      "w": " *out++ = 1.f;",
+    },
+    "fp": {
+      "r": " ++inp;",
+      "w": " *out++ = 1.f;",
+    },
+  },
   # alpha blend rgb/black, yuv/black, rgb/bg_color
   "brgb": {
     "i8": " r = r*a/0xffu; g = g*a/0xffu; b = b*a/0xffu;",
@@ -506,6 +549,12 @@ add_cmodel(36, "bc_grey8", "i8", "grey8")
 add_cmodel(37, "bc_grey16", "i16", "grey16")
 add_cmodel(38, "bc_gbrp", "i8", "gbrp")
 
+add_cmodel(39, "bc_rgbx8888", "i8", "rgb888", "x8")
+add_cmodel(40, "bc_rgbx16161616", "i16", "rgb161616", "x16")
+add_cmodel(41, "bc_yuvx8888", "i8", "yuv888", "x8")
+add_cmodel(42, "bc_yuvx16161616", "i16", "yuv161616", "x16")
+add_cmodel(43, "bc_rgbx_float", "fp", "rgbfloat", "xfp")
+
 specialize("bc_rgba8888", "bc_transparency", "XFER_rgba8888_to_transparency")
 
 ctype = {
@@ -539,20 +588,23 @@ def is_rgb(nm):
     "bc_bgr888", "bc_bgr8888", "bc_rgb888", "bc_rgba8888", \
     "bc_argb8888", "bc_abgr8888", "bc_rgb", "bc_rgb161616", \
     "bc_rgba16161616", "bc_rgb_float", "bc_rgba_float", \
-    "bc_rgb_floatp", "bc_rgba_floatp", "bc_gbrp", ]
+    "bc_rgb_floatp", "bc_rgba_floatp", "bc_gbrp", \
+    "bc_rgbx8888", "bc_rgbx16161616", "bc_rgbx_float", ]
 
 def is_yuv(nm):
   return nm in [ "bc_yuv888", "bc_yuva8888", "bc_yuv161616", \
     "bc_yuva16161616", "bc_ayuv16161616", "bc_yuv422", "bc_uvy422", "bc_yuv101010", \
     "bc_vyu888", "bc_uyva8888", "bc_yuv420p", "bc_yuv420pi", "bc_yuv422p", \
-    "bc_yuv444p", "bc_yuv411p", "bc_yuv410p", "bc_grey8", "bc_grey16", ]
+    "bc_yuv444p", "bc_yuv411p", "bc_yuv410p", "bc_grey8", "bc_grey16", \
+    "bc_yuvx8888", "bc_yuvx16161616", ]
 
 def is_planar(nm):
   return nm in [ "bc_yuv420p", "bc_yuv420pi", "bc_yuv422p", "bc_yuv444p", \
     "bc_yuv411p", "bc_yuv410p", "bc_rgb_floatp", "bc_rgba_floatp", "bc_gbrp", ]
 
 def is_float(nm):
-  return nm in ["bc_rgb_float", "bc_rgba_float", "bc_rgb_floatp", "bc_rgba_floatp", ]
+  return nm in [ "bc_rgb_float", "bc_rgba_float", "bc_rgbx_float", \
+    "bc_rgb_floatp", "bc_rgba_floatp", ]
 
 def gen_xfer_proto(fd, pfx, cls, fr_cmdl, to_cmdl):
   global dtype, ctype
@@ -628,7 +680,7 @@ class_qual = "BC_Xfer::"
 xfn = "xfer/xfer.h"
 fd = open(xfn, "w")
 xid = "".join([chr(x) if chr(x).isalnum() else '_' for x in range(256)])
-xid = "__" + xfn.upper()[xfn.rfind("/")+1:].translate("".join(xid)) + "__"
+xid = "__" + xfn.upper()[xfn.rfind("/")+1:].translate(xid) + "__"
 print >>fd, "#ifndef %s" % xid
 print >>fd, "#define %s" % xid
 print >>fd, ""