Skip to content

Map operation returns array with unnecessary size #29

Description

@pdrocaldeira

Consider this map operation code:

        Array<Float32> arrayRetMapImage = image.par().map(Float32.class, new Map<Float32, Pixel>() {
            @Override
            public Float32 function(Pixel pixel) {
                Float32 ret = new Float32();
                ret.value = pixel.rgba.red;
                return ret;
            }
        });
        float[] floatArrayRetMapImage = arrayRetMapImage.toJavaArray();

Code generated by this operation return a 4 * (image size) float array when it shouldn't.

User function returns only a single float so the right way to do this is to analyse what type user function uses and create an array with compatible size.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions