Page Menu
Home
Search
Configure Global Search
Log In
Files
F4715
imcolsel03.txt
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Authored By
Juho Vepsalainen (bebraw)
Nov 13 2013, 1:18 PM
Size
9 KB
Subscribers
None
imcolsel03.txt
View Options
Index: source/blender/blenkernel/BKE_image.h
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/blenkernel/BKE_image.h,v
retrieving revision 1.16
diff -u -p -u -r1.16 BKE_image.h
--- source/blender/blenkernel/BKE_image.h 20 Dec 2006 17:57:41 -0000 1.16
+++ source/blender/blenkernel/BKE_image.h 16 Apr 2007 13:27:08 -0000
@@ -112,7 +112,7 @@ struct ImBuf *BKE_image_get_ibuf(struct
struct Image *BKE_add_image_file(const char *name);
/* adds image, adds ibuf, generates color or pattern */
-struct Image *BKE_add_image_size(int width, int height, char *name, short uvtestgrid);
+struct Image *BKE_add_image_size(int width, int height, char *name, short uvtestgrid, float color[3]);
/* for reload, refresh, pack */
void BKE_image_signal(struct Image *ima, struct ImageUser *iuser, int signal);
@@ -151,4 +151,3 @@ void BKE_image_memorypack(struct Image *
#endif
#endif
-
Index: source/blender/blenkernel/intern/image.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/blenkernel/intern/image.c,v
retrieving revision 1.61
diff -u -p -u -r1.61 image.c
--- source/blender/blenkernel/intern/image.c 4 Apr 2007 13:18:28 -0000 1.61
+++ source/blender/blenkernel/intern/image.c 16 Apr 2007 13:27:08 -0000
@@ -370,7 +370,7 @@ Image *BKE_add_image_file(const char *na
return ima;
}
-static ImBuf *add_ibuf_size(int width, int height, char *name, short uvtestgrid)
+static ImBuf *add_ibuf_size(int width, int height, char *name, short uvtestgrid, float color[3])
{
ImBuf *ibuf;
float h=0.0, hoffs=0.0, hue=0.0, s=0.9, v=0.9, r, g, b;
@@ -435,7 +435,9 @@ static ImBuf *add_ibuf_size(int width, i
} else { /* blank image */
for(y=0; y<ibuf->y; y++) {
for(x=0; x<ibuf->x; x++, rect+=4) {
- rect[0]= rect[1]= rect[2]= 0;
+ rect[0]= (char)(color[0] * 255.0);
+ rect[1]= (char)(color[1] * 255.0);
+ rect[2]= (char)(color[2] * 255.0);
rect[3]= 255;
}
}
@@ -444,7 +446,7 @@ static ImBuf *add_ibuf_size(int width, i
}
/* adds new image block, creates ImBuf and initializes color */
-Image *BKE_add_image_size(int width, int height, char *name, short uvtestgrid)
+Image *BKE_add_image_size(int width, int height, char *name, short uvtestgrid, float color[3])
{
Image *ima;
@@ -459,7 +461,7 @@ Image *BKE_add_image_size(int width, int
ima->gen_y= height;
ima->gen_type= uvtestgrid;
- ibuf= add_ibuf_size(width, height, name, uvtestgrid);
+ ibuf= add_ibuf_size(width, height, name, uvtestgrid, color);
image_assign_ibuf(ima, ibuf, IMA_NO_INDEX, 0);
ima->ok= IMA_OK_LOADED;
@@ -1370,6 +1372,7 @@ static ImBuf *image_get_render_result(Im
ImBuf *BKE_image_get_ibuf(Image *ima, ImageUser *iuser)
{
ImBuf *ibuf= NULL;
+ float color[] = {0, 0, 0};
/* quick reject tests */
if(ima==NULL)
@@ -1447,7 +1450,7 @@ ImBuf *BKE_image_get_ibuf(Image *ima, Im
/* UV testgrid or black or solid etc */
if(ima->gen_x==0) ima->gen_x= 256;
if(ima->gen_y==0) ima->gen_y= 256;
- ibuf= add_ibuf_size(ima->gen_x, ima->gen_y, ima->name, ima->gen_type);
+ ibuf= add_ibuf_size(ima->gen_x, ima->gen_y, ima->name, ima->gen_type, color);
image_assign_ibuf(ima, ibuf, IMA_NO_INDEX, 0);
ima->ok= IMA_OK_LOADED;
}
@@ -1527,4 +1530,3 @@ void BKE_image_user_calc_imanr(ImageUser
if(iuser->ok==0) iuser->ok= 1;
}
}
-
Index: source/blender/include/BIF_interface.h
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/include/BIF_interface.h,v
retrieving revision 1.43
diff -u -p -u -r1.43 BIF_interface.h
--- source/blender/include/BIF_interface.h 4 Apr 2007 13:18:29 -0000 1.43
+++ source/blender/include/BIF_interface.h 16 Apr 2007 13:27:08 -0000
@@ -320,4 +320,3 @@ extern void *uiSetCurFont_ext(float aspe
void shade_buttons_change_3d(void);
#endif /* BIF_INTERFACE_H */
-
Index: source/blender/python/api2_2x/BPyModule.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/python/api2_2x/BPyModule.c,v
retrieving revision 1.4
diff -u -p -u -r1.4 BPyModule.c
--- source/blender/python/api2_2x/BPyModule.c 29 Mar 2007 03:47:50 -0000 1.4
+++ source/blender/python/api2_2x/BPyModule.c 16 Apr 2007 13:27:09 -0000
@@ -396,6 +396,7 @@ PyObject *LibBlockSeq_new(BPy_LibBlockSe
ID *id = NULL;
char *name=NULL, *filename=NULL, *data_type=NULL;
int img_width=256, img_height=256;
+ float color[] = {0, 0, 0};
short data_code = 0;
int user_count = 0;
@@ -538,7 +539,7 @@ PyObject *LibBlockSeq_new(BPy_LibBlockSe
break;
case ID_IM:
{
- id = (ID *)BKE_add_image_size(img_width, img_height, name, 0);
+ id = (ID *)BKE_add_image_size(img_width, img_height, name, 0, color);
if( !id )
return ( EXPP_ReturnPyObjError( PyExc_MemoryError,
"couldn't create PyObject Image_Type" ) );
Index: source/blender/python/api2_2x/Image.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/python/api2_2x/Image.c,v
retrieving revision 1.74
diff -u -p -u -r1.74 Image.c
--- source/blender/python/api2_2x/Image.c 31 Mar 2007 15:31:37 -0000 1.74
+++ source/blender/python/api2_2x/Image.c 16 Apr 2007 13:27:09 -0000
@@ -234,6 +234,7 @@ struct PyMethodDef M_Image_methods[] = {
static PyObject *M_Image_New( PyObject * self, PyObject * args)
{
int width, height, depth;
+ float color[] = {0, 0, 0};
char *name;
Image *image;
if( !PyArg_ParseTuple( args, "siii", &name, &width, &height, &depth ) )
@@ -242,7 +243,7 @@ static PyObject *M_Image_New( PyObject *
if (width > 5000 || height > 5000 || width < 1 || height < 1)
return ( EXPP_ReturnPyObjError( PyExc_TypeError,
"Image width and height must be between 1 and 5000" ) );
- image = BKE_add_image_size(width, height, name, 0);
+ image = BKE_add_image_size(width, height, name, 0, color);
if( !image )
return ( EXPP_ReturnPyObjError( PyExc_MemoryError,
"couldn't create PyObject Image_Type" ) );
Index: source/blender/src/editsima.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/editsima.c,v
retrieving revision 1.65
diff -u -p -u -r1.65 editsima.c
--- source/blender/src/editsima.c 11 Apr 2007 17:10:57 -0000 1.65
+++ source/blender/src/editsima.c 16 Apr 2007 13:27:09 -0000
@@ -1879,6 +1879,7 @@ void reload_image_sima(void)
void new_image_sima(void)
{
static int width= 256, height= 256;
+ float color[] = {0, 0, 0};
static short uvtestgrid=0;
char name[22];
@@ -1887,11 +1888,12 @@ void new_image_sima(void)
add_numbut(0, TEX, "Name:", 0, 21, name, NULL);
add_numbut(1, NUM|INT, "Width:", 1, 5000, &width, NULL);
add_numbut(2, NUM|INT, "Height:", 1, 5000, &height, NULL);
- add_numbut(3, TOG|SHO, "UV Test Grid", 0, 0, &uvtestgrid, NULL);
- if (!do_clever_numbuts("New Image", 4, REDRAW))
+ add_numbut(3, COL, "Background Color:", 0, 255, &color, NULL);
+ add_numbut(4, TOG|SHO, "UV Test Grid", 0, 0, &uvtestgrid, NULL);
+ if (!do_clever_numbuts("New Image", 5, REDRAW))
return;
- G.sima->image= BKE_add_image_size(width, height, name, uvtestgrid);
+ G.sima->image= BKE_add_image_size(width, height, name, uvtestgrid, color);
BKE_image_signal(G.sima->image, &G.sima->iuser, IMA_SIGNAL_USER_NEW_IMAGE);
image_changed(G.sima, 0);
@@ -1983,4 +1985,3 @@ void BIF_image_update_frame(void)
}
}
}
-
Index: source/blender/src/toolbox.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/toolbox.c,v
retrieving revision 1.162
diff -u -p -u -r1.162 toolbox.c
--- source/blender/src/toolbox.c 4 Apr 2007 13:18:34 -0000 1.162
+++ source/blender/src/toolbox.c 16 Apr 2007 13:27:13 -0000
@@ -566,6 +566,9 @@ int do_clever_numbuts(char *name, int to
if(varstr->type==TEX) {
uiDefBut(block, TEX, 0, varstr->name,(short)((x1+15) + (sizex*xi)),(short)(y2-55- 20*yi),(short)(sizex), 19, numbpoin[a], varstr->min, varstr->max, 0, 0, varstr->tip);
}
+ else if(varstr->type==COL) {
+ uiDefButF(block, COL, 0, varstr->name,(short)((x1+15) + (sizex*xi)),(short)(y2-55- 20*yi),(short)(sizex), 19, numbpoin[a], varstr->min, varstr->max, 0, 0, varstr->tip);
+ }
else {
if(varstr->type==LABEL) {/* dont include the label when rounding the buttons */
uiBlockEndAlign(block);
Index: source/blender/src/verse_object.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/verse_object.c,v
retrieving revision 1.9
diff -u -p -u -r1.9 verse_object.c
--- source/blender/src/verse_object.c 12 Jan 2007 08:51:16 -0000 1.9
+++ source/blender/src/verse_object.c 16 Apr 2007 13:27:13 -0000
@@ -224,6 +224,8 @@ Object *create_object_from_verse_node(VN
*/
void b_verse_pop_node(VNode *vnode)
{
+ float color[] = {0, 0, 0};
+
if((!vnode) || (!(vnode->data))) return;
if(vnode->type==V_NT_OBJECT) {
@@ -293,7 +295,8 @@ void b_verse_pop_node(VNode *vnode)
vbitmap->width,
vbitmap->height,
vnode->name,
- 0);
+ 0,
+ color);
((Image*)vbitmap->image)->vnode = (void*)vnode;
sync_blender_image_with_verse_bitmap_node(vnode);
@@ -595,4 +598,3 @@ void post_object_free_constraint(VNode *
}
#endif
-
File Metadata
Details
Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
a1/d4/ba435b0477d640df28e10f0d8823
Event Timeline
Log In to Comment