<div>vtkSmartPointer<vtkUnsignedCharArray> pixels = vtkUnsignedCharArray::SafeDownCast(image->GetPointData()->GetScalars()); // image is vtkImageData*</div><div>vesImage::Ptr vesimage = vesKiwiDataConversionTools::ImageFromPixels(pixels, width, height); // for given image width and height</div>
<div>texture->setImage(vesimage)<br><div><br></div><div><br><div class="gmail_quote">On Fri, Feb 15, 2013 at 9:38 PM, shamsudheen <span dir="ltr"><<a href="mailto:shamsutk87@gmail.com" target="_blank">shamsutk87@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi All,<div><br></div><div><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;display:inline!important;line-height:normal;text-transform:none;font-size:13px;white-space:normal;font-family:arial,sans-serif;word-spacing:0px"><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:normal;text-transform:none;font-size:13px;white-space:normal;font-family:arial,sans-serif;word-spacing:0px">Im using </span><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;display:inline!important;float:none;line-height:normal;text-transform:none;font-size:13px;white-space:normal;font-family:arial,sans-serif;word-spacing:0px"><b>vesKiwiViewerApp</b></span><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:normal;text-transform:none;font-size:13px;white-space:normal;font-family:arial,sans-serif;word-spacing:0px"> in my iOS application.</span></span></div>
<div><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;display:inline!important;line-height:normal;text-transform:none;font-size:13px;white-space:normal;font-family:arial,sans-serif;word-spacing:0px"><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:normal;text-transform:none;font-size:13px;white-space:normal;font-family:arial,sans-serif;word-spacing:0px"><br>
</span></span></div><div><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;display:inline!important;line-height:normal;text-transform:none;font-size:13px;white-space:normal;font-family:arial,sans-serif;word-spacing:0px"><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:normal;text-transform:none;font-size:13px;white-space:normal;font-family:arial,sans-serif;word-spacing:0px">I would like a add </span><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;display:inline!important;float:none;line-height:normal;text-transform:none;font-size:13px;white-space:normal;font-family:arial,sans-serif;word-spacing:0px"><b>Texture</b></span><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:normal;text-transform:none;font-size:13px;white-space:normal;font-family:arial,sans-serif;word-spacing:0px"> to my 3D model which is rendered through "</span><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;display:inline!important;float:none;line-height:normal;text-transform:none;font-size:13px;white-space:normal;font-family:arial,sans-serif;word-spacing:0px"><b> </b></span></span><span style="font-family:Menlo;font-size:11px"><b>bool loadDataset(const std::string& filename);"</b></span></div>
<div><span style="font-family:Menlo;font-size:11px"><b><br></b></span></div><div><font face="Arial" style="font-size:13px">I have found one method as " </font><span style="font-family:Menlo;font-size:11px"><b>void setTexture(vesSharedPtr<vesTexture> texture);" </b>in </span><span style="font-family:Menlo;font-size:11px"><b>vesKiwiPolyDataRepresentation </b>class.</span></div>
<div><span style="font-family:Menlo;font-size:11px"><br></span></div><div><font face="Arial"><font>However Im unable to create </font><b>vesImage </b>from my<b> </b><b>.jpg </b>texture image<b> </b>file<b>. </b></font></div>
<div><font face="Arial"><b><br></b></font></div><div><font face="Arial">Im looking some thing like<b> vtkPNGReader </b>in<b> VES.</b></font></div><div><font face="Arial"><b><br></b></font></div><div><font face="Arial">Any help on this is appreciated.</font></div>
<div><font face="Arial"><b><br></b></font></div><div><font face="Arial"><b>my code is</b></font></div><div><font face="Arial"><b><br></b></font></div><div><font face="Arial"><b><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Menlo">
<font color="#1b0e51"> vesKiwiPolyDataRepresentation* polyDataRepresentation = self->renderer.app->getKiwiPolyDataRepresentation(0);</font></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Menlo;min-height:13px">
<font color="#1b0e51"><br></font></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Menlo"><font color="#1b0e51"> vesSharedPtr<vesTexture> texture = polyDataRepresentation->texture();</font></div>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Menlo;min-height:13.0px"><font color="#1b0e51"> <br></font></p><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Menlo">
<font color="#1b0e51"> vesSharedPtr<vesImage> textureImage = </font><b><font color="#1b0e51"> </font>//here i would like create vesImage pointer from my texture-color.jpg file</b></div><p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Menlo;min-height:13.0px">
<font color="#1b0e51"> <br></font></p><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Menlo"><font color="#1b0e51"> texture->setImage(textureImage);</font></div>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Menlo;min-height:13.0px"><font color="#1b0e51"> <br></font></p><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Menlo">
<font color="#1b0e51"> polyDataRepresentation ->setTexture(texture);</font></div></b></font></div><div><font face="Arial"><b><br></b></font></div><div><font face="Arial"><b><br></b></font></div><div><font face="Arial" style="font-size:13px"><br>
</font></div><div><font face="Arial" style="font-size:13px"><br></font></div><div><font face="Arial" style="font-size:13px"><br></font></div><div><font face="Arial" style="font-size:13px"><br></font></div></div><br>_______________________________________________<br>
Ves mailing list<br>
<a href="mailto:Ves@public.kitware.com">Ves@public.kitware.com</a><br>
<a href="http://public.kitware.com/cgi-bin/mailman/listinfo/ves" target="_blank">http://public.kitware.com/cgi-bin/mailman/listinfo/ves</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>| Aashish Chaudhary <br>| R&D Engineer <br>| Kitware Inc. <br>| <a href="http://www.kitware.com">www.kitware.com</a>
</div></div>