@@ -77,8 +77,8 @@ void ofApp::draw(){
77
77
ofSetColor(255);
78
78
79
79
// We fetch the ofImage's dimensions and display it 10x larger.
80
- int imgWidth = myImage.width ;
81
- int imgHeight = myImage.height ;
80
+ int imgWidth = myImage.getWidth() ;
81
+ int imgHeight = myImage.getHeight() ;
82
82
myImage.draw(10, 10, imgWidth * 10, imgHeight * 10);
83
83
}
84
84
```
@@ -303,7 +303,7 @@ Most of the time, you'll be working with image data that is stored in a higher-l
303
303
304
304
``` cpp
305
305
int arrayIndex = (y * imgWidth) + x;
306
- unsigned char * myImagePixelBuffer = myImage.getPixels();
306
+ unsigned char * myImagePixelBuffer = myImage.getPixels().getData() ;
307
307
unsigned char pixelValueAtXY = myImagePixelBuffer[arrayIndex];
308
308
```
309
309
@@ -577,7 +577,7 @@ ofImage myImage;
577
577
myImage.load (" colorful.jpg" );
578
578
int imageWidth = myImage.getWidth();
579
579
int imageHeight = myImage.getHeight();
580
- unsigned char * rgbPixelData = myImage.getPixels();
580
+ unsigned char * rgbPixelData = myImage.getPixels().getData() ;
581
581
582
582
// Allocate memory for storing a grayscale version.
583
583
// Since there's only 1 channel of data, it's just w*h.
@@ -652,15 +652,15 @@ void ofApp::setup(){
652
652
653
653
// Construct and allocate a new image with the same dimensions.
654
654
// This will store our destination ("dst") image.
655
- int imgW = lincolnOfImageSrc.width ;
656
- int imgH = lincolnOfImageSrc.height ;
655
+ int imgW = lincolnOfImageSrc.getWidth() ;
656
+ int imgH = lincolnOfImageSrc.getHeight() ;
657
657
lincolnOfImageDst.allocate(imgW, imgH, OF_IMAGE_GRAYSCALE);
658
658
659
659
// Acquire pointers to the pixel buffers of both images.
660
660
// These images use 8-bit unsigned chars to store gray values.
661
661
// Note the convention 'src' and 'dst' -- this is very common.
662
- unsigned char* srcArray = lincolnOfImageSrc.getPixels();
663
- unsigned char* dstArray = lincolnOfImageDst.getPixels();
662
+ unsigned char* srcArray = lincolnOfImageSrc.getPixels().getData() ;
663
+ unsigned char* dstArray = lincolnOfImageDst.getPixels().getData() ;
664
664
665
665
// Loop over all of the destination image's pixels.
666
666
// Each destination pixel will be 10 gray-levels brighter
0 commit comments