Image2::scale and Image2::resize

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


User avatar
TaaTT4
OGRE Contributor
OGRE Contributor
Posts: 267
Joined: Wed Apr 23, 2014 3:49 pm
Location: Bologna, Italy
x 75

Image2::scale and Image2::resize

Post by TaaTT4 »

Why Image2::scale and Image2::resize methods are stripped out by an #ifdef 0? Do they not work?
I'm asking because, since we're working on sort of mini editor, it would be very useful to have those functions in play.

Senior programmer at 505 Games; former senior engine programmer at Sandbox Games
Worked on: Racecraft EsportRacecraft Coin-Op, Victory: The Age of Racing

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5505
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1372

Re: Image2::scale and Image2::resize

Post by dark_sylinc »

Image::scale needs porting, as it relies on PixelUtil instead of PixelFormatGpu
Additionaly, the scaling routines need to be checked to see if they properly support the case when bytesPerRow != bytesPerPixel * width

We assume a rowAlignment of 4 (the start of each row is aligned to 4 bytes) and that's why bytesPerRow may not match. Old Image did not have that restriction.

Pixel formats with a size of 4 or 8 bytes are naturally aligned, but that's not true for 8/16/48 bit images.

Note however, this is not a complex task. Anybody should be able to port it with relative ease. (I'm not interested and I'm focused on other stuff)
User avatar
Eugene
OGRE Team Member
OGRE Team Member
Posts: 185
Joined: Mon Mar 24, 2008 4:54 pm
Location: Kraków, Poland
x 41

Re: Image2::scale and Image2::resize

Post by Eugene »

Our code use this feature, so it is in my short list
User avatar
TaaTT4
OGRE Contributor
OGRE Contributor
Posts: 267
Joined: Wed Apr 23, 2014 3:49 pm
Location: Bologna, Italy
x 75

Re: Image2::scale and Image2::resize

Post by TaaTT4 »

Eugene wrote: Mon Jan 27, 2020 7:43 pm Our code use this feature, so it is in my short list
Cool! Can you put this feature even in v2-2-irradiance-field branch (since I've noticed that you mostly work on master branch)?

Senior programmer at 505 Games; former senior engine programmer at Sandbox Games
Worked on: Racecraft EsportRacecraft Coin-Op, Victory: The Age of Racing

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5505
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1372

Re: Image2::scale and Image2::resize

Post by dark_sylinc »

TaaTT4 wrote: Tue Jan 28, 2020 10:11 am
Eugene wrote: Mon Jan 27, 2020 7:43 pm Our code use this feature, so it is in my short list
Cool! Can you put this feature even in v2-2-irradiance-field branch (since I've noticed that you mostly work on master branch)?
I'll be merging it once he puts it on the master branch.