Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 04:47
    Thetranslater starred mosra/magnum
  • 04:30
    Diamond12138 starred mosra/magnum
  • Dec 02 14:17

    mosra on next

    Containers: make it possible to… Containers: supply also stride … (compare)

  • Dec 01 16:35
  • Dec 01 10:17

    mosra on next

    Containers: this StringIterable… Containers: make it possible to… (compare)

  • Dec 01 01:17
    xiaohunqupo starred mosra/magnum-plugins
  • Nov 30 23:07
    JuanluMorales starred mosra/flextgl
  • Nov 30 21:47
    mosra edited #306
  • Nov 30 21:45
    mosra edited #306
  • Nov 30 21:37

    mosra on next

    Containers: workaround for GCC … (compare)

  • Nov 30 20:06

    mosra on next

    Containers: workaround for GCC … (compare)

  • Nov 30 19:20
    ProDCG starred mosra/magnum-examples
  • Nov 30 19:13

    mosra on next

    Containers: don't use the depre… doc: change the way CORRADE_BUI… Containers: add a forward decla… and 7 more (compare)

  • Nov 29 23:17
    mosra closed #20
  • Nov 29 23:17
    mosra commented #20
  • Nov 29 23:17

    mosra on master

    python: more missing moves, unn… doc: updated changelog. (compare)

  • Nov 29 23:10
    mosra labeled #20
  • Nov 29 23:09

    mosra on next

    python: more missing moves, unn… doc: updated changelog. (compare)

  • Nov 29 22:41
    Skylion007 commented #20
pezcode
@pezcode
shouldn't it say images[4]?
Vladimír Vondruš
@mosra
what the hell, the whole section seems cursed
what did i do there
but yeah, it should be [4]
fixing
pezcode
@pezcode
Related question: how do I get 2D z-slices of a 3D array?
const auto slice0 = image->pixels<Color4ub>().prefix<2>({1, image->size()[1], image->size()[0]});
this is giving me a 2D view with size 27, 1 and I'm not sure what I'm doing
original image is 63, 27,3 and I want 63, 27
Vladimír Vondruš
@mosra
huh, why is Z last?
usually it's Z first, then Y then X
so a 2D Z slice is simply pixels<T>()[i]
pezcode
@pezcode
oh dear, you're right
Vladimír Vondruš
@mosra
in other words, for the pixels view the strided array view size should be image.size().flipped() :)
to answer your original question, if Z would really be last then pixels<T>().transposed<0, 2>()[i], where the transpose turns it from XYZ order to ZYX
pezcode
@pezcode
no you were right, z is the first dimension, I just got really confused in my head
Vladimír Vondruš
@mosra
i made this exact mistake several times myself also, so i learned to spot it :D
pezcode
@pezcode
so if I was trying to emulate pixels<T>()[i] with prefix/slice, how would I do that?
Vladimír Vondruš
@mosra
hmmm your image->pixels<Color4ub>().prefix<2>({1, image->size()[1], image->size()[0]}); should work 🤔
or even image->pixels<Color4ub>().prefix<2>(1) but there doesn't seem to be such an overload
ah no
if you say prefix<2> it discards the last dimension, taking just the first slice out of it
so you end up with 1, 27, yeah
prefix<n>() takes dimensions off the end, [i] off the start, so you need the [] here
Vladimír Vondruš
@mosra
pixels.transposed<0, 1>().transposed<1, 2>().prefix<2>({image->size()[1], image->size()[0], 1}); would probably work, but ...
pezcode
@pezcode
ah, that makes sense
thanks!
pezcode
@pezcode
is it safe to call an instanced test case from another instanced test case? :eyes: ignore that, I need different input files anyway
Vladimír Vondruš
@mosra
should be safe, except that you need to call some verification macro before to register correct function name
Mathew
@lectroMathew
is Quaternion::toMatrix() * Vector3::zAxis() the best way to convert quaternion to directional vector?
Mathew
@lectroMathew
since there's no vector x quaternion overload of operator*
Vladimír Vondruš
@mosra
toMatrix().backward() gives you the Z axis also
Mathew
@lectroMathew
toMatrix spits out Matrix3 so there's no backward()
Visage
@Azvf
I figured it out. Then blit fails when the src rang2di and dst range2di don't match. I split the defaultframebuffer to 2 halves to render so when the width of the defaultframebuffer is an odd number the two parts will have one pixel difference which caused the blit not passing data.
Vladimír Vondruš
@mosra
@lectroMathew ah, in that case just toMatrix()[2] -- for a 3x3 rotation matrix, the three columns are the X Y Z basis vectors
@Azvf oh, glad to hear that :) so the original code caused a GL error or something like that?
Visage
@Azvf
There's no assert or anything, from what i saw just when the 2 rectangles' sizes are not the exactly same, the blit function just won't execute the blit process.
static void Magnum::GL::AbstractFramebuffer::blit(AbstractFramebuffer& source, AbstractFramebuffer& destination, const Range2Di& sourceRectangle, const Range2Di& destinationRectangle, FramebufferBlitMask mask, FramebufferBlitFilter filter)
Vladimír Vondruš
@mosra

There's no assert or anything

it'd give an OpenGL error (which is not checked by Magnum by default because it'd be too slow), you only see it if you run with --magnum-gpu-validation on passed on the command line or if you check GL::Renderer::error()

... and the error seems to be this, according to the spec:

GL_INVALID_OPERATION is generated if the value of GL_SAMPLE_BUFFERS for both read and draw buffers is greater than zero and the dimensions of the source and destination rectangles is not identical.

Visage
@Azvf
there's some other info printing at the time, guess I missed that. Noticed now, thank you for the explaination.
Guillaume Jacquemin
@williamjcm
Welp, today I learnt Tweakable doesn't work with hex literals:
Utility::TweakableParser: 0x9F00A5FF has an unexpected suffix, expected u
Utility::Tweakable::update(): change of CORRADE_TWEAKABLE(0x9F00A5FF) in ../../../src/SaveTool/SaveTool_MassViewer.cpp:645 requested a recompile
Vladimír Vondruš
@mosra
huh
it does
but you have to use 0x9F00A5FFu
Guillaume Jacquemin
@williamjcm
Ah.
Vladimír Vondruš
@mosra
i assume it was an unsigned integer before?
there's this restriction where you have to stay at exactly the same type otherwise if you'd save and recompile it could lead to a completely different code (for example due to different function overloads chosen etc)
Guillaume Jacquemin
@williamjcm

i assume it was an unsigned integer before?

Yeah.

An ImU32, to be accurate.
Vladimír Vondruš
@mosra
image.png
(thank you @pezcode for the new plugin!)