34 int NbPlaneToRead,
unsigned int Lg) :
41 computePrefix(AFilename);
43 if (NbPlaneToRead == 0)
44 if (FPrefix == AFilename)
62 void CImage3dMagick::computePrefix(
const std::string & AFileName)
64 assert(AFileName.length()!=0);
68 std::string::size_type pos = FPrefix.find(
"%");
70 if (pos != std::string::npos)
72 char tmp[9+int(FLg/10)];
73 sprintf(tmp,
"%%0%dd",FLg);
74 FPrefix.replace(pos,1, tmp);
81 char * chaine =
new char[FPrefix.length()+int(FLg/10)+1];
83 FActuPlane =
new Magick::Image;
87 FActuPlane->read(chaine);
89 catch( Magick::Exception &error_ )
97 if (FPrevPlane == NULL)
99 FWidth = FActuPlane->columns();
101 std::cout <<
"taille d'une plaque : "
105 assert(FActuPlane->columns() ==
FWidth );
106 assert(FActuPlane->rows () ==
FHeight);
113 unsigned int Ax2,
unsigned int Ay2,
bool Az2)
117 (Az1 ? FActuPlane : FPrevPlane)->pixelColor(Ax1,Ay1) ==
118 (Az2 ? FActuPlane : FPrevPlane)->pixelColor(Ax2,Ay2);
123 int ARed,
int AGreen,
int ABlue,
int AAlpha)
const
125 return (Az ? FActuPlane : FPrevPlane)->pixelColor(Ax,Ay) ==
126 Magick::Color(ARed, AGreen, ABlue, AAlpha);
134 Magick::Image * & plane = AActuPlane ? FActuPlane : FPrevPlane;
145 FPrevPlane = FActuPlane;