HighTechTalks DotNet Forums  

What site contains the OctreeQuantizer code you'd recommend

Dotnet Framework (Drawing) microsoft.public.dotnet.framework.drawing


Discuss What site contains the OctreeQuantizer code you'd recommend in the Dotnet Framework (Drawing) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Academia
 
Posts: n/a

Default What site contains the OctreeQuantizer code you'd recommend - 11-30-2007 , 07:54 PM






Once I saw an implementation of OctreeQuantizer that did not require the
Unsafe keyword.

Now that I want it I can't find it.

Do you know how to find that site?

Also do you have a comment about reasons for using the "safe" or the
"unsafe" OctreeQuantizer code.



What site contains the code you'd recommend?





Thanks









Reply With Quote
  #2  
Old   
Bob Powell [MVP]
 
Posts: n/a

Default Re: What site contains the OctreeQuantizer code you'd recommend - 12-01-2007 , 05:57 AM






The article has been moved or deleted from MSDN. I wish those guys would
learn to keep reference links constant!

Here is another article on the same subject:
http://msdn2.microsoft.com/en-us/library/aa479306.aspx

The reason for using unsafe code in any graphics application is of course
speed. Direct access to memory via a pointer is guaranteed to be faster than
any other method and optimization of graphics processing is important.


--
--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.


"Academia" <academiaNOSPAM (AT) a-znet (DOT) com> wrote

Quote:
Once I saw an implementation of OctreeQuantizer that did not require the
Unsafe keyword.

Now that I want it I can't find it.

Do you know how to find that site?

Also do you have a comment about reasons for using the "safe" or the
"unsafe" OctreeQuantizer code.



What site contains the code you'd recommend?





Thanks










Reply With Quote
  #3  
Old   
Academia
 
Posts: n/a

Default Re: What site contains the OctreeQuantizer code you'd recommend - 12-01-2007 , 09:38 AM



I got it.

What's the down side of unsafe code for a Windows application?

Thanks

"Bob Powell [MVP]" <bob (AT) spamkillerbobpowell (DOT) net> wrote

Quote:
The article has been moved or deleted from MSDN. I wish those guys would
learn to keep reference links constant!

Here is another article on the same subject:
http://msdn2.microsoft.com/en-us/library/aa479306.aspx

The reason for using unsafe code in any graphics application is of course
speed. Direct access to memory via a pointer is guaranteed to be faster
than any other method and optimization of graphics processing is
important.


--
--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.


"Academia" <academiaNOSPAM (AT) a-znet (DOT) com> wrote in message
news:OsmuQ07MIHA.5720 (AT) TK2MSFTNGP04 (DOT) phx.gbl...
Once I saw an implementation of OctreeQuantizer that did not require the
Unsafe keyword.

Now that I want it I can't find it.

Do you know how to find that site?

Also do you have a comment about reasons for using the "safe" or the
"unsafe" OctreeQuantizer code.



What site contains the code you'd recommend?





Thanks












Reply With Quote
  #4  
Old   
Bob Powell [MVP]
 
Posts: n/a

Default Re: What site contains the OctreeQuantizer code you'd recommend - 12-01-2007 , 07:09 PM



In my opinion, the only possible downside to unsafe code is that the
requirement to understand the physical layout in memory of an object or data
structure is still of paramount importance whereas safe code takes that
responsibility away from the programmer and lightens the load.

For an old C++ programmer like me it's a useful and fast tool.

--
--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.


"Academia" <academiaNOSPAM (AT) a-znet (DOT) com> wrote

Quote:
I got it.

What's the down side of unsafe code for a Windows application?

Thanks

"Bob Powell [MVP]" <bob (AT) spamkillerbobpowell (DOT) net> wrote in message
news:77397E75-A709-4E8F-A8FC-E991B38AD858 (AT) microsoft (DOT) com...
The article has been moved or deleted from MSDN. I wish those guys would
learn to keep reference links constant!

Here is another article on the same subject:
http://msdn2.microsoft.com/en-us/library/aa479306.aspx

The reason for using unsafe code in any graphics application is of course
speed. Direct access to memory via a pointer is guaranteed to be faster
than any other method and optimization of graphics processing is
important.


--
--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.


"Academia" <academiaNOSPAM (AT) a-znet (DOT) com> wrote in message
news:OsmuQ07MIHA.5720 (AT) TK2MSFTNGP04 (DOT) phx.gbl...
Once I saw an implementation of OctreeQuantizer that did not require the
Unsafe keyword.

Now that I want it I can't find it.

Do you know how to find that site?

Also do you have a comment about reasons for using the "safe" or the
"unsafe" OctreeQuantizer code.



What site contains the code you'd recommend?





Thanks













Reply With Quote
  #5  
Old   
Academia
 
Posts: n/a

Default Re: What site contains the OctreeQuantizer code you'd recommend - 12-02-2007 , 08:57 AM



I kind of guessed that maybe the user might need more Windows privileges or
something.
Thanks, that's good to know.


"Bob Powell [MVP]" <bob (AT) spamkillerbobpowell (DOT) net> wrote

Quote:
In my opinion, the only possible downside to unsafe code is that the
requirement to understand the physical layout in memory of an object or
data structure is still of paramount importance whereas safe code takes
that responsibility away from the programmer and lightens the load.

For an old C++ programmer like me it's a useful and fast tool.

--
--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.


"Academia" <academiaNOSPAM (AT) a-znet (DOT) com> wrote in message
news:er$DCBDNIHA.5988 (AT) TK2MSFTNGP02 (DOT) phx.gbl...
I got it.

What's the down side of unsafe code for a Windows application?

Thanks

"Bob Powell [MVP]" <bob (AT) spamkillerbobpowell (DOT) net> wrote in message
news:77397E75-A709-4E8F-A8FC-E991B38AD858 (AT) microsoft (DOT) com...
The article has been moved or deleted from MSDN. I wish those guys would
learn to keep reference links constant!

Here is another article on the same subject:
http://msdn2.microsoft.com/en-us/library/aa479306.aspx

The reason for using unsafe code in any graphics application is of
course speed. Direct access to memory via a pointer is guaranteed to be
faster than any other method and optimization of graphics processing is
important.


--
--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.


"Academia" <academiaNOSPAM (AT) a-znet (DOT) com> wrote in message
news:OsmuQ07MIHA.5720 (AT) TK2MSFTNGP04 (DOT) phx.gbl...
Once I saw an implementation of OctreeQuantizer that did not require
the Unsafe keyword.

Now that I want it I can't find it.

Do you know how to find that site?

Also do you have a comment about reasons for using the "safe" or the
"unsafe" OctreeQuantizer code.



What site contains the code you'd recommend?





Thanks















Reply With Quote
  #6  
Old   
Frank Hileman
 
Posts: n/a

Default Re: What site contains the OctreeQuantizer code you'd recommend - 12-04-2007 , 08:25 AM



Hi Bob,

I guess you know pointers are not always guaranteed to be faster. Bounds
checks can be removed by the JIT compiler in some cases, and I was surprised
to find some low level rendering code was about equal in speed accessing
memory directly using pointers, or using an array of unsigned integers (4
bytes per pixel). Byte arrays are not especially fast using the CLR, but for
4 byte size elements, arrays are about as fast as pointer access. The
primary thing to avoid is marshalling data.

Regards,
Frank Hileman

check out VG.net: http://www.vgdotnet.com
Animated vector graphics system
Integrated Visual Studio graphics editor

"Bob Powell [MVP]" <bob (AT) spamkillerbobpowell (DOT) net> wrote

Quote:
The article has been moved or deleted from MSDN. I wish those guys would
learn to keep reference links constant!

Here is another article on the same subject:
http://msdn2.microsoft.com/en-us/library/aa479306.aspx

The reason for using unsafe code in any graphics application is of course
speed. Direct access to memory via a pointer is guaranteed to be faster
than any other method and optimization of graphics processing is
important.


--
--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.


"Academia" <academiaNOSPAM (AT) a-znet (DOT) com> wrote in message
news:OsmuQ07MIHA.5720 (AT) TK2MSFTNGP04 (DOT) phx.gbl...
Once I saw an implementation of OctreeQuantizer that did not require the
Unsafe keyword.

Now that I want it I can't find it.

Do you know how to find that site?

Also do you have a comment about reasons for using the "safe" or the
"unsafe" OctreeQuantizer code.



What site contains the code you'd recommend?





Thanks












Reply With Quote
  #7  
Old   
Bob Powell [MVP]
 
Posts: n/a

Default Re: What site contains the OctreeQuantizer code you'd recommend - 12-08-2007 , 06:05 AM



Hi Frank,
You're definitely right about the chunk size. Actually images are aligned on
four byte boundaries for just this reason. Thanks for pointing this out.

--
--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.


"Frank Hileman" <frankhil (AT) no (DOT) spamming.prodigesoftware.com> wrote

Quote:
Hi Bob,

I guess you know pointers are not always guaranteed to be faster. Bounds
checks can be removed by the JIT compiler in some cases, and I was
surprised to find some low level rendering code was about equal in speed
accessing memory directly using pointers, or using an array of unsigned
integers (4 bytes per pixel). Byte arrays are not especially fast using
the CLR, but for 4 byte size elements, arrays are about as fast as pointer
access. The primary thing to avoid is marshalling data.

Regards,
Frank Hileman

check out VG.net: http://www.vgdotnet.com
Animated vector graphics system
Integrated Visual Studio graphics editor

"Bob Powell [MVP]" <bob (AT) spamkillerbobpowell (DOT) net> wrote in message
news:77397E75-A709-4E8F-A8FC-E991B38AD858 (AT) microsoft (DOT) com...
The article has been moved or deleted from MSDN. I wish those guys would
learn to keep reference links constant!

Here is another article on the same subject:
http://msdn2.microsoft.com/en-us/library/aa479306.aspx

The reason for using unsafe code in any graphics application is of course
speed. Direct access to memory via a pointer is guaranteed to be faster
than any other method and optimization of graphics processing is
important.


--
--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.


"Academia" <academiaNOSPAM (AT) a-znet (DOT) com> wrote in message
news:OsmuQ07MIHA.5720 (AT) TK2MSFTNGP04 (DOT) phx.gbl...
Once I saw an implementation of OctreeQuantizer that did not require the
Unsafe keyword.

Now that I want it I can't find it.

Do you know how to find that site?

Also do you have a comment about reasons for using the "safe" or the
"unsafe" OctreeQuantizer code.



What site contains the code you'd recommend?





Thanks













Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.