Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PixelFormat.flipY has a bug #8852

Closed
hijunmeng opened this issue May 14, 2020 · 2 comments · Fixed by #8893
Closed

PixelFormat.flipY has a bug #8852

hijunmeng opened this issue May 14, 2020 · 2 comments · Fixed by #8893

Comments

@hijunmeng
Copy link

in file cesium\Source\Core\PixelFormat.js

the function flipY has a bug,the row and flippedRow shoule be

var row = i * width* numberOfComponents;
var flippedRow = (height - i - 1) * width* numberOfComponents;

please check it and fix it

@lilleyse
Copy link
Contributor

@huweijian5 agreed, this looks like a bug. It's hard to trigger this code by normal means because the texture's source data needs to be an array buffer and needs to set flipY to true, which is an unusual combination. Do you have sample code that triggers the problem that we could test with?

@hijunmeng
Copy link
Author

hijunmeng commented May 15, 2020

@lilleyse i just create a new texture as below

let dataBuffer,width,height;//dataBuffer store the RGB binary data 

 let videoMaterial = new Cesium.ImageMaterialProperty({
        image: ""
        //image:videoTexture   //why not ?It looks invalid
    });
 let videoTexture = new Cesium.Texture({
            context: viewer.scene.context,
            pixelFormat: Cesium.PixelFormat.RGB,
            pixelDatatype: Cesium.PixelDatatype.UNSIGNED_BYTE,
            width: width,
            height: height,
            flipY: true,
            source: {
                arrayBufferView: dataBuffer
            }
        });

 videoMaterial.image = videoTexture; //but it work

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

Successfully merging a pull request may close this issue.

3 participants