Aug. 14, 2006
7:32 p.m.
Hi, I just realized that this question did actually not get sorted out. Now I'm just about to convert my code to compare arr.dtype.type to the (default scalar!) dtype numpy.uint8 like this: if self.img.dtype.type == N.uint8: self.hist_min, self.hist_max = 0, 1<<8 elif self.img.dtype.type == N.uint16: self.hist_min, self.hist_max = 0, 1<<16 ...
Yes, you can do this and it should work independent of byteorder. The dtype comparison will take into account the byte-order but comparing the type objects directly won't. So, if that is your intent, then great. -Travis