Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1061431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:28:21+00:00 2026-05-16T18:28:21+00:00

In my application , I need to do brightness related operation on the image.

  • 0

In my application , I need to do brightness related operation on the image. I done with following things

  1. Getting image from photo library.
  2. Drawing that image using the Open GL.
  3. Changing the brightness of the image.

    -(void) DoBrightness:(float) aBrightness
    {
    [EAGLContext setCurrentContext:context];
    
        // Clear the buffer
    
        glBindFramebufferOES(GL_FRAMEBUFFER_OES, viewFramebuffer);
        glClearColor(0.0, 0.0, 0.0, 0.0);
        glActiveTexture(GL_TEXTURE0);
        glVertexPointer(2, GL_FLOAT, 0, spriteVertices);
        glEnableClientState(GL_VERTEX_ARRAY);
        glTexCoordPointer(2, GL_SHORT, 0, spriteTexcoords);
        glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE);
    
        if (aBrightness >= 1.0f) {
            glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_ADD);
            glColor4f(aBrightness-1, aBrightness-1, aBrightness-1, aBrightness-1);
        } else {
            glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_SUBTRACT);
            glColor4f(1-aBrightness, 1-aBrightness, 1-aBrightness, 1-aBrightness);
        }
        glTexEnvi(GL_TEXTURE_ENV, GL_SRC0_RGB, GL_TEXTURE);
        glTexEnvi(GL_TEXTURE_ENV, GL_SRC1_RGB, GL_PRIMARY_COLOR);
        glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA, GL_REPLACE);
        glTexEnvi(GL_TEXTURE_ENV, GL_SRC0_ALPHA, GL_TEXTURE);
    
        glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
    
        // Display the buffer
        glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer);
        [context presentRenderbuffer:GL_RENDERBUFFER_OES];
    }
    

Problem comes when I try to save image with brightness. Actually it is saving previous image i.e image w/o brightness

can any one help me , how to save image using rendered buffer?

thanks,

Sagar

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T18:28:22+00:00Added an answer on May 16, 2026 at 6:28 pm

    You’re only doing the work on the screen, so to speak. You’re not actually reading the screen and saving that data to file. Basically you need to use glReadPixels to get the data from the screen buffer and then save that buffer as your modified image. There’s more details in the following:

    How do I grab an image from my EAGLLayer ?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In certain areas in my application I need data from several tables in the
From a logical point of view an application may need dozens or hundreds of
Well i have a application that is black and white and i need a
In the java web application need to select the file from server and print
In an application I need to execute other programs with another user's credentials. Currently
I have a java application I need to pass some info to a C++
I'm working on a web-application and need to figure out the best way to
I'm building a C++ application and need to use PDCurses on Windows. I'm compiling
I am current writing an application and need to show the current days of
We are writing a complex rich desktop application and need to offer flexibility in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.