84 for (map<uint, double *>::iterator m =
_mapping.begin(), mend =
_mapping.end(); m != mend; ++m)
115 map<uint, double *>::iterator o =
_mapping.find(
id);
124 Vec2r o2d2(o2d3.
x(), o2d3.
y());
160 map<uint, double *>::iterator o =
_mapping.find(
id);
162 double *wvalues = (*o).second;
166 double w = wvalues[i];
200 cout <<
"Warning: this steerable ViewMap level doesn't exist" << endl;
204 if ((x < 0) || (x >= pyramid->
width()) || (y < 0) || (y >= pyramid->
height())) {
212 float v = pyramid->
pixel(x, pyramid->
height() - 1 - y, iLevel) / 32.0f;
233 cerr <<
"SteerableViewMap warning: orientation " << i
234 <<
" of steerable View Map whas not been computed yet" << endl;
241 string base(
"SteerableViewMap");
242 stringstream filepath;
248 int rowbytes = ow * 4;
251 for (
int y = 0; y < oh; ++
y) {
252 for (
int x = 0; x < ow; ++
x) {
261 pix[0] = pix[1] = pix[2] =
c;
267 filepath << i <<
"-" << j <<
".png";
269 IMB_saveiff(ibuf,
const_cast<char *
>(filepath.str().c_str()), 0);
272 QString base(
"SteerableViewMap");
275 int ow = img->
width();
278 QImage qtmp(ow, oh, 32);
279 for (
uint y = 0; y < oh; ++
y) {
280 for (
uint x = 0; x < ow; ++
x) {
286 qtmp.setPixel(x, y, qRgb(
c,
c,
c));
289 qtmp.save(base + QString::number(i) +
"-" + QString::number(j) +
".png",
"PNG");
Vectors and Matrices (useful type definitions)
Contains defines and structs used throughout the imbuf module.
Class to represent a pyramid of images.
Class to encapsulate an array of RGB or Gray level values.
Classes to define a silhouette structure.
Convenient access to the steerable ViewMap to which any element of the ViewMap belongs to.
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
SIMD_FORCE_INLINE btScalar norm() const
Return the norm (length) of the vector.
Vec3r orientation2d() const
float pixel(uint x, uint y) const
virtual float pixel(int x, int y, int level=0)
virtual GrayImage * getLevel(int l)
int getNumberOfLevels() const
virtual int height(int level=0)
virtual int width(int level=0)
double * AddFEdge(FEdge *iFEdge)
uint getSVMNumber(Vec2f dir)
float readCompleteViewMapPixel(int iLevel, int x, int y)
uint getNumberOfPyramidLevels() const
SteerableViewMap(uint nbOrientations=4)
map< uint, double * > _mapping
vector< Vec2d > _directions
virtual ~SteerableViewMap()
double ComputeWeight(const Vec2d &dir, uint iNOrientation)
void saveSteerableViewMap() const
float readSteerableViewMapPixel(uint iOrientation, int iLevel, int x, int y)
ImagePyramid ** _imagesPyramids
void buildImagesPyramids(GrayImage **steerableBases, bool copy=false, uint iNbLevels=4, float iSigma=1.0f)
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
struct ImBuf * IMB_allocImBuf(unsigned int, unsigned int, unsigned char, unsigned int)
bool IMB_saveiff(struct ImBuf *, const char *, int)
ccl_device_inline float2 fabs(const float2 a)
ccl_device_inline float3 cos(float3 v)
static void copy(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node)
ImBufByteBuffer byte_buffer