[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [42047] trunk/blender/source/blender: display quality for avijpeg, name BKE_imtype functions more sensibly

Campbell Barton ideasman42 at gmail.com
Tue Nov 22 01:06:56 CET 2011


Revision: 42047
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42047
Author:   campbellbarton
Date:     2011-11-22 00:06:54 +0000 (Tue, 22 Nov 2011)
Log Message:
-----------
display quality for avijpeg, name BKE_imtype functions more sensibly 

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/BKE_image.h
    trunk/blender/source/blender/blenkernel/intern/image.c
    trunk/blender/source/blender/editors/space_image/image_buttons.c
    trunk/blender/source/blender/editors/space_image/image_ops.c
    trunk/blender/source/blender/makesdna/DNA_scene_types.h
    trunk/blender/source/blender/makesrna/intern/rna_scene.c
    trunk/blender/source/blender/render/intern/source/pipeline.c

Modified: trunk/blender/source/blender/blenkernel/BKE_image.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_image.h	2011-11-21 23:57:09 UTC (rev 42046)
+++ trunk/blender/source/blender/blenkernel/BKE_image.h	2011-11-22 00:06:54 UTC (rev 42047)
@@ -59,11 +59,11 @@
 int		BKE_imtype_to_ftype(char imtype);
 
 int		BKE_imtype_is_movie(const char imtype);
-int		BKE_imtype_is_alpha_ok(const char imtype);
-int		BKE_imtype_is_zbuf_ok(const char imtype);
-int		BKE_imtype_is_compression_ok(const char imtype);
-int		BKE_imtype_is_quality_ok(const char imtype);
-char	BKE_imtype_is_depth_ok(const char imtype);
+int		BKE_imtype_supports_alpha(const char imtype);
+int		BKE_imtype_supports_zbuf(const char imtype);
+int		BKE_imtype_supports_compress(const char imtype);
+int		BKE_imtype_supports_quality(const char imtype);
+char	BKE_imtype_valid_depths(const char imtype);
 
 struct anim *openanim(const char *name, int flags, int streamindex);
 

Modified: trunk/blender/source/blender/blenkernel/intern/image.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/image.c	2011-11-21 23:57:09 UTC (rev 42046)
+++ trunk/blender/source/blender/blenkernel/intern/image.c	2011-11-22 00:06:54 UTC (rev 42047)
@@ -900,7 +900,7 @@
 	return 0;
 }
 
-int BKE_imtype_is_alpha_ok(const char imtype)
+int BKE_imtype_supports_alpha(const char imtype)
 {
 	switch(imtype) {
 	case R_TARGA:
@@ -918,7 +918,7 @@
 	return 0;
 }
 
-int BKE_imtype_is_zbuf_ok(const char imtype)
+int BKE_imtype_supports_zbuf(const char imtype)
 {
 	switch(imtype) {
 	case R_IRIZ:
@@ -928,7 +928,7 @@
 	return 0;
 }
 
-int BKE_imtype_is_compression_ok(const char imtype)
+int BKE_imtype_supports_compress(const char imtype)
 {
 	switch(imtype) {
 	case R_PNG:
@@ -937,17 +937,18 @@
 	return 0;
 }
 
-int BKE_imtype_is_quality_ok(const char imtype)
+int BKE_imtype_supports_quality(const char imtype)
 {
 	switch(imtype) {
 	case R_JPEG90:
 	case R_JP2:
+	case R_AVIJPEG:
 			return 1;
 	}
 	return 0;
 }
 
-char BKE_imtype_is_depth_ok(const char imtype)
+char BKE_imtype_valid_depths(const char imtype)
 {
 	switch (imtype) {
 	case R_RADHDR:

Modified: trunk/blender/source/blender/editors/space_image/image_buttons.c
===================================================================
--- trunk/blender/source/blender/editors/space_image/image_buttons.c	2011-11-21 23:57:09 UTC (rev 42046)
+++ trunk/blender/source/blender/editors/space_image/image_buttons.c	2011-11-22 00:06:54 UTC (rev 42047)
@@ -821,7 +821,7 @@
 {
 	ImageFormatData *imf= imfptr->data;
 	ID *id= imfptr->id.data;
-	const int depth_ok= BKE_imtype_is_depth_ok(imf->imtype);
+	const int depth_ok= BKE_imtype_valid_depths(imf->imtype);
 	/* some settings depend on this being a scene thats rendered */
 	const short is_render_out= (id && GS(id->name) == ID_SCE);
 
@@ -847,15 +847,15 @@
 		uiItemR(row, imfptr, "color_depth", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
 	}
 
-	if (BKE_imtype_is_quality_ok(imf->imtype)) {
+	if (BKE_imtype_supports_quality(imf->imtype)) {
 		uiItemR(col, imfptr, "quality", 0, NULL, ICON_NONE);
 	}
 
-	if (BKE_imtype_is_compression_ok(imf->imtype)) {
+	if (BKE_imtype_supports_compress(imf->imtype)) {
 		uiItemR(col, imfptr, "compression", 0, NULL, ICON_NONE);
 	}
 
-	if (BKE_imtype_is_zbuf_ok(imf->imtype)) {
+	if (BKE_imtype_supports_zbuf(imf->imtype)) {
 		uiItemR(col, imfptr, "use_zbuffer", 0, NULL, ICON_NONE);
 	}
 

Modified: trunk/blender/source/blender/editors/space_image/image_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_image/image_ops.c	2011-11-21 23:57:09 UTC (rev 42046)
+++ trunk/blender/source/blender/editors/space_image/image_ops.c	2011-11-22 00:06:54 UTC (rev 42047)
@@ -926,7 +926,7 @@
 
 static char imtype_best_depth(ImBuf *ibuf, const char imtype)
 {
-	const char depth_ok= BKE_imtype_is_depth_ok(imtype);
+	const char depth_ok= BKE_imtype_valid_depths(imtype);
 
 	if (ibuf->rect_float) {
 		if (depth_ok & R_IMF_CHAN_DEPTH_32) return R_IMF_CHAN_DEPTH_32;

Modified: trunk/blender/source/blender/makesdna/DNA_scene_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_scene_types.h	2011-11-21 23:57:09 UTC (rev 42046)
+++ trunk/blender/source/blender/makesdna/DNA_scene_types.h	2011-11-22 00:06:54 UTC (rev 42047)
@@ -254,7 +254,7 @@
 /* ImageFormatData.cineon_flag */
 #define R_IMF_CINEON_FLAG_LOG (1<<0)  /* was R_CINEON_LOG */
 
-/* return values from BKE_imtype_is_depth_ok, note this is depts per channel */
+/* return values from BKE_imtype_valid_depths, note this is depts per channel */
 #define R_IMF_CHAN_DEPTH_1  (1<<0) /* 1bits  (unused) */
 #define R_IMF_CHAN_DEPTH_8  (1<<1) /* 8bits  (default) */
 #define R_IMF_CHAN_DEPTH_12 (1<<2) /* 12bits (uncommon, jp2 supports) */

Modified: trunk/blender/source/blender/makesrna/intern/rna_scene.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_scene.c	2011-11-21 23:57:09 UTC (rev 42046)
+++ trunk/blender/source/blender/makesrna/intern/rna_scene.c	2011-11-22 00:06:54 UTC (rev 42047)
@@ -615,13 +615,13 @@
 	imf->imtype= value;
 
 	/* ensure depth and color settings match */
-	if (!BKE_imtype_is_alpha_ok(imf->imtype)) {
+	if (!BKE_imtype_supports_alpha(imf->imtype)) {
 		imf->planes= R_IMF_PLANES_RGB;
 	}
 
 	/* ensure usable depth */
 	{
-		const int depth_ok= BKE_imtype_is_depth_ok(imf->imtype);
+		const int depth_ok= BKE_imtype_valid_depths(imf->imtype);
 		if ((imf->depth & depth_ok) == 0) {
 			/* set first available depth */
 			char depth_ls[]= {R_IMF_CHAN_DEPTH_32,
@@ -672,7 +672,7 @@
 {
 	ImageFormatData *imf= (ImageFormatData *)ptr->data;
 
-	if ((imf == NULL) || BKE_imtype_is_alpha_ok(imf->imtype)) {
+	if ((imf == NULL) || BKE_imtype_supports_alpha(imf->imtype)) {
 		return image_color_mode_items;
 	}
 	else {
@@ -693,7 +693,7 @@
 		return image_color_depth_items;
 	}
 	else {
-		const int depth_ok= BKE_imtype_is_depth_ok(imf->imtype);
+		const int depth_ok= BKE_imtype_valid_depths(imf->imtype);
 		const int is_float= ELEM3(imf->imtype, R_RADHDR, R_OPENEXR, R_MULTILAYER);
 
 		EnumPropertyItem *item_8bit=  &image_color_depth_items[0];

Modified: trunk/blender/source/blender/render/intern/source/pipeline.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/pipeline.c	2011-11-21 23:57:09 UTC (rev 42046)
+++ trunk/blender/source/blender/render/intern/source/pipeline.c	2011-11-22 00:06:54 UTC (rev 42047)
@@ -3030,7 +3030,7 @@
 				/* sequence editor can generate 8bpc render buffers */
 				if (ibuf->rect) {
 					ibuf->profile = IB_PROFILE_SRGB;
-					if (BKE_imtype_is_depth_ok(scene->r.im_format.imtype) & (R_IMF_CHAN_DEPTH_12|R_IMF_CHAN_DEPTH_16|R_IMF_CHAN_DEPTH_24|R_IMF_CHAN_DEPTH_32))
+					if (BKE_imtype_valid_depths(scene->r.im_format.imtype) & (R_IMF_CHAN_DEPTH_12|R_IMF_CHAN_DEPTH_16|R_IMF_CHAN_DEPTH_24|R_IMF_CHAN_DEPTH_32))
 						IMB_float_from_rect(ibuf);
 				} else {				
 					ibuf->profile = IB_PROFILE_LINEAR_RGB;




More information about the Bf-blender-cvs mailing list