bool SameType(const ImageBase& Img1, const ImageBase& Img2) { return (Img1.IsFloat() == Img2.IsFloat() && Img1.IsUnsigned() == Img2.IsUnsigned() && Img1.Depth() == Img2.Depth() && Img1.NbChannels() == Img2.NbChannels()); }
void CheckSizeAndType(const ImageBase& Img1, const ImageBase& Img2) { CheckCompatibility(Img1, Img2); if (Img1.Depth() != Img2.Depth()) throw cl::Error(CL_INVALID_VALUE, "Different image depth used"); if (Img1.IsUnsigned() != Img2.IsUnsigned()) throw cl::Error(CL_INVALID_VALUE, "Different image types used"); }
void CheckCompatibility(const ImageBase& Img1, const ImageBase& Img2) { CheckSameSize(Img1, Img2); if (Img1.IsFloat() != Img2.IsFloat()) throw cl::Error(CL_INVALID_VALUE, "Different image types used"); if (Img1.IsUnsigned() != Img2.IsUnsigned()) throw cl::Error(CL_INVALID_VALUE, "Different image types used"); }