Click here to Skip to main content
Click here to Skip to main content
Articles » Multimedia » OpenGL » General » Downloads
 
Add your own
alternative version

Zoom An Image With Different Interpolation Types

, 21 Sep 2011 CPOL
Implementation of different interpolations[Bi-Linear and Bi-Cubic] with OpenGL.
ZoomInterpolationApplication.zip
ZoomInterpolation.exe
ZoomInterpolation_Application.zip
ZoomInterpolation.exe
ZoomInterpolation_Code.zip
ZoomInterpolation
pixel_shader_Bell.cg
pixel_shader_BiCubic.cg
pixel_shader_BiLinear.cg
pixel_shader_BSpline.cg
pixel_shader_CatMull.cg
res
Flower.bmp
ZoomInterpolation.ico
ZoomInterpolation.dsp
ZoomInterpolation.dsw
ZoomInterpolation_Source.zip
pixel_shader_Bell.cg
pixel_shader_BiCubic.cg
pixel_shader_BiLinear.cg
pixel_shader_BSpline.cg
pixel_shader_CatMull.cg
Flower.bmp
ZoomInterpolation.ico
ZoomInterpolation.dsp
ZoomInterpolation.dsw
#pragma once

#include "GL\GL.h"

class GLSLShader;
class GLVertexBuffer;
class GLTexture;
class GLText;

/*
 This class prepares Zoomed image with the provided parameters.
 This class require different resources( Such as GLSLShader, GLTexture, GLVertexBuffert etc )
 to create a final image.
 This class is prepared to create Multiple views in ZoomInterpolation application.
 */
class GLImageView
{
public:
    GLImageView(void);
    ~GLImageView(void);

    void SetViewport( const int nLeft_i, const int nTop_i,
                      const int nWidth_i, const int nHeight_i );
    void SetVertexBuffer( GLVertexBuffer* pVertexBuffer_i );
    // Input flag indicate shader object need to delete.
    // All In View prepares different shader objects and put it in ImageView list.
    // When ImageView delete, GLSLShader objects deleted from this class.
    void SetShader( GLSLShader* pShader_i , const bool bDeleteShader_i = false );
    void SetText( GLText* pText_i );
    void SetTextureParam( GLTexture* pTexture_i, const int nTextureWidth_i,
                          const int nTextureHeight_i, const GLenum eTextureFilter_i );
    void Draw();

private:

    int m_nViewportLeft;
    int m_nViewportTop;
    int m_nViewportWidth;
    int m_nViewportHeight;
    int m_nTextureWidth;
    int m_nTextureHeight;
    GLTexture* m_pTexture;
    GLSLShader* m_pShader;
    GLVertexBuffer* m_pVertexBuffer;
    GLText*          m_pText;
    GLenum    m_eTextureFilter;
    bool m_bDeleteShader;
};

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Santhosh G_

India India
No Biography provided

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150129.1 | Last Updated 21 Sep 2011
Article Copyright 2011 by Santhosh G_
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid