[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48674] trunk/blender/source/blender: rgb color display options for compo backdrop.

Campbell Barton ideasman42 at gmail.com
Fri Jul 6 11:22:59 CEST 2012


Revision: 48674
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48674
Author:   campbellbarton
Date:     2012-07-06 09:22:59 +0000 (Fri, 06 Jul 2012)
Log Message:
-----------
rgb color display options for compo backdrop.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_node/drawnode.c
    trunk/blender/source/blender/makesdna/DNA_space_types.h
    trunk/blender/source/blender/makesrna/intern/rna_space.c

Modified: trunk/blender/source/blender/editors/space_node/drawnode.c
===================================================================
--- trunk/blender/source/blender/editors/space_node/drawnode.c	2012-07-06 07:40:54 UTC (rev 48673)
+++ trunk/blender/source/blender/editors/space_node/drawnode.c	2012-07-06 09:22:59 UTC (rev 48674)
@@ -2951,9 +2951,27 @@
 			}
 
 			if (ibuf->rect) {
-				if (snode->flag & SNODE_SHOW_ALPHA) {
+				if (snode->flag & (SNODE_SHOW_R | SNODE_SHOW_G | SNODE_SHOW_B)) {
+					int ofs;
+
+					if      (snode->flag & SNODE_SHOW_R) ofs = 1;
+					else if (snode->flag & SNODE_SHOW_G) ofs = 2;
+					else                                 ofs = 3;
+
+					if (ENDIAN_ORDER == B_ENDIAN) {
+						ofs = 3 - ofs;
+					}
+
 					glPixelZoom(snode->zoom, snode->zoom);
 					/* swap bytes, so alpha is most significant one, then just draw it as luminance int */
+
+					glaDrawPixelsSafe(x, y, ibuf->x, ibuf->y, ibuf->x, GL_LUMINANCE, GL_UNSIGNED_INT, ((unsigned char *)ibuf->rect) + ofs);
+
+					glPixelZoom(1.0f, 1.0f);
+				}
+				else if (snode->flag & SNODE_SHOW_ALPHA) {
+					glPixelZoom(snode->zoom, snode->zoom);
+					/* swap bytes, so alpha is most significant one, then just draw it as luminance int */
 					if (ENDIAN_ORDER == B_ENDIAN)
 						glPixelStorei(GL_UNPACK_SWAP_BYTES, 1);
 					

Modified: trunk/blender/source/blender/makesdna/DNA_space_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_space_types.h	2012-07-06 07:40:54 UTC (rev 48673)
+++ trunk/blender/source/blender/makesdna/DNA_space_types.h	2012-07-06 09:22:59 UTC (rev 48674)
@@ -879,6 +879,9 @@
 /*  SNODE_DISPGP         = (1 << 2), */ /* XXX: Grease Pencil - deprecated? */
 	SNODE_USE_ALPHA      = (1 << 3),
 	SNODE_SHOW_ALPHA     = (1 << 4),
+	SNODE_SHOW_R         = (1 << 7),
+	SNODE_SHOW_G         = (1 << 8),
+	SNODE_SHOW_B         = (1 << 9),
 	SNODE_AUTO_RENDER    = (1 << 5),
 	SNODE_SHOW_HIGHLIGHT = (1 << 6),
 } eSpaceNode_Flag;

Modified: trunk/blender/source/blender/makesrna/intern/rna_space.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_space.c	2012-07-06 07:40:54 UTC (rev 48673)
+++ trunk/blender/source/blender/makesrna/intern/rna_space.c	2012-07-06 09:22:59 UTC (rev 48674)
@@ -2852,6 +2852,9 @@
 		{SNODE_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color and Alpha",
 		                  "Draw image with RGB colors and alpha transparency"},
 		{SNODE_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Draw alpha transparency channel"},
+		{SNODE_SHOW_R, "RED", 0, "Red", ""},
+		{SNODE_SHOW_G, "GREEN", 0, "Green", ""},
+		{SNODE_SHOW_B, "BLUE", 0, "Blue", ""},
 		{0, NULL, 0, NULL, NULL}
 	};
 




More information about the Bf-blender-cvs mailing list