Code Monkey home page Code Monkey logo

Comments (6)

Albrecht-S avatar Albrecht-S commented on August 19, 2024

There are options to draw images flipped horiontally or vertically. This does not change the image in memory but can be useful. However, it's not possible to turn images 90°-wise. See documentation of arguments D and L of fl_draw_image().

Side note: many drawing functions can also be used with a transformation matrix, but I have no idea if this is applicable to drawing images. See chapter Drawing Things in FLTK.

That said, it's probably not the goal of FLTK to support image manipulations in memory. FLTK always tries to be F(ast) and L(ight) and this could be done in user code. Others may chime in with different opinions...

There are interesting articles (start here) describing how to access image pixels in memory, maybe this is what you're looking for?

from fltk.

Albrecht-S avatar Albrecht-S commented on August 19, 2024

Addendum: see also Direct Image Drawing which states:

The behavior when drawing images when the current transformation matrix is not the identity is not defined, so you should only draw images when the matrix is set to the identity.

to clarify that image drawing is not usable with a transformation.

from fltk.

erco77 avatar erco77 commented on August 19, 2024

I'd offer this type of thing, if popular (and probably is) might warrant a separate .lib file,
e.g. fltk_image_ops.lib

That'd keep the main library fast+light, while moving image ops to another lib.
However, that might be a slippery slope into 'lets re-implement imagemagick!'.
We could limit the image operations to simple stuff that doesn't involve calculating
subpixels and such, and just dumb operations like 90 degree turns.

But again, not sure we want to go down that path, we're not an image lib.. there's
other libs for that.

from fltk.

Albrecht-S avatar Albrecht-S commented on August 19, 2024

But again, not sure we want to go down that path, we're not an image lib.. there's other libs for that.

Yep, after thinking about it, I'm really -1 on this. If we'd try to do it for Fl_RGB_Image's we'd certainly be asked to do it for other image types as well. Think of pixmaps, bitmaps, GIF images, ... This would be a never ending story ...

Please let's close this issue. @darealshinji ??

from fltk.

darealshinji avatar darealshinji commented on August 19, 2024

Yes, okay. I think there's also one of these 1-header-libraries that provides stuff like this.

from fltk.

darealshinji avatar darealshinji commented on August 19, 2024

Here's an example with a function I wrote that turns and flips Fl_RGB_Images: https://gist.github.com/darealshinji/a134365c76fc1258ded0118cb1dcd594
It also can handle different values for d() and ld(). It's Public Domain, if anyone wants to use it.

from fltk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.