[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [10822] branches/soc-2007-joeedh/source/ blender/blenkernel/BKE_tile.h: Soc-2007-joeedh

Joseph Eagar joeedh at gmail.com
Thu May 31 04:25:02 CEST 2007


Revision: 10822
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=10822
Author:   joeedh
Date:     2007-05-31 04:24:34 +0200 (Thu, 31 May 2007)

Log Message:
-----------
Soc-2007-joeedh

First test commit.  Added the header file containing a rough
draft of the new caching tiling system.

Added Paths:
-----------
    branches/soc-2007-joeedh/source/blender/blenkernel/BKE_tile.h

Added: branches/soc-2007-joeedh/source/blender/blenkernel/BKE_tile.h
===================================================================
--- branches/soc-2007-joeedh/source/blender/blenkernel/BKE_tile.h	                        (rev 0)
+++ branches/soc-2007-joeedh/source/blender/blenkernel/BKE_tile.h	2007-05-31 02:24:34 UTC (rev 10822)
@@ -0,0 +1,99 @@
+/*  BKE_tile.h   May 2007
+ *  
+ *  Blender kernel action functionality
+ *
+ *	Reevan McKay
+ *
+ * $Id: BKE_action.h 8825 2006-11-11 16:45:17Z ton $
+ *
+ * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. The Blender
+ * Foundation also sells licenses for use in proprietary software under
+ * the Blender License.  See http://www.blender.org/BL/ for information
+ * about this.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * Contributor(s): Joseph Eagar, created 2007
+ *
+ * ***** END GPL/BL DUAL LICENSE BLOCK *****
+ */
+ #ifndef BKE_TILE_H
+ #define BKE_TILE_H
+ 
+ #include "DNA_listBase.h"
+ 
+ /*Tile caching interface.  Tile caches are  grouped in "pools", which can
+   contain generic tiles of any tile cache type.  Tiles are generic data
+   holding structures.  Module prefix is TCS, for Tile Cache System*/
+ 
+struct TCS_Tile;
+struct TCS_TilePool;
+struct TCS_TileBuffer;
+ 
+typedef struct TCS_Tile {
+	struct TCS_Tile *next, *prev;
+	void (*loadFromCache)(struct TCS_Tile *self, struct FILE *file, unsigned long start);
+	
+	/*returns length*/
+	unsigned int (*saveToCache(struct TCS_Tile *self, struct FILE *file, unsigned long current_position);
+	int is_cached;
+	struct TCS_TilePool *pool;
+	struct TCS_TileBuffer *buffer; /*parent buffer*/
+ } TCS_Tile;
+ 
+ /*pools manage tiles, but the the tiles themselves belong to TCS_TileBuffers
+   this is a generic container structure.*/
+ typedef struct TCS_TilePool {
+	struct TCS_TilePool *next, *prev;
+	ListBase tiles;
+	
+	unsigned int tottiles;
+	unsigned long maxmem;
+ } TCS_TilePool;
+ 
+ typedef struct TCS_TileBuffer {
+	struct TCS_TileBuffer *next, *prev;
+	void (*makeTiles)(TCS_TileBuffer *self, TCS_TilePool *cachepool);
+	void (*freeBuffer)(TCS_TileBuffer *self);
+
+	/*as may dimensions can be used as needed, others can just be passed in as 0.*/
+	void (*getTile)(TCS_TileBuffer *self, int x, int y, int z);
+	void (*getTileMemUsage)(TCS_TileBuffer *self, int x, int y, int z);
+	TCS_TilePool *pool;
+ } TCS_TileBuffer;
+
+/*buffer type templates*/
+extern TCS_TileBuffer	TCS_FloatImageBuffer;
+extern TCS_TileBuffer	TCS_UByteImageBuffer;
+extern TCS_TileBuffer	TCS_IrregularBufferCell;
+
+TCS_TilePool *TCS_MakePool(unsigned long max_mem_bytes);
+void TCS_FreePool(TCS_TilePool *pool);
+TCS_TileBuffer *TCS_MakeBuffer(TCS_TileBuffer *type, void *data);
+void TCS_FreeBuffer(TCS_TileBuffer *type);
+
+/*as may dimensions can be used as needed, others can just be passed in as 0.*/
+void *TCS_GetTile(TCS_TileBuffer *type, int x, int y, int z);
+
+/*hrm, not sure if this next one will be needed, its possible it can
+  all be done from within TCS_GetTile()*/
+void TCS_RunCacher(TCS_TilePool *pool);
+void TCS_SetCacheLimit(TCS_TilePoolt *pool, unsigned long max_mem_bytes);
+
+
+ #endif /* BKE_TILE_H */
\ No newline at end of file





More information about the Bf-blender-cvs mailing list