Esempio n. 1
0
void Structure::Resize( int sz )
{
   sz = Max( 3, sz|1 );

   if ( sz != Size() )
   {
      for ( int w = 0; w < NumberOfWays(); ++w )
      {
         ByteArray b;
         b.Add( uint8( 0 ), sz*sz );

         if ( sz > Size() )
         {
            for ( int y = 0, d = (sz - Size()) >> 1; y < Size(); ++y )
               for ( int x = 0; x < Size(); ++x )
                  if ( Element( w, x, y ) )
                     b[(y+d)*sz + x+d] = 1;
         }
         else
         {
            for ( int y = 0, d = (Size() - sz) >> 1; y < sz; ++y )
               for ( int x = 0; x < sz; ++x )
                  if ( Element( w, x+d, y+d ) )
                     b[y*sz + x] = 1;
         }

         mask[w] = b;
      }

      size = sz;
   }
Esempio n. 2
0
void buffer_append_char(buffer inBuffer,int inChar)
{
   ByteArray b = (ByteArray)inBuffer;
   b->Add(inChar);
}