Results 1 to 2 of 2

Thread: Image smoothing

  1. #1
    Lesser Knight
    Join Date
    Jun 2007
    Location
    Finland
    Posts
    44

    Default Image smoothing

    When I'm scaling up a sprite, it appears to be "blurred". Is it possible to disable this for that particular image? Or to disable it completely? I'm using ClanLib 1.0.

  2. #2
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    No it's not possible with ClanLib 1.0 (as far as I know) without changing to the ClanLib 1.0 source code.

    ClanLib 2.3 contains:

    Code:
    void CL_Sprite::set_linear_filter(bool  linear_filter = true) 
    Set to true if a linear filter should be used for scaling up and down, false if a nearest-point filter should be used.
    It "should" be simple to patch ClanLib 1.0, but I don't know the source to be sure. ClanLib 2.3 does the following:

    Code:
    void CL_Sprite::set_linear_filter(bool linear_filter)
    {
    	impl->linear_filter = linear_filter;
    
    	std::vector<CL_Sprite_Impl::SpriteFrame>::size_type size = impl->frames.size();
    	for (unsigned int cnt = 0; cnt < size; cnt++)
    	{
    		impl->frames[cnt].texture.set_mag_filter(linear_filter ? cl_filter_linear : cl_filter_nearest);
    		impl->frames[cnt].texture.set_min_filter(linear_filter ? cl_filter_linear : cl_filter_nearest);
    	}
    }

Similar Threads

  1. Scaling sprites without smoothing or anti-aliasing
    By Maciej Baron in forum Official ClanLib SDK Forums
    Replies: 4
    Last Post: 03-19-2011, 01:19 PM
  2. Where is my Image?
    By Martin in forum Official ClanLib SDK Forums
    Replies: 2
    Last Post: 03-19-2008, 11:28 AM
  3. Image Manipulation
    By joeymitchell in forum Official ClanLib SDK Forums
    Replies: 0
    Last Post: 12-04-2007, 04:50 PM
  4. Rendering into my custom image and then drawing this image to the display
    By ValkaVALES in forum Official ClanLib SDK Forums
    Replies: 4
    Last Post: 07-03-2007, 09:53 AM
  5. Image help
    By in forum Dink Smallwood HD
    Replies: 2
    Last Post: 02-04-2004, 08:42 PM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •