Main Page   Modules   Class Hierarchy   Compound List   File List   Compound Members   Related Pages   Examples  

ByteKernel.cpp

00001 /* Copyright (c) 2001 C. Grigorescu */
00002 
00003 #include "imlib_io.h"
00004 #include "ByteKernel.h"
00005 
00006 ByteKernel::ByteKernel(BYTE_KERNEL_TYPE kernel_type=CROSS_3x3, char *name = "") :
00007  Kernel< byte >(name) 
00008 {
00009   makeImage(3,3);
00010    for (int i=0;i<getSize();i++)
00011      pixels[0][i] = ON;
00012    switch(kernel_type) {
00013    case CROSS_3x3:
00014      pixels[0][0] = OFF;
00015      pixels[0][2] = OFF;
00016      pixels[2][0] = OFF;
00017      pixels[2][2] = OFF;
00018      break;
00019    case DISK_3x3:
00020      break;
00021    default: ;
00022    }     
00023 }  
00024 
00025 ByteKernel &ByteKernel::operator!(void)
00026 {
00027   for (int i=0;i<getSize();i++)
00028     if (pixels[0][i] == ON) 
00029       pixels[0][i] = OFF;
00030     else
00031       pixels[0][i] = ON;
00032   return (*this);
00033 }
00034 
00035 
00036 
00037