12 #include "../image/Image.h"
13 #include "../stroke/StrokeRenderer.h"
14 #include "../stroke/StyleModule.h"
15 #include "../system/TimeStamp.h"
17 #include "../system/StringUtils.h"
79 static bool firsttime =
true;
83 cerr <<
"unable to load stroke textures" << endl;
110 float *
rgb =
new float[3 *
w * h];
111 memset(
rgb, 0,
sizeof(
float[3]) *
w * h);
114 if (_pass_diffuse.buf) {
115 int xmin =
border().getMin().x();
116 int ymin =
border().getMin().y();
117 int xmax =
border().getMax().x();
118 int ymax =
border().getMax().y();
119 int rectx = _pass_diffuse.width;
120 int recty = _pass_diffuse.height;
121 float xfac = ((
float)rectx) / ((
float)(xmax - xmin));
122 float yfac = ((
float)recty) / ((
float)(ymax - ymin));
125 printf(
"readColorPixels %d x %d @ (%d, %d) in %d x %d [%d x %d] -- %d x %d @ %d%%\n",
136 (
int)(xfac * 100.0f));
140 for (
int j = 0; j < h; j++) {
141 jj = (int)((
y - ymin + j) * yfac);
142 if (jj < 0 || jj >= recty) {
145 for (
int i = 0; i <
w; i++) {
146 ii = (int)((
x - xmin + i) * xfac);
147 if (ii < 0 || ii >= rectx) {
150 memcpy(
rgb + (
w * j + i) * 3, _pass_diffuse.buf + (rectx * jj + ii) * 3,
sizeof(
float[3]));
159 float *
z =
new float[
w * h];
160 memset(
z, 0,
sizeof(
float) *
w * h);
164 int xmin =
border().getMin().x();
165 int ymin =
border().getMin().y();
166 int xmax =
border().getMax().x();
167 int ymax =
border().getMax().y();
168 int rectx = _pass_z.width;
169 int recty = _pass_z.height;
170 float xfac = ((
float)rectx) / ((
float)(xmax - xmin));
171 float yfac = ((
float)recty) / ((
float)(ymax - ymin));
174 printf(
"readDepthPixels %d x %d @ (%d, %d) in %d x %d [%d x %d] -- %d x %d @ %d%%\n",
185 (
int)(xfac * 100.0f));
189 for (
int j = 0; j < h; j++) {
190 jj = (int)((
y - ymin + j) * yfac);
191 if (jj < 0 || jj >= recty) {
194 for (
int i = 0; i <
w; i++) {
195 ii = (int)((
x - xmin + i) * xfac);
196 if (ii < 0 || ii >= rectx) {
199 z[
w * j + i] = _pass_z.buf[rectx * jj + ii];
typedef float(TangentPoint)[2]
The spinal tap of the system.
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble z
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
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
static Path * getInstance()
const string & getMapsDir() const
void setArray(float *lvl, unsigned width, unsigned height, unsigned sw, unsigned sh, unsigned x, unsigned y, bool copy=true)
virtual void setArray(float *rgb, unsigned width, unsigned height, unsigned sw, unsigned sh, unsigned x, unsigned y, bool copy=true)
static bool loadTextures()
void Render(const StrokeRenderer *iRenderer)
void RenderBasic(const StrokeRenderer *iRenderer)
static const pxr::TfToken rgb("rgb", pxr::TfToken::Immortal)