81 static bool firsttime =
true;
85 cerr <<
"unable to load stroke textures" << endl;
112 float *rgb =
new float[3 *
w * h];
113 memset(rgb, 0,
sizeof(
float[3]) *
w * h);
116 if (_pass_diffuse.buf) {
117 int xmin =
border().getMin().x();
118 int ymin =
border().getMin().y();
119 int xmax =
border().getMax().x();
120 int ymax =
border().getMax().y();
121 int rectx = _pass_diffuse.width;
122 int recty = _pass_diffuse.height;
123 float xfac =
float(rectx) /
float(xmax - xmin);
124 float yfac =
float(recty) /
float(ymax - ymin);
127 printf(
"readColorPixels %d x %d @ (%d, %d) in %d x %d [%d x %d] -- %d x %d @ %d%%\n",
142 for (
int j = 0; j < h; j++) {
143 jj =
int((y - ymin + j) * yfac);
144 if (jj < 0 || jj >= recty) {
147 for (
int i = 0; i <
w; i++) {
148 ii =
int((x - xmin + i) * xfac);
149 if (ii < 0 || ii >= rectx) {
152 memcpy(rgb + (
w * j + i) * 3, _pass_diffuse.buf + (rectx * jj + ii) * 3,
sizeof(
float[3]));
156 oImage.
setArray(rgb, xsch, ysch,
w, h, x, y,
false);
161 float *
z =
new float[
w * h];
162 memset(
z, 0,
sizeof(
float) *
w * h);
166 int xmin =
border().getMin().x();
167 int ymin =
border().getMin().y();
168 int xmax =
border().getMax().x();
169 int ymax =
border().getMax().y();
170 int rectx = _pass_z.width;
171 int recty = _pass_z.height;
172 float xfac =
float(rectx) /
float(xmax - xmin);
173 float yfac =
float(recty) /
float(ymax - ymin);
176 printf(
"readDepthPixels %d x %d @ (%d, %d) in %d x %d [%d x %d] -- %d x %d @ %d%%\n",
191 for (
int j = 0; j < h; j++) {
192 jj =
int((y - ymin + j) * yfac);
193 if (jj < 0 || jj >= recty) {
196 for (
int i = 0; i <
w; i++) {
197 ii =
int((x - xmin + i) * xfac);
198 if (ii < 0 || ii >= rectx) {
201 z[
w * j + i] = _pass_z.buf[rectx * jj + ii];
205 oImage.
setArray(
z, xsch, ysch,
w, h, x, y,
false);
The spinal tap of the system.
Class to encapsulate an array of RGB or Gray level values.
Classes to render a stroke with OpenGL.
Class representing a style module.
Class defining a singleton used as timestamp.
SIMD_FORCE_INLINE const btScalar & z() const
Return the z value.
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
virtual void readDepthPixels(int x, int y, int w, int h, GrayImage &oImage) const
virtual BBox< Vec2i > border() const
void setViewer(AppView *iViewer)
virtual void RenderStroke(Stroke *)
virtual BBox< Vec3r > scene3DBBox() const
virtual void readColorPixels(int x, int y, int w, int h, RGBImage &oImage) const
virtual float thickness() const
BBox< Vec3r > scene3DBBox() const
std::deque< StrokeLayer * > _Layers
std::deque< StyleModule * > _StyleModules
static const char * _MapsPath
StrokeRenderer * _Renderer
const string & getMapsDir() const
static Path * getInstance()
void setArray(float *lvl, uint width, uint height, uint sw, uint sh, uint x, uint y, bool copy=true)
virtual void setArray(float *rgb, uint width, uint height, uint sw, uint sh, uint x, uint y, bool copy=true)
static bool loadTextures()
void Render(const StrokeRenderer *iRenderer)
void RenderBasic(const StrokeRenderer *iRenderer)
draw_view in_light_buf[] float
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