Jump to content

  • Log In with Google      Sign In   
  • Create Account

gbadebo

Member Since 11 Jul 2006
Offline Last Active Jan 26 2013 08:33 AM

Posts I've Made

In Topic: debug current instruction pointer

25 January 2013 - 12:41 PM

sorry i missed that out. JAVA - Android development

Have you considered that the program may have crashed on the line the debugger is highlighting?


Maybe, but there no way (that i could see) to extract a crash-info (array out of bounds, out of memory...)
any help pls?

In Topic: How do i subtract one image from another using C++

19 July 2006 - 05:09 AM

Any actual C++ examples ps?? i know algorithms, but acessing the bytes is not that simple

In Topic: RE: code 4 cropping & copying subrectangle of PNG image

13 July 2006 - 01:40 AM

Quote:

post by solias
1. Allocate width * height * sizeof(pixel) memory for the source buffer
2. Allocate destwidth * destheight * sizeof(pixel) memory for the destination buffer
3. Use libpng (or other image lib) to load the png file data into source.
4. Copy each pixel in the cropped area from source to dest. Do this with two for loops for x and y and offset the dest coordinates so that the cropped area is copied to 0,0.....


the problem is the original ligpng loader doesn't allow for pixel level acess. take a look at this extract from my code. You will see that the code comented out and astericked(*) cannot be done because of lack of pixel access. But if u 've got a better method please lets know
NOTE: PLEASE BEAR WITH ME AS THE TEXT EDITOR REMOVES THE INDENTATION SO THE CODE APPEARS LESS READABLE!!!

// header file
class texture
{
public:
GLuint *ImageTexture, *TextureNumber, *croppedTest;
texture();
~texture();
void mainLoader();
GLuint* getTexure(int texid, char type);
};

// cpp file
#include "texture.h"
#include "glpng.h"
#include <GL/glut.h>
#include <stdlib.h>


texture::texture()
{
ImageTexture = new GLuint[50];
TextureNumber = new GLuint[50];


croppedTest = new GLuint[50];
}

texture::~texture()
{

}


GLuint* texture::getTexure(int texid, char type)
{

if( (texid<40) && (texid>=0) ){
if( type == 'T' ){
return &ImageTexture[texid];
}
else if( type == 'N' ){
return &TextureNumber[texid];
}
}
else {
//**************************************************************************
//** for( int i=100; i<300; i++ ){
//** for( int j=100; j<300; j++ ){
//**
//** croppedTest[texid][j*200 + i] = ImageTexture[texid][j*300 + i];
//** }
//** }
//*********************************************************************************
return &ImageTexture[7];
}
}


void texture::mainLoader() {
.
.
.
.
}
#endif

[Edited by - gbadebo on July 13, 2006 12:40:01 PM]

In Topic: RE: code 4 cropping & copying subrectangle of PNG image

11 July 2006 - 09:03 AM

has any one got answers to:
i have loaded the png textures loaded but how do i create ( as in the example above; dst[dstOffset] = src[srcOffset] ) these buffers that would represent png files?

and how do i use glCopySubImage2D() to read png files

[Edited by - gbadebo on July 12, 2006 10:03:39 AM]

PARTNERS