Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - Ashenwraith

Pages: [1] 2
Graphics / [Solved]100% pixel perfect sf::View size?
« on: June 25, 2010, 11:09:21 am »
I tried this but it doesn't work: sf::Vector2f HalfSize(App.GetWidth()*.5f,App.GetHeight()*.5f);

Feature requests / LAME MP3 support
« on: June 09, 2010, 04:14:44 pm »
What about LAME MP3 support which is an open encoder that is able to play in mp3 players, but is not a real mp3.


The quality/compression is often much better than ogg, especially for music.

Graphics / Strange Error Out at Run
« on: June 04, 2010, 06:59:37 am »
I have several programs I made using renderImage and they compiled and ran fine.

I tried executing them today and they errored out with a return. So I quit all programs and tried compiling other code and it worked fine.

So I recompiled and ran the renderImage programs but they still errored out no matter what I did. Putting some cout checks I found it always errored out at RenderImage.Create(w,h);

I put in the if available checks but it didn't seem to matter.

Now I restarted my computer and the original code/programs work fine.

Any ideas what this may be?

« on: May 09, 2010, 10:00:54 pm »
I have to add support for a new/preexisting image format (no I can't convert it with another program).

Should I use SOIL or FREEIMAGE?

Free image has one of the formats I need in it, but it also has pallete support (which could be useful).

SOIL is small and already in SFML, but it's rarely updated. This might be a problem with newer dds formats as well(?)

General discussions / Possible typo in SFML2?
« on: May 06, 2010, 01:55:28 pm »
Hi, I found a possible typo in the error 'failed to create render iage' instead of 'image'.

I don't know if this is fixed in the newest version.

Graphics / [SOLVED]General Pointer/Graphics Help plz
« on: May 01, 2010, 09:42:35 pm »
I don't have much pointer experience so some help would be great.

I'm using sf::Uint8 pointers to store colors but they appear to be corrupted by my other pointers that I need (for image processing).

Here is a simplified example:

Code: [Select]
#include <SFML/Graphics.hpp>

#include <iostream>

void Color_Sort(sf::Uint8* color_ptr)

//wrong number(99)--How do I keep this as 5?
    std::cout<<"color:"<<static_cast <int>(color_ptr[0])<<'\n';


int main()
    sf::Uint8 *color_ptr=new sf::Uint8();

    sf::Uint8 *num;


//correct number:
    std::cout<<"color:"<<static_cast <int>(color_ptr[0])<<'\n';

    sf::Uint8 *color_ptr2=new sf::Uint8();
    sf::Uint8 *num2;



    delete[] color_ptr2;
    delete[] color_ptr;

    return 0;

Graphics / Best way to work with Pixel Pointers/Arrays?
« on: April 23, 2010, 01:32:19 pm »
This is kind of important because a lot of my code is based on this.

Is there a better way than what I'm doing:

Code: [Select]
sf::Uint8* Get_Pixel(sf::Uint8* img_ptr,int w,int h,int x,int y)
    int index=(((y*h)-y)+(x))*4;
    sf::Uint8 *ptr=new sf::Uint8[3];


    return ptr;

sf::Uint8 *img_ptr=const_cast<sf::Uint8*>(img.GetPixelsPtr());

sf::Uint8 *ptr3=Get_Pixel(img_ptr,w,h,80,0);

Graphics / Containers for sf::Uint8???
« on: April 22, 2010, 03:04:38 am »
How do I store sf::Uint8 if arrays of type sf::Uint8 are unsigned chars?

I'm trying convert my sf::Volor arrays and the only thing I can think of is filling them with uint8 data and making the logic really long with 0,1,2,3 checks.

Graphics / sf::Color and Color Profile Problems
« on: April 19, 2010, 09:12:18 pm »
I ran into a little speed bump here while I was working.

The image displays/loads fine, but with sf::Color it appears the image needs to be converted to sRGB or the program will error out--probably from my inaccurate color comparisons.

I don't know if it's worth having SFML have internal color profile comparisons.

Now that I understand this bug in my program I'm going to move to direct pixel data instead of sf::Color so I don't know if it will be present (probably not I'm guessing).

Graphics / UpdatePixels VS LoadFromPixels
« on: April 18, 2010, 09:17:04 pm »
I'm just curious how fast is UpdatePixels vs LoadFromPixels?

If I already have a full pixel array stored from GetPixelsPtr to operate on then..
LoadFromPixels slower than 2 UpdatePixels calls?
LoadFromPixels slower than 5 UpdatePixels calls?
LoadFromPixels slower than 100 UpdatePixels calls?

Is there a ratio Update per pixel vs Load per pixel?

Has anybody done any benchmarks?

Graphics / [solved]Strange 'Artifacts' produced by RenderImage
« on: April 18, 2010, 01:48:30 am »
RenderImage seems to work good, but then I zoomed in and on the bottom of the last row there are some random pixels that do not belong there.

I know they are being produced because they are transparent unlike the rest of my image (and my smoothing is false).

They are also not in my color palette. I also saved  copies of the image unscaled and the artifacts do not exist.

They are also smaller than 1x1 pixel that is scaled so no way they are coming from the image.

Graphics / [SOLVED]Render Sprite to Image without drawing to screen?
« on: April 17, 2010, 07:49:33 am »
Hi, I need to transform (scale) an image that will then be saved, but I don't want to draw the sprite and copy the screen pixels.

Is there a way to scale/transform an image without drawing it?

Graphics / [solved]Byte Manipulation for Image Processing
« on: April 16, 2010, 06:10:52 pm »
Hi, my tool is working right now, but it's way too slow and I'm using GetPixel,SetPixel, to basically reconstruct and process images.

What I think I need to do is:

--get a dump of the bytes (GetPixelsPtr() ?)

--sort through uints by 4 for rgba pixels

--do my comparison/maths on range of bytes and edit/replace

My question is what is the best way to do this?

GetPixelsPtr returns a pointer so I can't just use sizeof() to sort?

Is the size stored in
  • ?

My memory is kind of screwed up because I'm going off when I did something like this manually a long time ago. Does using GetPixelsPtr and just inputting width and height handle everything?

Is it fast working directly with pixel data for large images?

I was thinking of converting to an indexed form based off a palette for the the loop-through operations and then converting back to pixels.


Part 2


Okay so let's see if I can recap some to be more clear.

GetPixel == slow

GetPixelsPtr() to grab entire image and set a new instance to be operated on?


GetPixelsPtr() many times as replacement to GetPixel?

See what my problem is?

Graphics / PBO Drawbacks and Implementation ?
« on: April 16, 2010, 02:27:46 am »
I was taking a look at PBO demos over at: http://www.songho.ca/opengl/gl_pbo.html

What are the drawbacks to using PBOs?

Using a double PBO I was able to go from 300 MB/s to 550+ and 70 fps to 140.

It seems like it would be good for sprite streaming, no?

Graphics / [solved]SFML Color probs
« on: April 12, 2010, 09:53:04 pm »
Quote from: "Ashenwraith"
Hi, here's an example of my probs, any help would be great:

Code: [Select]
sf::Color c1,c2;


if(c1!=c2) // doesn't compare colors


Nevermind, I forgot another check.

Pages: [1] 2