<div dir="ltr">A little search shows that your first test commit for the soc-2007-joeedh branch occurred 5/31/07. I was just wondering how your progress is after 14 months of work. I feel like it&#39;s been forever since you started working on it and your new commits don&#39;t reveal much about the status of your project. At least not to me. I&#39;m excited to see your stuff finished so I thought I&#39;d post to the list to get an idea of if/when that&#39;s going to happen. Thanks Joe!<br>
<br>Regards,<br>--Chris<br><br><div class="gmail_quote">On Thu, Aug 21, 2008 at 3:59 AM, Joseph Eagar <span dir="ltr">&lt;<a href="mailto:joeedh@gmail.com">joeedh@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Revision: 16201<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a href="http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&amp;root=bf-blender&amp;revision=16201" target="_blank">http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&amp;root=bf-blender&amp;revision=16201</a><br>

Author: &nbsp; joeedh<br>
Date: &nbsp; &nbsp; 2008-08-21 09:59:18 +0200 (Thu, 21 Aug 2008)<br>
<br>
Log Message:<br>
-----------<br>
Commit of an experimental tile-based disk-backed image<br>
library I felt like writing. &nbsp;It does nothing at the moment.<br>
<br>
Also, added some UI for soft shadows (which of course<br>
don&#39;t work yet, still need to code a good PCF<br>
implementation, as it seems not only is the more<br>
physically-correct method my nonworking code is using<br>
a lot slower, but it&#39;s also not worth it if your<br>
rendering fur).<br>
<br>
Modified Paths:<br>
--------------<br>
 &nbsp; &nbsp;branches/soc-2007-joeedh/source/blender/blenkernel/intern/tcs_bucketbuffer.c<br>
 &nbsp; &nbsp;branches/soc-2007-joeedh/source/blender/blenkernel/intern/tcs_cache.c<br>
 &nbsp; &nbsp;branches/soc-2007-joeedh/source/blender/blenkernel/intern/tcs_image.c<br>
 &nbsp; &nbsp;branches/soc-2007-joeedh/source/blender/makesdna/DNA_lamp_types.h<br>
 &nbsp; &nbsp;branches/soc-2007-joeedh/source/blender/render/intern/include/render_types.h<br>
 &nbsp; &nbsp;branches/soc-2007-joeedh/source/blender/render/intern/source/convertblender.c<br>
 &nbsp; &nbsp;branches/soc-2007-joeedh/source/blender/render/intern/source/dsm_func.c<br>
 &nbsp; &nbsp;branches/soc-2007-joeedh/source/blender/render/intern/source/dsm_soft.c<br>
 &nbsp; &nbsp;branches/soc-2007-joeedh/source/blender/src/buttons_shading.c<br>
<br>
Added Paths:<br>
-----------<br>
 &nbsp; &nbsp;branches/soc-2007-joeedh/source/blender/blenkernel/BKE_imagebuffer.h<br>
<br>
Added: branches/soc-2007-joeedh/source/blender/blenkernel/BKE_imagebuffer.h<br>
===================================================================<br>
--- branches/soc-2007-joeedh/source/blender/blenkernel/BKE_imagebuffer.h &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(rev 0)<br>
+++ branches/soc-2007-joeedh/source/blender/blenkernel/BKE_imagebuffer.h &nbsp; &nbsp; &nbsp; &nbsp;2008-08-21 07:59:18 UTC (rev 16201)<br>
@@ -0,0 +1,119 @@<br>
+/**<br>
+ * blenlib/BKE_imagebuffer.h<br>
+ *<br>
+ * $Id: BKE_imagebuffer.h 15647 2008-07-20 04:39:35Z joeedh $<br>
+ *<br>
+ * ***** BEGIN GPL LICENSE BLOCK *****<br>
+ *<br>
+ * This program is free software; you can redistribute it and/or<br>
+ * modify it under the terms of the GNU General Public License<br>
+ * as published by the Free Software Foundation; either version 2<br>
+ * of the License, or (at your option) any later version.<br>
+ *<br>
+ * This program is distributed in the hope that it will be useful,<br>
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. &nbsp;See the<br>
+ * GNU General Public License for more details.<br>
+ *<br>
+ * You should have received a copy of the GNU General Public License<br>
+ * along with this program; if not, write to the Free Software Foundation,<br>
+ * Inc., 59 Temple Place - Suite 330, Boston, MA &nbsp;02111-1307, USA.<br>
+ *<br>
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.<br>
+ * All rights reserved.<br>
+ *<br>
+ * The Original Code is: all of this file.<br>
+ *<br>
+ * Contributor(s): none yet.<br>
+ *<br>
+ * ***** END GPL LICENSE BLOCK *****<br>
+ */<br>
+#ifndef BKE_IMAGEBUFFER_H<br>
+#define BKE_IMAGEBUFFER_H<br>
+<br>
+#define USEIMAGEBUFFER 0<br>
+<br>
+#if USEIMAGEBUFFER<br>
+<br>
+#include &quot;BKE_tile.h&quot;<br>
+<br>
+typedef struct TCS_ImageTile {<br>
+ &nbsp; &nbsp; &nbsp; TCS_Tile tile;<br>
+ &nbsp; &nbsp; &nbsp; union {<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; char *c;<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; float *f;<br>
+ &nbsp; &nbsp; &nbsp; } data;<br>
+ &nbsp; &nbsp; &nbsp; int sizex, sizey;<br>
+ &nbsp; &nbsp; &nbsp; int x, y, type, totchannels;<br>
+} TCS_ImageTile;<br>
+<br>
+typedef struct TCS_Image {<br>
+ &nbsp; &nbsp; &nbsp; TCS_TileBuffer buffer;<br>
+ &nbsp; &nbsp; &nbsp; int sizex, sizey;<br>
+ &nbsp; &nbsp; &nbsp; int tilex, tiley;<br>
+<br>
+ &nbsp; &nbsp; &nbsp; short flags, type;<br>
+ &nbsp; &nbsp; &nbsp; int totchannels;<br>
+<br>
+ &nbsp; &nbsp; &nbsp; TCS_ImageTile *tilerect;<br>
+} TCS_Image;<br>
+<br>
+/*image types*/<br>
+#define IMAGE_FLOAT &nbsp; &nbsp;0<br>
+#define IMAGE_BYTE &nbsp; &nbsp; 1<br>
+<br>
+#define TCSIMAGE_MAX_TILESIZE &nbsp;64<br>
+#define TCSIMAGE_MAX_TOTCHANNELS &nbsp; &nbsp; &nbsp; 4<br>
+#define TCSIMAGE_MAXMEM &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;75*1024*1024<br>
+<br>
+/*note: initcolor is allowed to be NuLL*/<br>
+TCS_Image *TCSImage_newImage(int sizex, int sizey, int type, int totchannels,<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;void *initcolor);<br>
+<br>
+void TCSImage_getPixelf(TCS_Image *img, int x, int y, float *dst_pixel);<br>
+void TCSImage_getPixelub(TCS_Image *img, int x, int y, char *dst_pixel);<br>
+<br>
+void TCSImage_setPixelf(TCS_Image *img, int x, int y, float *src_pixel);<br>
+void TCSImage_setPixelub(TCS_Image *img, int x, int y, char *src_pixel);<br>
+<br>
+/*note, this can&#39;t (by it&#39;s nature) lock the tile automatically the way the previous<br>
+ &nbsp;two functions can (there&#39;s no point) */<br>
+void *TCSImage_getPixel(TCS_Image *img, int x, int y);<br>
+<br>
+/*ok, as much as possible try to use the pixel processor functions, which<br>
+ &nbsp;loops over every pixel in an image and calls a function on these,<br>
+ &nbsp;since they&#39;ll automatically do float&lt;-&gt;byte conversions for you.<br>
+<br>
+ &nbsp;also, the processor functions themselves always work in floats*/<br>
+<br>
+/*x and y are pixel positions in normalized 0.0 ... 1.0 space.<br>
+ &nbsp;note that fac is always provided.<br>
+<br>
+ &nbsp;in is the input pixel, out is the output. &nbsp;note that out is *not*<br>
+ &nbsp;zeroed, so it may have garbage in it. &nbsp;totchannels is the number of<br>
+ &nbsp;channels this pixel has.*/<br>
+typedef void (*PixelProc)(float *in, float *out, float *fac, float x, float y, int totchannels);<br>
+<br>
+/*note: fac can be NULL, in which case defaultfac is passed in. &nbsp;otherwise, defaultfac has<br>
+ &nbsp; &nbsp; &nbsp; &nbsp;no meaning.*/<br>
+void TCSImage_Pixel_Processor(TCS_Image *image, TCS_Image *fac, float defaultfac,<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PixelProc proc, int totchannels);<br>
+<br>
+void TCSImage_Scale(TCS_Image *image, int newwidth, int newheight, int scalemode);<br>
+#define SCALEMODE_NORMAL &nbsp; &nbsp; &nbsp; 0<br>
+#define SCALEMODE_FAST &nbsp; &nbsp; &nbsp; &nbsp; 1<br>
+<br>
+void TCSImage_Mix(TCS_Image *dst, TCS_Image *src, TCS_Image *fac,<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;float facscale, int mode);<br>
+void TCSImage_AlphaOver(TCS_Image *dst, TCS_Image *src, TCS_Image *fac,<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;float facscale, int convertpremul);<br>
+<br>
+/*converts the image stored in *img to the desired type and number of totchannels,<br>
+ &nbsp;if necassary, initializing alpha to defaultalpha as necassary.*/<br>
+void TCSImage_Convert(TCS_Image *img, int type, int totchannels, float defaultalpha);<br>
+<br>
+/*makes a copy of an image*/<br>
+TCS_Image *TCSImage_Copy(TCS_Image *img);<br>
+<br>
+#endif /* BKE_IMAGEBUFFER_H */<br>
+#endif<br>
<br>
Modified: branches/soc-2007-joeedh/source/blender/blenkernel/intern/tcs_bucketbuffer.c<br>
===================================================================<br>
--- branches/soc-2007-joeedh/source/blender/blenkernel/intern/tcs_bucketbuffer.c &nbsp; &nbsp; &nbsp; &nbsp;2008-08-20 21:34:49 UTC (rev 16200)<br>
+++ branches/soc-2007-joeedh/source/blender/blenkernel/intern/tcs_bucketbuffer.c &nbsp; &nbsp; &nbsp; &nbsp;2008-08-21 07:59:18 UTC (rev 16201)<br>
@@ -273,6 +273,7 @@<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TCS_AddToPool(pool, tile);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TCS_RunCacher(pool);<br>
 &nbsp; &nbsp; &nbsp; &nbsp;}<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;return (TCS_TileBuffer*) buf;<br>
<br>
Modified: branches/soc-2007-joeedh/source/blender/blenkernel/intern/tcs_cache.c<br>
===================================================================<br>
--- branches/soc-2007-joeedh/source/blender/blenkernel/intern/tcs_cache.c &nbsp; &nbsp; &nbsp; 2008-08-20 21:34:49 UTC (rev 16200)<br>
+++ branches/soc-2007-joeedh/source/blender/blenkernel/intern/tcs_cache.c &nbsp; &nbsp; &nbsp; 2008-08-21 07:59:18 UTC (rev 16201)<br>
@@ -104,7 +104,7 @@<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;tile-&gt;pool-&gt;memused -= tile-&gt;struct_overhead;<br>
<br>
- &nbsp; &nbsp; &nbsp; /*add tile&#39;s file position to tile if in fixed tilesize mode.*/<br>
+ &nbsp; &nbsp; &nbsp; /*add tile&#39;s file position to the pool if in fixed tilesize mode.*/<br>
 &nbsp; &nbsp; &nbsp; &nbsp;if (tile-&gt;pool-&gt;flag &amp; TCS_POOL_TSIZEFIXED) {<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TCS_FileTileRef *ref = MEM_callocN(sizeof(TCS_POOL_TSIZEFIXED), &quot;TCS_POOL_TSIZEFIXED&quot;);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ref-&gt;file = tile-&gt;file;<br>
@@ -554,8 +554,8 @@<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TCS_fwrite(&amp;tile-&gt;compressed_memfile-&gt;length, sizeof(unsigned long), 1, tile-&gt;file);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TCS_fwrite(tile-&gt;compressed_memfile-&gt;ptr, tile-&gt;compressed_memfile-&gt;length, 1, tile-&gt;file);<br>
<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /*if TCS_POOL_TSIZEFIXED is set, then we have to ensure the entire uncompressed<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tile region on the disk is reserved, even if it&#39;s not used.*/<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /*if TCS_POOL_TSIZEFIXED is set, then we have to ensure all the diskspace up to<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pool-&gt;tilesize (the maxumum tile size in bytes) is in use.*/<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (pool-&gt;flag &amp; TCS_POOL_TSIZEFIXED) {<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;int diff = pool-&gt;tilesize - tile-&gt;compressed_memfile-&gt;length;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;int i, zero=0;<br>
<br>
Modified: branches/soc-2007-joeedh/source/blender/blenkernel/intern/tcs_image.c<br>
===================================================================<br>
--- branches/soc-2007-joeedh/source/blender/blenkernel/intern/tcs_image.c &nbsp; &nbsp; &nbsp; 2008-08-20 21:34:49 UTC (rev 16200)<br>
+++ branches/soc-2007-joeedh/source/blender/blenkernel/intern/tcs_image.c &nbsp; &nbsp; &nbsp; 2008-08-21 07:59:18 UTC (rev 16201)<br>
@@ -24,6 +24,352 @@<br>
 &nbsp;* ***** END GPL/BL DUAL LICENSE BLOCK *****<br>
 &nbsp;*/<br>
<br>
+#include &quot;BKE_imagebuffer.h&quot;<br>
+#include &quot;MEM_guardedalloc.h&quot;<br>
+<br>
+#include &lt;stdio.h&gt;<br>
+#include &lt;stdlib.h&gt;<br>
+#include &lt;string.h&gt;<br>
+#include &lt;math.h&gt;<br>
+<br>
+#if USEIMAGEBUFFER<br>
+<br>
+static TCS_TilePool *img_float_pool = NULL;<br>
+static TCS_TilePool *img_byte_pool = NULL;<br>
+<br>
+static void tcsimage_pools_check(void)<br>
+{<br>
+ &nbsp; &nbsp; &nbsp; if (img_float_pool == NULL)<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; img_float_pool = TCS_MakeFixedPool(TCSIMAGE_MAXMEM, &quot;float_image_cache&quot;,<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TCSIMAGE_MAX_TILESIZE*TCSIMAGE_MAX_TILESIZE*sizeof(float)*TCSIMAGE_MAX_TOTCHANNELS);<br>
+<br>
+ &nbsp; &nbsp; &nbsp; if (img_byte_pool == NULL)<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; img_byte_pool = TCS_MakeFixedPool(TCSIMAGE_MAXMEM, &quot;byte_image_cache&quot;,<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TCSIMAGE_MAX_TILESIZE*TCSIMAGE_MAX_TILESIZE*TCSIMAGE_MAX_TOTCHANNELS);<br>
+}<br>
+<br>
+static int tilesize_table[2] = {sizeof(float), 1};<br>
+<br>
+static void tcs_imagetile_loadfromcache(TCS_Tile *self, TCS_File *file) {<br>
+ &nbsp; &nbsp; &nbsp; TCS_ImageTile *tile = (TCS_ImageTile*) self;<br>
+ &nbsp; &nbsp; &nbsp; tile-&gt;data.c = MEM_mallocN(tilesize_table[tile-&gt;type]*tile-&gt;sizex*tile-&gt;sizey*tile-&gt;totchannels, &quot;image tile&quot;);<br>
+ &nbsp; &nbsp; &nbsp; TCS_fread(tile-&gt;data.c, tilesize_table[tile-&gt;type], tile-&gt;sizex*tile-&gt;sizey*tile-&gt;totchannels, file);<br>
+}<br>
+<br>
+static unsigned int tcs_imagetile_savetocache(TCS_Tile *self, TCS_File *file, unsigned long current_position)<br>
+{<br>
+ &nbsp; &nbsp; &nbsp; TCS_ImageTile *tile = (TCS_ImageTile*) self;<br>
+ &nbsp; &nbsp; &nbsp; TCS_fwrite(tile-&gt;data.c, tilesize_table[tile-&gt;type], tile-&gt;sizex*tile-&gt;sizey*tile-&gt;totchannels, file);<br>
+ &nbsp; &nbsp; &nbsp; return tilesize_table[tile-&gt;type]*tile-&gt;sizex*tile-&gt;sizey*tile-&gt;totchannels;<br>
+}<br>
+<br>
+static void tcs_imagetile_freedata(TCS_Tile *self)<br>
+{<br>
+ &nbsp; &nbsp; &nbsp; TCS_ImageTile *tile = (TCS_ImageTile*) self;<br>
+ &nbsp; &nbsp; &nbsp; MEM_freeN(tile-&gt;data.c);<br>
+ &nbsp; &nbsp; &nbsp; tile-&gt;data.c = NULL;<br>
+}<br>
+<br>
+static unsigned int tcs_imagetile_getlen(TCS_Tile *self)<br>
+{<br>
+ &nbsp; &nbsp; &nbsp; TCS_ImageTile *tile = (TCS_ImageTile*) self;<br>
+ &nbsp; &nbsp; &nbsp; return tilesize_table[tile-&gt;type]*tile-&gt;sizex*tile-&gt;sizey*tile-&gt;totchannels;<br>
+}<br>
+<br>
+TCS_TileType imagetile_type = {<br>
+ &nbsp; &nbsp; &nbsp; tcs_imagetile_loadfromcache,<br>
+ &nbsp; &nbsp; &nbsp; tcs_imagetile_savetocache,<br>
+ &nbsp; &nbsp; &nbsp; tcs_imagetile_freedata,<br>
+ &nbsp; &nbsp; &nbsp; tcs_imagetile_getlen<br>
+};<br>
+<br>
+/*only frees direct data*/<br>
+static void tcsimage_freebuffer(TCS_TileBuffer *self)<br>
+{<br>
+ &nbsp; &nbsp; &nbsp; TCS_Image *img = (TCS_Image*) self;<br>
+ &nbsp; &nbsp; &nbsp; int x, y;<br>
+<br>
+ &nbsp; &nbsp; &nbsp; for (x=0; x&lt;img-&gt;tilex; x++) {<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for (y=0; y&lt;img-&gt;tiley; y++) {<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TCS_UnlinkTile(&amp;img-&gt;tilerect[y*img-&gt;tilex+x]);<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MEM_freeN(img-&gt;tilerect[y*img-&gt;tilex+x].data.c);<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
+ &nbsp; &nbsp; &nbsp; }<br>
+ &nbsp; &nbsp; &nbsp; MEM_freeN(img-&gt;tilerect);<br>
+}<br>
+<br>
+static void *tcsimage_get_tile(TCS_TileBuffer *self, int x, int y, int z)<br>
+{<br>
+ &nbsp; &nbsp; &nbsp; TCS_Image *img = (TCS_Image*) self;<br>
+<br>
+ &nbsp; &nbsp; &nbsp; return &amp;img-&gt;tilerect[y*img-&gt;tilex+x];<br>
+}<br>
+<br>
+static int tcsimage_get_tile_size(TCS_TileBuffer *self)<br>
+{<br>
+ &nbsp; &nbsp; &nbsp; return TCSIMAGE_MAX_TILESIZE;<br>
+}<br>
+<br>
+static int tcsimage_get_sizex(TCS_TileBuffer *self)<br>
+{<br>
+ &nbsp; &nbsp; &nbsp; TCS_Image *img = (TCS_Image*) self;<br>
+<br>
+ &nbsp; &nbsp; &nbsp; return img-&gt;sizex;<br>
+}<br>
+<br>
+static int tcsimage_get_sizey(TCS_TileBuffer *self)<br>
+{<br>
+ &nbsp; &nbsp; &nbsp; TCS_Image *img = (TCS_Image*) self;<br>
+<br>
+ &nbsp; &nbsp; &nbsp; return img-&gt;sizey;<br>
+}<br>
+<br>
+TCS_TileBuffer TCSImageBufferType = {<br>
+ &nbsp; &nbsp; &nbsp; NULL, NULL,<br>
+ &nbsp; &nbsp; &nbsp; NULL,<br>
+ &nbsp; &nbsp; &nbsp; tcsimage_freebuffer,<br>
+ &nbsp; &nbsp; &nbsp; tcsimage_get_tile,<br>
+ &nbsp; &nbsp; &nbsp; tcsimage_get_tile_size,<br>
+ &nbsp; &nbsp; &nbsp; tcsimage_get_tile_size,<br>
+ &nbsp; &nbsp; &nbsp; tcsimage_get_sizex,<br>
+ &nbsp; &nbsp; &nbsp; tcsimage_get_sizey,<br>
+ &nbsp; &nbsp; &nbsp; 0,<br>
+ &nbsp; &nbsp; &nbsp; NULL<br>
+};<br>
+<br>
+TCS_TilePool **pools_table[2] = {&amp;img_float_pool, &amp;img_byte_pool};<br>
+<br>
+/*note: initcolor is allowed to be NuLL*/<br>
+TCS_Image *TCSImage_newImage(int sizex, int sizey, int type, int totchannels, void *initcolor)<br>
+{<br>
+ &nbsp; &nbsp; &nbsp; TCS_Image *img = MEM_callocN(sizeof(TCS_Image), &quot;TCS_Image&quot;);<br>
+ &nbsp; &nbsp; &nbsp; TCS_ImageTile *tile;<br>
+ &nbsp; &nbsp; &nbsp; float fac;<br>
+ &nbsp; &nbsp; &nbsp; int x, y, a;<br>
+<br>
+ &nbsp; &nbsp; &nbsp; img-&gt;sizex = sizex;<br>
+ &nbsp; &nbsp; &nbsp; img-&gt;sizey = sizey;<br>
+ &nbsp; &nbsp; &nbsp; img-&gt;tilex = sizex / TCSIMAGE_MAX_TILESIZE;<br>
+ &nbsp; &nbsp; &nbsp; img-&gt;tiley = sizey / TCSIMAGE_MAX_TILESIZE;<br>
+ &nbsp; &nbsp; &nbsp; img-&gt;type = type;<br>
+ &nbsp; &nbsp; &nbsp; img-&gt;totchannels = totchannels;<br>
+ &nbsp; &nbsp; &nbsp; TCS_InitBuffer(&amp;TCSImageBufferType, img);<br>
+<br>
+ &nbsp; &nbsp; &nbsp; tcsimage_pools_check();<br>
+ &nbsp; &nbsp; &nbsp; img-&gt;buffer.pool = *pools_table[type];<br>
+<br>
+ &nbsp; &nbsp; &nbsp; if (totchannels &gt; TCSIMAGE_MAX_TOTCHANNELS) {<br>
<br>
@@ Diff output truncated at 10240 characters. @@<br>
<br>
_______________________________________________<br>
Bf-blender-cvs mailing list<br>
<a href="mailto:Bf-blender-cvs@blender.org">Bf-blender-cvs@blender.org</a><br>
<a href="http://lists.blender.org/mailman/listinfo/bf-blender-cvs" target="_blank">http://lists.blender.org/mailman/listinfo/bf-blender-cvs</a><br>
</blockquote></div><br></div>