Skip to content

Implements YCbCr ( YUV ) image compression using the Cinder library

Notifications You must be signed in to change notification settings

Hperigo/RgbYCbCr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RgbYCbCr

Implements YCbCr ( YUV ) image compression using the Cinder library

There are two types of classes, SurfaceYCbCr and TextureYCbCr. The first one converts a ci::Surface8u to YCbCr color space and compress the chroma channels, the second uses a shader to decompress the image on the GPU

###SurfaceYCbCr

SurfaceYCbCr img(original, 0.25f); // creates an compressed image 
Surface8u result = img.toSurface(); // get's the surface back.

This method is a lossy compression, depending how much you compress you can get some ugly results

###TextureYCbCr

to use a TextureYCbCr you first need to compress a surface using SurfaceYCbCr, then bind the TextureYCbCr to a geometry

SurfaceYCbCr img(original, 0.25f); // creates an compressed image 
TextureYCbCr texture(img) // creates a texture

//in draw loop:
tex.bindShaderTexture();
gl::drawSolidRect(getWindowBounds());
tex.unbindShaderTexture();

About

Implements YCbCr ( YUV ) image compression using the Cinder library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published