Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: reading part of a bitmap into a texture?

  1. #1
    Junior Member Newbie
    Join Date
    Nov 2002
    Location
    Ireland
    Posts
    21

    reading part of a bitmap into a texture?

    Can anyone suggest a way to read in a part of a bitmap into a texture. The image that I'm loading is 1Gb so I can't load the whole image, as it's so big and it would slow my processes down.

    I'm currently using :
    AUX_RGBImageRec *texture1;
    texture1 = auxDIBImageLoad("Data/bit.bmp");

    Is there a auxDIB section load?

    Thanks
    Patrick

  2. #2
    Senior Member Frequent Contributor
    Join Date
    Aug 2000
    Location
    Cardiff University
    Posts
    653

    Re: reading part of a bitmap into a texture?

    why not just chop it up yourself?

  3. #3
    Junior Member Newbie
    Join Date
    Nov 2002
    Location
    Ireland
    Posts
    21

    Re: reading part of a bitmap into a texture?

    Originally posted by Gavin:
    why not just chop it up yourself?
    Because its for a pathologist who will not waste time chopping up images.

  4. #4
    Senior Member Frequent Contributor
    Join Date
    Aug 2000
    Location
    Cardiff University
    Posts
    653

    Re: reading part of a bitmap into a texture?

    I meant why don;t you write code to chop it up.... I don;t see the problem.....
    pick the width/height of the txture you want to use, after checking the max size, and then after you have loaded the whole image split it up into these sizes....

  5. #5
    Junior Member Newbie
    Join Date
    Nov 2002
    Location
    Ireland
    Posts
    21

    Re: reading part of a bitmap into a texture?

    Gavin,

    Will this not take a age to load as the whole 1Gb image will have to be loaded into RAM?

    Originally posted by Gavin:
    I meant why don;t you write code to chop it up.... I don;t see the problem.....
    pick the width/height of the txture you want to use, after checking the max size, and then after you have loaded the whole image split it up into these sizes....

  6. #6
    Senior Member Frequent Contributor
    Join Date
    Aug 2000
    Location
    Cardiff University
    Posts
    653

    Re: reading part of a bitmap into a texture?

    just use low level io. If it does take too long then you just read the part you need from the file. I assume you know about fseek, read (as opposed to fscanf) etc.

  7. #7
    Junior Member Newbie
    Join Date
    Nov 2002
    Location
    Ireland
    Posts
    21

    Re: reading part of a bitmap into a texture?

    No I have heard of that? could you explain?


    Originally posted by Gavin:
    just use low level io. If it does take too long then you just read the part you need from the file. I assume you know about fseek, read (as opposed to fscanf) etc.

  8. #8
    Senior Member Frequent Contributor
    Join Date
    Aug 2000
    Location
    Cardiff University
    Posts
    653

    Re: reading part of a bitmap into a texture?

    are you using C?

  9. #9
    Junior Member Newbie
    Join Date
    Nov 2002
    Location
    Ireland
    Posts
    21

    Re: reading part of a bitmap into a texture?

    Using V C++ 6.0.

    Originally posted by Gavin:
    are you using C?

  10. #10
    Senior Member Frequent Contributor
    Join Date
    Aug 2000
    Location
    Cardiff University
    Posts
    653

    Re: reading part of a bitmap into a texture?

    just try it the simple way to start with by reading the whole file in and the extracting the 'block' of the bmp that you need, it may be quick enough for you.

Page 1 of 2 12 LastLast

Similar Threads

  1. Reading part of a 2D image
    By vincentfpgarcia in forum OpenCL
    Replies: 2
    Last Post: 01-25-2012, 03:27 AM
  2. How to fit a only a part of a texture?
    By ElFuego in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 05-18-2011, 02:34 AM
  3. reading color buffer to save as bitmap
    By mark young in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 08-22-2005, 10:50 PM
  4. reading color buffer to save as bitmap
    By mark young in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 08-22-2005, 04:40 PM
  5. Custom projection matrix: part ortho, part frustum
    By joelsk in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 11-30-2000, 07:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean