Skip to main content
GameDev.net gamedev.net
🔒 Locked

2xSAI engine, can anyone explain it to me?

Started by Tricron2 Dec 10, 2001 at 9:41 PM 1 replies 1.9k views
Original Post
Tricron2
Tricron2
Hey, I've been looking into the 2xSAI engine, and I've got the source code, just I can't really understand the theory behind it. Heres what I've gotten from the readme How does it work? ----------------- 2xSaI doesn't use conventional methods to scale images. 2xSaI detects certain color patterns (actually just lines and edges) in the original bitmap. A 2x scaled image has 4 times the amount of pixels of the original one. Of those one is directly taken from the source bitmap. The other 3 pixels are "guessed", using the patterns I mentioned earlier. A better document describing how 2xSaI works has yet to be written (when this 17 year old has some more time)... I'm wondering if anyone can explain it better to me... I don't need complicated math or formulas, I'm just more or less looking for a some details on what steps are taken and how they relate to the final image... Thanks in advance... Oh, and one other thing.. it's lmost christmas can anyone recommend a graphics programming book that would feature 2xSAI, the eagle engine, dithering and other concepts related to 2D graphics? Edited by - Tricron2 on December 10, 2001 10:54:51 PM
JDL
JDL
Nah, it''s not using any complicated math at all...
it only checks if the colour of the pixel being drawn matches any of the 8 pixels that surround it - and depending on the pattern of such colour matches, the scaled pixel will be drawn differently.

Just a bunch of if statements or switch should be enough to program a simple 2xsai engine.
Tricron2
Tricron2
Thats it? Well at least that little bit of knowledge will help me out as I figure out its source.

Thanks =)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.