Results 1 to 5 of 5

Thread: about clanlib texture pixels format .

  1. #1

    Lightbulb about clanlib texture pixels format .

    can I use RGB_565 , ARGB_4444, RGBA_8888, RGBX_8888, RGB_888 texture ?

  2. #2
    Master Sorcerer InFocus's Avatar
    Join Date
    May 2013
    Location
    Russia
    Posts
    517

    Default

    Quote Originally Posted by 0000000 View Post
    can I use RGB_565 , ARGB_4444, RGBA_8888, RGBX_8888, RGB_888 texture ?
    Sorry, I don't understand half of this words.
    But i will try to help.

    Why you want to use another texture, if you can create text and etc. right here.
    Front, Size, Color. Just Look above.

    InFocus

  3. #3

    Default

    Sorry ..
    I have some image .but pixels format is RGB_565 , ARGB_4444, RGBA_8888, RGBX_8888, RGB_888,

  4. #4

    Default

    If you're loading from memory using the CL_PixelBuffer interface, you can check the CL_TextureFormat enumerator.

    RGB_565 - No. (Interestingly, ClanLib 1.0.0 had an entry for this)
    RGB_888 - Yes, via cl_rgb8.
    RGBA_8888 - Yes, via cl_rgba8
    RGBX_8888 - No, but you can just use cl_rgba8 and drop/ignore the alpha channel.
    ARGB_4444 - No, but we have cl_rgba4 (different colour order) and cl_argb8 (different colour size).

  5. #5

    Default

    If the image is a raw bitmap inside the system memory, you can construct a PixelBuffer and pass the pointer to that image into it using the proper texture format flag. ClanLib supports RGBA_8888(cl_rgba8) and RGB_888(cl_rgb8), while the others need to be converted manually to work. From there you can create a texture using the newly created PixelBuffer.

    In ClanLib 2.3 you can do something like:

    Code:
    CL_PixelBuffer image(width, height, cl_rgba8, raw_data); // Create system pixel buffer from raw_data
    CL_Texture texture(clgc, width, height, cl_rgba8); // Create texture with proper dimensions
    texture.set_image(image); // Put image data into texture.

Similar Threads

  1. Replies: 2
    Last Post: 07-24-2011, 01:07 AM
  2. ClanLib 0.9 Texture Packer
    By sphair in forum Official ClanLib SDK Forums
    Replies: 4
    Last Post: 05-15-2009, 05:45 AM
  3. ClanLib 0.9, texelcenter and texture rotation problems
    By wizardofoz in forum Official ClanLib SDK Forums
    Replies: 9
    Last Post: 11-17-2008, 11:00 PM
  4. ClanLib 0.9 API documentation file format
    By rombust in forum Official ClanLib SDK Forums
    Replies: 3
    Last Post: 10-01-2008, 02:09 PM
  5. Drawing pixels
    By knutsj in forum Official ClanLib SDK Forums
    Replies: 5
    Last Post: 06-17-2008, 11:43 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
  •