Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
Graphics
»
Question about Interpolation
Print
Pages: [
1
]
Author
Topic: Question about Interpolation (Read 3384 times)
0 Members and 1 Guest are viewing this topic.
whitegentleman
Newbie
Posts: 6
Question about Interpolation
«
on:
February 18, 2013, 12:19:26 pm »
My Question is about Interpolation.
If i resize an Image, which Interpolation algo. uses SFML 2.0 as default?
Nearest neighbor interpolation ? or Bilinear interpolation? or Bicubic interpolation?
and how can i change it?
Thx in advance
.
Logged
Laurent
Administrator
Hero Member
Posts: 32498
Re: Question about Interpolation
«
Reply #1 on:
February 18, 2013, 12:23:07 pm »
If you zoom or stretch a sf::Texture, the interpolation mode is either:
- nearest pixel if the texture is not smoothed (
texture.setSmooth(false)
) -- the default
- bilinear if the texture is smoothed (
texture.setSmooth(true)
)
Logged
Laurent Gomila - SFML developer
whitegentleman
Newbie
Posts: 6
Re: Question about Interpolation
«
Reply #2 on:
February 18, 2013, 12:30:56 pm »
Thx for the fast reply
My last question would be, will sfml get Bicubic interpolation?
Logged
Laurent
Administrator
Hero Member
Posts: 32498
Re: Question about Interpolation
«
Reply #3 on:
February 18, 2013, 01:17:14 pm »
OpenGL (which SFML is based on) only provides linear and nearest pixel interpolations. If you want bicubic interpolation, you must implement it yourself with a shader.
You can take a look at this article:
http://www.codeproject.com/Articles/236394/Bi-Cubic-and-Bi-Linear-Interpolation-with-GLSL
Logged
Laurent Gomila - SFML developer
Print
Pages: [
1
]
SFML community forums
»
Help
»
Graphics
»
Question about Interpolation
anything