NVIDIAdeveloper.nvidia.com
Google
WWWdeveloper.nvidia.com

SDK 9.51 Code Samples - Video and Image Processing

In each release of our SDK you will find hundreds of code samples, effects, whitepapers, and more to help you take advantage of the latest technology from NVIDIA. Check out our SDK Home Page to download the complete SDK, or browse through individual code samples below. You can also click on the video links for a quick preview, or the thumbnail images for a gallery of larger images.

This code is released free of charge for use in derivative works, whether academic, commercial, or personal. (Full License)

Select the category to view:

Simple Framebuffer ObjectFor a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This simple code example shows how to use the framebuffer object (FBO) extension to perform rendering to texture in OpenGL. The code renders a wireframe teapot to an off-screen frame buffer object, binds this as a texture and then displays it to the window on a textured quad.The FBO extension has the advantages that it is window system independent and does not require a separate OpenGL context for each render target. See the GL_EXT_framebuffer_object spec for more details.
  Minimum Required GPU

Graphics API Type





Download


GPU Video EffectsFor a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This sample uses the GPU to render post-processing effects with source images and video. It takes advantage of the nv_image_processing framework, Cg, and GLSL for to implement several video filters, including guassian blur, edge detection overlay, wobble, TV-noise, radial blur, and night vision.
  Minimum Required GPU

Graphics API Type


User Guide  


Download


Antialiasing with Post-ProcessingFor a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

In this sample, an antialiased backbuffer is read as the source image for a post-processing effect which creates a green glow. The IDirect3DDevice9::StretchRect() function is used to copy the antialiased image to a render-target texture for post-processing. This technique yields better results than simply rendering the scene to an off screen render target.
  Minimum Required GPU

Graphics API Type



Whitepaper  
Video  
Download


Image HistogramFor a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This example implements an image histogram using occlusion queries. For a histogram with n entries this method takes n passes. It renders the scene to a texture, and then for each bucket in the histogram renders a quad with the scene texture, using a fragment program that discards pixels outside the range of interest. Occlusion query is used to count how many pixels remain, and were therefore inside the range.
  Minimum Required GPU

Graphics API Type





Download


Decimation Using Anisotropic FilteringFor a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This sample demonstrates how anisotropic filtering can be used to significantly increase the performance of common image decimation filters.
  Minimum Required GPU

Graphics API Type


User Guide  
Whitepaper  

Download


Video FilterFor a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This sample demonstrates how apply shader effects onto two videos and composite them together using pixel shaders. Shaders are then used to perform YUV2RGB color conversion, color correction, and effects like sepia, blur, sharpen, luminance edge detection, fade, and radial blur.
  Minimum Required GPU

Graphics API Type



Whitepaper  
Video  
Download


Discrete Cosine TransformFor a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This example shows how to implement the forward and inverse discrete cosine transform (DCT) using fragment programs. The DCT operates on 8x8 pixel blocks and is used as the basis for JPEG compression. The code can perform the forward DCT followed by the inverse DCT at around 160 frames per second for a 512 x 512 monochrome image on a GeForce 6800. This could be extended into a complete hardware accelerated JPEG viewer by performing the rest of the JPEG algorithm (entropy decompression etc.) on the CPU and adding resampling and color space conversion to the GPU code.
  Minimum Required GPU

Graphics API Type





Download


Get GPU And System InfoFor a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This sample querries Microsoft's IDXDiagContainer interface to retrieve graphics hardware and system information. Most notable is the retrieval of the amount of physical video memory on the primary graphics device. The IDXDiagContainer interface is wrapped in a convenient C++ class, and no IDirect3DDevice9 object is required to retrieve the information.
  Minimum Required GPU

Graphics API Type



Whitepaper  

Download


Fast Third Order FilteringFor a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

Demonstrates a fast and efficient technique to perform cubic texture filtering. This technique is described in GPU Gems 2: Programming Techniques for High-Performance Graphics and General-Purpose Computation.
  Minimum Required GPU

Graphics API Type


User Guide  
Whitepaper  

Download


GPU Filter for Photoshop(tm)For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This code example implements a Photoshop™ filter plugin that performs its key pixel operations using GLSL shaders. Docs are included to guide developers who desire to use GLSL in Photoshop on their own. This code sample requires the use of Adobe's Photoshop CS API toolkit, which is available to registered developers directly from Adobe Systems. If you just want to use the filter without compiling the source, move the enclosed GPUFilter.8bf to your local Photoshop Plugins\Filters folder.
  Minimum Required GPU

Graphics API Type



Whitepaper  

Download


PBO Texture PerformanceFor a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

Explores various ways to use OpenGL pixel buffer objects (PBOs). This code sample can also be used to see the maximum bus-transfer rates for textures to and from the GPU.
  Minimum Required GPU

Graphics API Type


User Guide  

Video  
Download


16-bit Floating Point Blending and FilteringFor a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This simple example demonstrates 16-bit floating point blending and texture filtering. It repeatedly renders an OpenEXR-format image to a 16-bit floating point p-buffer with additive blending, and then uses a fragment program to display the results to the screen. The exposure multiplier value can be increased and decreased using the '+' and '-' keys.
  Minimum Required GPU

Graphics API Type




Video  
Download


FFT on the GPUFor a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This sample presents an implementation of FFTs on the GPU, performing image reconstruction on magnetic resonance imaging (MRI) and ultrasonic imaging data. This implementation automatically balances the load between the vertex processor, the rasterizer, and the fragment processor; it also uses several other novel techniques to obtain high performance on the Quadro NV4x family of GPUs. This technique is described in GPU Gems 2: Programming Techniques for High-Performance Graphics and General-Purpose Computation.
  Minimum Required GPU

Graphics API Type


User Guide  
Whitepaper  

Download


Medical Image ReconstructionFor a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

Fast Fourier Transforms (FFT) are used to reconstruct images from medical scans. This sample presents an implementation of FFTs on the GPU. This implementation automatically balances the load between the vertex processor, the rasterizer, and the fragment processor; it also uses several other novel techniques to obtain high performance on the Quadro NV4x family of GPUs. This technique is described in GPU Gems 2: Programming Techniques for High-Performance Graphics and General-Purpose Computation.
  Minimum Required GPU

Graphics API Type


User Guide  
Whitepaper  

Download


Image ProcessingFor a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This sample app utilizes the nv_image_processing framework. The sample app executes image processing filters compeletely on the GPU. Examples filters are Gaussian blurr (naive implementation and two-pass separated). The sample got its name from the scotopic vision filter that is an advanced version of "Hollywood night". It turns daytime images into night scenes.
  Minimum Required GPU

Graphics API Type


User Guide  
Whitepaper  

Download


Filter BlitFor a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This entry demonstrates how to implement custom image processing via filters using pixel shaders to process the image. This technique can be used for a wide range of interesting filtering effects, such as blur, sharpen, and luminance edge detection.
  Minimum Required GPU

Graphics API Type



Whitepaper  

Download


HDR PaintFor a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This example demonstrates the use of floating point textures and render-to-texture to implement interactive high dynamic range painting. It uses fragment prorams to implement several different display and brush modes. The application is resolution-independent - all rendering is performed to an offscreen floating point pbuffer, which can then be displayed at any size or position. Each brush stroke is rendered as a single textured quad. Floating point blending is implemented in the shader using two pbuffers which are alternated between each brush stroke. One is used as the source buffer and the other is the destination. The modified area is copied back from the destination to the source for the next frame.
  Minimum Required GPU

Graphics API Type




Video  
Download


NVIDIA Control Panel APIFor a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

The sample exercises functionality available through the NVIDIA Control Panel (NVCpl) API, in particular, what type of AGP or PCIExpress mode the GPU is in, how much physical video memory the GPU has, what the user's control panel settings for AA, number of buffered frames as well as other current display settings, and primary display and device information. In addition, it lets developers query if the system supports SLI and allows them to choose an SLI mode for their application. For declarations of externally accessible NVIDIA Control Panel API methods, please see NvPanelApi.h.
  Minimum Required GPU

Utility


User Guide  


Download


NVDeviceIDFor a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

A simple example to identify NVIDIA's product families through the use of Direct3D adapter identifier. Select the userguide link below to access an updated list of NVIDIA device ids.
  Minimum Required GPU

Graphics API Type


User Guide  


Download


Vendor/Device ID Sample ExampleFor a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

A simple sample to show how to retrieve vendor and device ID's for the primary display device. Select the userguide link below to access an updated list of NVIDIA device ids.
  Minimum Required GPU

Utility


User Guide  


Download

Last Update: Jan 17, 2007
NVPerfHUD 4