#ifndef MXBLOCK2_INCLUDED // -*- C++ -*- #define MXBLOCK2_INCLUDED #if !defined(__GNUC__) # pragma once #endif /************************************************************************ MxBlock2 provides typed access to 2D data blocks. Copyright (C) 1998 Michael Garland. See "COPYING.txt" for details. $Id: MxBlock2.h,v 1.9 1998/10/26 21:08:41 garland Exp $ ************************************************************************/ #include "MxBlock.h" template class MxBlock2 : public MxBlock { private: uint W, H; protected: MxBlock2() { } void init_block(uint w, uint h) { W=w; H=h; MxBlock::init_block(w*h); } void resize_block(uint w, uint h) { W=w; H=h; MxBlock::resize_block(w*h); } T& raw(uint i, uint j) { return MxBlock::raw(j*W+i); } const T& raw(uint i, uint j) const { return MxBlock::raw(j*W+i); } #define __MXCK(i,j) AssertBound(i