예제 #1
0
파일: bounds.hpp 프로젝트: nabePi/FLIF
 void minmax(const int p, const prevPlanes &pp, ColorVal &min, ColorVal &max) const {
     assert(p<numPlanes());
     if (p==0 || p==3) { min=bounds[p].first; max=bounds[p].second; return; } // optimization for special case
     ranges->minmax(p, pp, min, max);
     if (min < bounds[p].first) min=bounds[p].first;
     if (max > bounds[p].second) max=bounds[p].second;
     if (min>max) {
        // should happen only if alpha=0 interpolation produces YI combination for which Q range from ColorRangesYIQ is outside bounds
        min=bounds[p].first;
        max=bounds[p].second;
     }
     assert(min <= max);
 }
예제 #2
0
파일: BspSceneFile.cpp 프로젝트: dholm/3DZ
	bool BspSceneFile::loadPlanes(std::istream& bspStream, const Q3Bsp::DirEntry& planesEntry) {
		if (!bspStream.seekg(planesEntry.offset, std::ios::beg)) {
			return false;
		}
		
		std::size_t numPlanes(planesEntry.length / sizeof(Q3Bsp::Plane));
		m_planes.reserve(numPlanes);
		
		if (!bspStream.read(reinterpret_cast<char*>(&m_planes[0]), planesEntry.length)) {
			return false;
		}
		return true;
	}
예제 #3
0
 ColorVal max(int p) const override { if (p >= numPlanes()) return 0; assert(p<numPlanes()); return ranges[p].second; }
예제 #4
0
 ColorVal min(int p) const override { if (p >= numPlanes()) return 0; assert(p<numPlanes()); return ranges[p].first; }
예제 #5
0
파일: bounds.hpp 프로젝트: nabePi/FLIF
 ColorVal max(int p) const { assert(p<numPlanes()); return std::min(ranges->max(p), bounds[p].second); }
예제 #6
0
파일: bounds.hpp 프로젝트: nabePi/FLIF
 ColorVal min(int p) const { assert(p<numPlanes()); return std::max(ranges->min(p), bounds[p].first); }