<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><style></style><div><font size="2" face="Arial">thanks a lot for help. But is there anyway at all 
to use the same picture for texture, but reduce the memory cost? perhaps at the 
cost of slower rendering?</font></div>
<div><font size="2" face="Arial"></font>&nbsp;</div>
<div><font size="2" face="Arial">thanks<br><br>tracy<br><br><br><br></font><pre>Assuming your image is one component and a component takes one byte:<br>11083x823/1024/1024=8.7MB.<br>If you have three components (RGB), this is 26.1MB (close to 30MB).<br><br>So, I guess your 1015KB is actually the size of the compressed jpg file...<br><br><br>On Fri, Feb 20, 2009 at 3:16 PM, Tracy Hu &lt;<a href="http://www.vtk.org/mailman/listinfo/vtkusers">tracy.hu at yahoo.com</a>&gt; wrote:<br>&gt;<i> I wrote simple code as following to decide how much memory a vtkTexture<br></i>&gt;<i> would result.<br></i>&gt;<i> without using texture (by commenting out the line<br></i>&gt;<i> "actor-&gt;SetTexture(pTexture)" ), the process takes 74MB memory,<br></i>&gt;<i> using texture(by uncommenting the line "actor-&gt;SetTexture(pTexture)" ), the<br></i>&gt;<i> process takes 105MB memory.<br></i>&gt;<i> the dimension of picture FOREST011.jpg is 11083 X 823, and takes
 1,015KB<br></i>&gt;<i><br></i>&gt;<i> Can somebody give me any idea what's going on, or how to avoid this memory<br></i>&gt;<i> expense?<br></i>&gt;<i><br></i>&gt;<i> thanks a lot<br></i>&gt;<i> Tracy<br></i>&gt;<i><br></i>&gt;<i> int main_vtk(int argc, char* argv[])<br></i>&gt;<i> {<br></i>&gt;<i>     vtkJPEGReader* pJPEGReader = vtkJPEGReader::New();<br></i>&gt;<i>         pJPEGReader-&gt;SetFileName("D:\\FOREST011.jpg");<br></i>&gt;<i>         pJPEGReader-&gt;ReleaseDataFlagOn();<br></i>&gt;<i>     vtkTexture* pTexture = vtkTexture::New();<br></i>&gt;<i>         pTexture-&gt;SetInputConnection(pJPEGReader-&gt;GetOutputPort());<br></i>&gt;<i>         pTexture-&gt;InterpolateOn();<br></i>&gt;<i>         pTexture-&gt;ReleaseDataFlagOn();<br></i>&gt;<i>     pJPEGReader-&gt;Delete();<br></i>&gt;<i><br></i>&gt;<i>     vtkSphereSource *sphere = vtkSphereSource::New();<br></i>&gt;<i>     vtkPolyDataMapper *mapper = vtkPolyDataMapper::New();<br></i>&gt;<i>   
      mapper-&gt;SetInputConnection(sphere-&gt;GetOutputPort());<br></i>&gt;<i>         mapper-&gt;ScalarVisibilityOff();<br></i>&gt;<i>     vtkActor *actor = vtkActor::New();<br></i>&gt;<i>         actor-&gt;SetMapper(mapper);<br></i>&gt;<i>         actor-&gt;GetProperty()-&gt;SetColor(0.0, 0.0, 1.0);<br></i>&gt;<i>         actor-&gt;SetTexture(pTexture);<br></i>&gt;<i><br></i>&gt;<i>     vtkRenderer* ren = vtkRenderer::New();<br></i>&gt;<i>         ren-&gt;SetBackground(1, 1, 1);<br></i>&gt;<i>         ren-&gt;AddActor(actor);<br></i>&gt;<i><br></i>&gt;<i>     vtkRenderWindow* renWin = vtkRenderWindow::New();<br></i>&gt;<i>         renWin-&gt;AddRenderer(ren);<br></i>&gt;<i><br></i>&gt;<i>     vtkRenderWindowInteractor* iren = vtkRenderWindowInteractor::New();<br></i>&gt;<i>         iren-&gt;SetRenderWindow(renWin);<br></i>&gt;<i>     vtkInteractorStyleTrackballCamera *style =<br></i>&gt;<i> vtkInteractorStyleTrackballCamera::New();<br></i>&gt;<i>     
    iren-&gt;SetInteractorStyle(style);<br></i>&gt;<i><br></i>&gt;<i>     renWin-&gt;SetSize(600,600);<br></i>&gt;<i>     renWin-&gt;SetPosition(600, 100);<br></i>&gt;<i>     renWin-&gt;Render();<br></i>&gt;<i><br></i>&gt;<i>     iren-&gt;Initialize();<br></i>&gt;<i>     iren-&gt;Start();<br></i>&gt;<i><br></i>&gt;<i>     return 0;<br></i>&gt;<i> }<br></i>&gt;<i><br></i>&gt;<i><br></i>&gt;<i><br></i>&gt;<i> _______________________________________________<br></i>&gt;<i> Powered by www.kitware.com<br></i>&gt;<i><br></i>&gt;<i> Visit other Kitware open-source projects at<br></i>&gt;<i> <a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br></i>&gt;<i><br></i>&gt;<i> Please keep messages on-topic and check the VTK FAQ at:<br></i>&gt;<i> <a href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a><br></i>&gt;<i><br></i>&gt;<i> Follow this link to
 subscribe/unsubscribe:<br></i>&gt;<i> <a href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a><br></i>&gt;<i><br></i>&gt;<i><br></i><br><br><br>-- <br>François Bertel, PhD  | Kitware Inc. Suite 204<br>1 (518) 371 3971 x113 | 28 Corporate Drive<br>                      | Clifton Park NY 12065, USA<br></pre>

<!--endarticle-->
    <br></div></td></tr></table><br>