Comments (6)
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.
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.
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.
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.
Yes, okay. I think there's also one of these 1-header-libraries that provides stuff like this.
from fltk.
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)
- CMake's USE_SYSTEM libs does not work on Windows' MSVC HOT 4
- Fl_Terminal control character handling HOT 9
- Fl_Gl_Window glViewport() clips drawing on Windows/Mingw64 HOT 6
- Build using a GLU from a non-standard location HOT 5
- Naseem HOT 2
- FLUID: compilation warnings HOT 1
- Wayland use of alpha in glClearColor/glClear() -- bug or misfeature? HOT 13
- Building OpenGL Examples on Windows with MSVC does not work HOT 5
- Consider adding compile-definition "FL_DLL" to MSVC 2022 builds with shared libraries HOT 6
- macOS: Generating fltk.framework HOT 13
- Avoiding wrong includes (only include from FLTK's repository not from CMAKE_PREFIX_PATH) HOT 5
- FLTK 1.4: X11 Clipping bugs HOT 8
- Fluid/MSVC compilation warnings HOT 1
- FLTK hangs when a GL visible subwindow goes partially below the screen on Wayland-Gnome HOT 14
- macOS regression with glwindow, glsubwindow and tile. HOT 14
- Selected Fl_Menu_Item's are not drawn with selection color background under Windows HOT 8
- Cannot build project with CMake (add_library cannot create ALIAS target "fltk" because target "fltk::fltk" is imported but not globally visible) HOT 7
- Fl_Tree handler might refer to a null root causing a crash HOT 4
- Fl_Tree doesn't use system colors HOT 23
- Wayland: subwindow redraw issues from timeouts with NVidia driver HOT 26
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fltk.