diff --git a/addons/ofxUnitTests/src/ofxUnitTests.h b/addons/ofxUnitTests/src/ofxUnitTests.h index 4b236babde4..5fc72581b85 100644 --- a/addons/ofxUnitTests/src/ofxUnitTests.h +++ b/addons/ofxUnitTests/src/ofxUnitTests.h @@ -153,15 +153,17 @@ class ofxUnitTestsApp: public ofBaseApp{ bool do_test_eq(T1 t1, T2 t2, const std::string & v1, const std::string & v2, const std::string & testName, const std::string & msg, const std::string & file, int line){ numTestsTotal++; if(t1==t2){ - ofLogNotice() << testName << " passed"; + // ofLogNotice() << testName << " passed"; numTestsPassed++; return true; }else{ ofLogError() << testName << " failed " << msg; - ofLogError() << "test_eq(" << v1 << ", " << v2 << ")"; - ofLogError() << "value1: " << v1 << " is " << ofToString(t1); - ofLogError() << "value2: " << v2 << " is " << ofToString(t2); - ofLogError() << file << ": " << line; + // ofLogError() << "test_eq(" << v1 << ", " << v2 << ")"; + ofLogError() << "expected: " < 0 ){ - pixels[(((i/16))*16*16*16+(i%16)*16 + (j-1)*16*16 + k)*2] = 255; - pixels[(((i/16))*16*16*16+(i%16)*16 + (j-1)*16*16 + k)*2+1] = 255; + pixelsBitmapFont[(((i/16))*16*16*16+(i%16)*16 + (j-1)*16*16 + k)*2] = 255; + pixelsBitmapFont[(((i/16))*16*16*16+(i%16)*16 + (j-1)*16*16 + k)*2+1] = 255; } } } @@ -471,7 +471,7 @@ void ofBitmapFont::unloadTexture(){ const ofTexture & ofBitmapFont::getTexture() const{ if(!texture.isAllocated()){ ofBitmapFont::init(); - texture.allocate(pixels,false); + texture.allocate(pixelsBitmapFont,false); texture.setTextureMinMagFilter(GL_LINEAR,GL_NEAREST); } return texture; diff --git a/libs/openFrameworks/graphics/ofBitmapFont.h b/libs/openFrameworks/graphics/ofBitmapFont.h index 55f4432dabf..2d3fc88d6f0 100644 --- a/libs/openFrameworks/graphics/ofBitmapFont.h +++ b/libs/openFrameworks/graphics/ofBitmapFont.h @@ -25,7 +25,7 @@ class ofBitmapFont{ ofRectangle getBoundingBox(const std::string & text, int x, int y, ofDrawBitmapMode mode = ofGetStyle().drawBitmapMode, bool vFlipped = ofIsVFlipped()) const; private: static void init(); - static ofPixels pixels; + static ofPixels pixelsBitmapFont; void unloadTexture(); mutable ofTexture texture; }; diff --git a/libs/openFrameworks/graphics/ofPixels.cpp b/libs/openFrameworks/graphics/ofPixels.cpp index de5d1847b6f..a2970d5a06b 100644 --- a/libs/openFrameworks/graphics/ofPixels.cpp +++ b/libs/openFrameworks/graphics/ofPixels.cpp @@ -1,6 +1,7 @@ #include "ofGraphicsConstants.h" #include "ofPixels.h" #include "ofColor.h" +#include static ofImageType getImageTypeFromChannels(size_t channels){ switch(channels){ @@ -16,121 +17,92 @@ static ofImageType getImageTypeFromChannels(size_t channels){ } template -size_t ofPixels_::pixelBitsFromPixelFormat(ofPixelFormat format){ - switch(format){ - case OF_PIXELS_RGB: - case OF_PIXELS_BGR: - return 3 * sizeof(PixelType) * 8; - - case OF_PIXELS_RGBA: - case OF_PIXELS_BGRA: - return 4 * sizeof(PixelType) * 8; - - case OF_PIXELS_GRAY: - case OF_PIXELS_Y: - case OF_PIXELS_U: - case OF_PIXELS_V: - return 1 * sizeof(PixelType) * 8; +static size_t numChannelsFromPixelFormat(ofPixelFormat _pixelFormat) { + std::unordered_map pixelFormatChannels { + { OF_PIXELS_RGB, 3 }, + { OF_PIXELS_BGR, 3 }, + { OF_PIXELS_RGBA, 4 }, + { OF_PIXELS_RGBA, 4 }, + { OF_PIXELS_GRAY, 1 }, + { OF_PIXELS_Y, 1 }, + { OF_PIXELS_U, 1 }, + { OF_PIXELS_V, 1 }, + { OF_PIXELS_UV, 2 }, + { OF_PIXELS_VU, 2 }, + { OF_PIXELS_GRAY_ALPHA, 2 }, + }; + return pixelFormatChannels[_pixelFormat]; +} +template +size_t ofPixels_::pixelBitsFromPixelFormat(ofPixelFormat _pixelFormat){ + switch(_pixelFormat){ case OF_PIXELS_NV12: case OF_PIXELS_NV21: case OF_PIXELS_YV12: case OF_PIXELS_I420: return 12; - - case OF_PIXELS_UV: - case OF_PIXELS_VU: - case OF_PIXELS_GRAY_ALPHA: - return 2 * sizeof(PixelType) * 8; - + break; + case OF_PIXELS_YUY2: case OF_PIXELS_UYVY: case OF_PIXELS_RGB565: return 16; break; default: - return 0; + + return + std::unordered_map { + { OF_PIXELS_RGB, 3 }, + { OF_PIXELS_BGR, 3 }, + { OF_PIXELS_RGBA, 4 }, + { OF_PIXELS_BGRA, 4 }, + { OF_PIXELS_GRAY, 1 }, + { OF_PIXELS_Y, 1 }, + { OF_PIXELS_U, 1 }, + { OF_PIXELS_V, 1 }, + { OF_PIXELS_UV, 2 }, + { OF_PIXELS_VU, 2 }, + { OF_PIXELS_GRAY_ALPHA, 2 }, + }[_pixelFormat] * sizeof(PixelType) * 8; +// return numChannelsFromPixelFormat(format) * sizeof(PixelType) * 8; } - } template<> -std::string ofToString(const ofPixelFormat & p) { - switch (p){ - case OF_PIXELS_GRAY: - return "OF_PIXELS_GRAY"; - break; - case OF_PIXELS_GRAY_ALPHA: - return "OF_PIXELS_GRAY_ALPHA"; - break; - case OF_PIXELS_RGB: - return "OF_PIXELS_RGB"; - break; - case OF_PIXELS_BGR: - return "OF_PIXELS_BGR"; - break; - case OF_PIXELS_RGBA: - return "OF_PIXELS_RGBA"; - break; - case OF_PIXELS_BGRA: - return "OF_PIXELS_BGRA"; - break; - case OF_PIXELS_RGB565: - return "OF_PIXELS_RGB565"; - break; - case OF_PIXELS_NV12: - return "OF_PIXELS_NV12"; - break; - case OF_PIXELS_NV21: - return "OF_PIXELS_NV21"; - break; - case OF_PIXELS_YV12: - return "OF_PIXELS_YV12"; - break; - case OF_PIXELS_I420: - return "OF_PIXELS_I420"; - break; - case OF_PIXELS_YUY2: - return "OF_PIXELS_YUY2"; - break; - case OF_PIXELS_UYVY: - return "OF_PIXELS_UYVY"; - break; - case OF_PIXELS_Y: - return "OF_PIXELS_Y"; - break; - case OF_PIXELS_U: - return "OF_PIXELS_U"; - break; - case OF_PIXELS_V: - return "OF_PIXELS_V"; - break; - case OF_PIXELS_UV: - return "OF_PIXELS_UV"; - break; - case OF_PIXELS_VU: - return "OF_PIXELS_VU"; - break; - case OF_PIXELS_NUM_FORMATS: - return "OF_PIXELS_NUM_FORMATS"; - break; - case OF_PIXELS_UNKNOWN: - return "OF_PIXELS_UNKNOWN"; - break; - case OF_PIXELS_NATIVE: - return "OF_PIXELS_NATIVE"; - break; - } - return "OF_PIXELS_UNKNOWN"; -} - -template -size_t ofPixels_::bytesFromPixelFormat(size_t w, size_t h, ofPixelFormat format){ - return w * h * pixelBitsFromPixelFormat(format) / 8; -} - -static size_t channelsFromPixelFormat(ofPixelFormat format){ - switch(format){ +std::string ofToString(const ofPixelFormat & _pixelFormat) { + return + std::unordered_map { + { OF_PIXELS_GRAY, "OF_PIXELS_GRAY" }, + { OF_PIXELS_GRAY_ALPHA, "OF_PIXELS_GRAY_ALPHA" }, + { OF_PIXELS_RGB, "OF_PIXELS_RGB" }, + { OF_PIXELS_BGR, "OF_PIXELS_BGR" }, + { OF_PIXELS_RGBA, "OF_PIXELS_RGBA" }, + { OF_PIXELS_BGRA, "OF_PIXELS_BGRA" }, + { OF_PIXELS_RGB565, "OF_PIXELS_RGB565" }, + { OF_PIXELS_NV12, "OF_PIXELS_NV12" }, + { OF_PIXELS_NV21, "OF_PIXELS_NV21" }, + { OF_PIXELS_YV12, "OF_PIXELS_YV12" }, + { OF_PIXELS_YUY2, "OF_PIXELS_YUY2" }, + { OF_PIXELS_UYVY, "OF_PIXELS_UYVY" }, + { OF_PIXELS_Y, "OF_PIXELS_Y" }, + { OF_PIXELS_U, "OF_PIXELS_U" }, + { OF_PIXELS_V, "OF_PIXELS_V" }, + { OF_PIXELS_UV, "OF_PIXELS_UV" }, + { OF_PIXELS_VU, "OF_PIXELS_VU" }, + { OF_PIXELS_NUM_FORMATS, "OF_PIXELS_NUM_FORMATS" }, + { OF_PIXELS_UNKNOWN, "OF_PIXELS_UNKNOWN" }, + { OF_PIXELS_NATIVE, "OF_PIXELS_NATIVE" }, + }[_pixelFormat]; +} + +template +size_t ofPixels_::bytesFromPixelFormat(size_t w, size_t h, ofPixelFormat _pixelFormat){ + return w * h * pixelBitsFromPixelFormat(_pixelFormat)/8; +} + +static size_t channelsFromPixelFormat(ofPixelFormat _pixelFormat){ + switch(_pixelFormat){ case OF_PIXELS_RGB: case OF_PIXELS_BGR: return 3; @@ -166,11 +138,23 @@ static size_t channelsFromPixelFormat(ofPixelFormat format){ return 2; break; default: - ofLog(OF_LOG_ERROR,"ofPixels: format doesn't support channels"); + ofLog(OF_LOG_ERROR, "ofPixels: format doesn't support channels " + ofToString(_pixelFormat) ); return 1; } } + +template +size_t ofPixels_::getBytesFromPixelFormat(ofPixelFormat _pixelFormat){ + return channelsFromPixelFormat(_pixelFormat) * sizeof(PixelType); +} + +//static unordered_map imageType2pixelFormat { +// { OF_IMAGE_GRAYSCALE, OF_PIXELS_GRAY }, +// { OF_IMAGE_COLOR, OF_PIXELS_RGB }, +// { OF_IMAGE_COLOR_ALPHA, OF_PIXELS_RGBA }, +//}; + static ofPixelFormat ofPixelFormatFromImageType(ofImageType type){ switch(type){ case OF_IMAGE_GRAYSCALE: @@ -188,8 +172,8 @@ static ofPixelFormat ofPixelFormatFromImageType(ofImageType type){ } } -static ofImageType ofImageTypeFromPixelFormat(ofPixelFormat pixelFormat){ - switch(pixelFormat){ +static ofImageType ofImageTypeFromPixelFormat(ofPixelFormat _pixelFormat){ + switch(_pixelFormat){ case OF_PIXELS_GRAY: return OF_IMAGE_GRAYSCALE; break; @@ -210,8 +194,8 @@ static ofImageType ofImageTypeFromPixelFormat(ofPixelFormat pixelFormat){ } } -std::string ofToString(ofPixelFormat pixelFormat){ - switch(pixelFormat){ +std::string ofToString(ofPixelFormat _pixelFormat){ + switch(_pixelFormat){ case OF_PIXELS_RGB: return "RGB"; case OF_PIXELS_BGR: @@ -378,8 +362,8 @@ void ofPixels_::setFromPixels(const PixelType * newPixels, size_t w, } template -void ofPixels_::setFromPixels(const PixelType * newPixels, size_t w, size_t h, ofPixelFormat format){ - allocate(w,h,format); +void ofPixels_::setFromPixels(const PixelType * newPixels, size_t w, size_t h, ofPixelFormat _pixelFormat){ + allocate(w,h,_pixelFormat); memcpy(pixels, newPixels, getTotalBytes()); } @@ -393,11 +377,11 @@ template void ofPixels_::setFromExternalPixels(PixelType * newPixels, size_t w, size_t h, ofPixelFormat _pixelFormat){ clear(); pixelFormat = _pixelFormat; - width= w; + width = w; height = h; - pixelsSize = bytesFromPixelFormat(w,h,_pixelFormat); - + pixelsSize = bytesFromPixelFormat(w, h, _pixelFormat); + pixels = newPixels; pixelsOwner = false; bAllocated = true; @@ -418,7 +402,7 @@ void ofPixels_::setFromAlignedPixels(const PixelType * newPixels, siz return; } allocate(width, height, _pixelFormat); - size_t dstStride = width * pixelBitsFromPixelFormat(_pixelFormat)/8; + size_t dstStride = width * getBytesFromPixelFormat(_pixelFormat); const unsigned char* src = (unsigned char*) newPixels; unsigned char* dst = (unsigned char*) pixels; for(size_t i = 0; i < height; i++) { @@ -507,6 +491,11 @@ void ofPixels_::allocate(size_t w, size_t h, size_t _channels){ allocate(w,h,pixelFormatFromNumChannels(_channels)); } +template +void ofPixels_::allocate(size_t w, size_t h, ofImageType type){ + allocate(w,h,ofPixelFormatFromImageType(type)); +} + template void ofPixels_::allocate(size_t w, size_t h, ofPixelFormat format){ if (w == 0 || h == 0 || format == OF_PIXELS_UNKNOWN) { @@ -515,6 +504,7 @@ void ofPixels_::allocate(size_t w, size_t h, ofPixelFormat format){ size_t newSize = bytesFromPixelFormat(w,h,format); size_t oldSize = getTotalBytes(); + //we check if we are already allocated at the right size if(bAllocated && newSize==oldSize){ pixelFormat = format; @@ -526,9 +516,9 @@ void ofPixels_::allocate(size_t w, size_t h, ofPixelFormat format){ //we do need to allocate, clear the data clear(); - pixelFormat = format; - width = w; - height = h; + pixelFormat = format; + width = w; + height = h; pixelsSize = newSize; @@ -537,11 +527,6 @@ void ofPixels_::allocate(size_t w, size_t h, ofPixelFormat format){ pixelsOwner = true; } -template -void ofPixels_::allocate(size_t w, size_t h, ofImageType type){ - allocate(w,h,ofPixelFormatFromImageType(type)); -} - template void ofPixels_::swapRgb(){ switch(pixelFormat){ @@ -583,11 +568,11 @@ void ofPixels_::clear(){ pixels = nullptr; } - width = 0; - height = 0; - pixelFormat = OF_PIXELS_UNKNOWN; - pixelsSize = 0; - bAllocated = false; + width = 0; + height = 0; + pixelFormat = OF_PIXELS_UNKNOWN; + pixelsSize = 0; + bAllocated = false; } template @@ -803,7 +788,7 @@ size_t ofPixels_::getHeight() const{ template size_t ofPixels_::getBytesPerPixel() const{ - return pixelBitsFromPixelFormat(pixelFormat)/8; + return getBytesFromPixelFormat(pixelFormat); } template @@ -1160,10 +1145,13 @@ void ofPixels_::rotate90(int nClockwiseRotations){ ofPixels_ newPixels; rotate90To(newPixels,nClockwiseRotations); - std::swap(newPixels.pixels,pixels); - width = newPixels.width; - height = newPixels.height; - pixelsSize = newPixels.size(); + std::swap(newPixels.pixels, pixels); + std::swap(newPixels.width, width); + std::swap(newPixels.height, height); +// width = newPixels.width; +// height = newPixels.height; + // not needed really because w*h = h*w +// pixelsSize = newPixels.size(); } @@ -1344,30 +1332,41 @@ bool ofPixels_::resizeTo(ofPixels_& dst, ofInterpolationMe size_t dstHeight = dst.getHeight(); size_t bytesPerPixel = getBytesPerPixel(); - - PixelType * dstPixels = dst.getData(); + auto dstPixels = dst.getData(); switch (interpMethod){ - //---------------------------------------- case OF_INTERPOLATE_NEAREST_NEIGHBOR:{ +// size_t dstIndex = 0; +// float srcxFactor = (float)srcWidth/dstWidth; +// float srcyFactor = (float)srcHeight/dstHeight; +// float srcy = 0.5; +// for (size_t dsty=0; dsty(srcy) * srcWidth; +// for (size_t dstx=0; dstx(srcIndex + srcx) * bytesPerPixel; +// for (size_t k=0; k(srcy) * srcWidth; + size_t srcIndex = static_cast(dsty * srcyFactor * srcWidth); for (size_t dstx=0; dstx(srcIndex + srcx) * channelsFromPixelFormat(pixelFormat); - for (size_t k=0; k< channelsFromPixelFormat(pixelFormat); k++){ - dstPixels[dstIndex] = pixels[pixelIndex]; - dstIndex++; - pixelIndex++; - } - srcx+=srcxFactor; + size_t pixelIndex = static_cast(srcIndex + dstx * srcxFactor) * bytesPerPixel; + + memcpy(&pixels[pixelIndex], + &dstPixels[dstIndex], + bytesPerPixel); } - srcy+=srcyFactor; } }break; diff --git a/libs/openFrameworks/graphics/ofPixels.h b/libs/openFrameworks/graphics/ofPixels.h index 0d28f8f0ef6..c5a40cfbfeb 100644 --- a/libs/openFrameworks/graphics/ofPixels.h +++ b/libs/openFrameworks/graphics/ofPixels.h @@ -159,7 +159,7 @@ enum ofPixelFormat: short{ template std::string ofToString(const T & v); template<> -std::string ofToString(const ofPixelFormat & pixelType); +std::string ofToString(const ofPixelFormat & _pixelFormat); enum ofImageType: short; @@ -197,7 +197,7 @@ class ofPixels_ { /// \param w Width of pixel array /// \param h Height of pixel array /// \param pixelFormat ofPixelFormat defining number of channels per pixel - void allocate(size_t w, size_t h, ofPixelFormat pixelFormat); + void allocate(size_t w, size_t h, ofPixelFormat _pixelFormat); /// \brief Allocates space for pixel data /// @@ -236,14 +236,14 @@ class ofPixels_ { void set(PixelType val); void set(size_t channel,PixelType val); void setFromPixels(const PixelType * newPixels,size_t w, size_t h, size_t channels); - void setFromPixels(const PixelType * newPixels,size_t w, size_t h, ofPixelFormat pixelFormat); + void setFromPixels(const PixelType * newPixels,size_t w, size_t h, ofPixelFormat _pixelFormat); void setFromPixels(const PixelType * newPixels,size_t w, size_t h, ofImageType type); void setFromExternalPixels(PixelType * newPixels,size_t w, size_t h, size_t channels); - void setFromExternalPixels(PixelType * newPixels,size_t w, size_t h, ofPixelFormat pixelFormat); + void setFromExternalPixels(PixelType * newPixels,size_t w, size_t h, ofPixelFormat _pixelFormat); void setFromAlignedPixels(const PixelType * newPixels, size_t width, size_t height, size_t channels, size_t stride); - void setFromAlignedPixels(const PixelType * newPixels, size_t width, size_t height, ofPixelFormat pixelFormat, size_t stride); + void setFromAlignedPixels(const PixelType * newPixels, size_t width, size_t height, ofPixelFormat _pixelFormat, size_t stride); /// \brief used to copy i420 pixels from gstreamer when (width % 4) != 0 - void setFromAlignedPixels(const PixelType * newPixels, size_t width, size_t height, ofPixelFormat pixelFormat, std::vector strides); + void setFromAlignedPixels(const PixelType * newPixels, size_t width, size_t height, ofPixelFormat _pixelFormat, std::vector strides); void swap(ofPixels_ & pix); @@ -441,9 +441,12 @@ class ofPixels_ { void setImageType(ofImageType imageType); void setNumChannels(size_t numChannels); + + static size_t pixelBitsFromPixelFormat(ofPixelFormat _pixelFormat); - static size_t pixelBitsFromPixelFormat(ofPixelFormat format); - static size_t bytesFromPixelFormat(size_t w, size_t h, ofPixelFormat format); + static size_t getBytesFromPixelFormat(ofPixelFormat _pixelFormat); + static size_t bytesFromPixelFormat(size_t w, size_t h, ofPixelFormat _pixelFormat); + static size_t numChannelsFromPixelFormat(ofPixelFormat _pixelFormat); /// \} /// \name Iterator @@ -467,7 +470,7 @@ class ofPixels_ { /// \cond INTERNAL struct ConstPixel{ - ConstPixel(const PixelType * pixel, size_t bytesPerPixel, ofPixelFormat pixelFormat); + ConstPixel(const PixelType * pixel, size_t bytesPerPixel, ofPixelFormat _pixelFormat); const ConstPixel& operator*() const; const ConstPixel* operator->() const; ConstPixel& operator++(); @@ -496,7 +499,7 @@ class ofPixels_ { }; struct Pixel { - Pixel(PixelType * pixel, size_t bytesPerPixel, ofPixelFormat pixelFormat); + Pixel(PixelType * pixel, size_t bytesPerPixel, ofPixelFormat _pixelFormat); const Pixel& operator*() const; const Pixel* operator->() const; Pixel& operator++(); @@ -529,7 +532,7 @@ class ofPixels_ { }; struct Pixels{ - Pixels(PixelType * begin, PixelType * end, size_t componentsPerPixel, ofPixelFormat pixelFormat); + Pixels(PixelType * begin, PixelType * end, size_t componentsPerPixel, ofPixelFormat _pixelFormat); Pixels(Pixel begin, Pixel end); Pixel begin(); Pixel end(); @@ -541,7 +544,7 @@ class ofPixels_ { }; struct Line { - Line(PixelType * _begin, size_t stride, size_t componentsPerPixel, size_t lineNum, ofPixelFormat pixelFormat); + Line(PixelType * _begin, size_t stride, size_t componentsPerPixel, size_t lineNum, ofPixelFormat _pixelFormat); const Line& operator*() const; const Line* operator->() const; Line& operator++(); @@ -582,7 +585,7 @@ class ofPixels_ { }; struct Lines{ - Lines(PixelType * _begin, PixelType * _end, size_t stride, size_t componentsPerPixel, size_t lines, ofPixelFormat pixelFormat); + Lines(PixelType * _begin, PixelType * _end, size_t stride, size_t componentsPerPixel, size_t lines, ofPixelFormat _pixelFormat); Line begin(); @@ -599,7 +602,7 @@ class ofPixels_ { }; struct ConstPixels{ - ConstPixels(const PixelType * begin, const PixelType * end, size_t componentsPerPixel, ofPixelFormat pixelFormat); + ConstPixels(const PixelType * begin, const PixelType * end, size_t componentsPerPixel, ofPixelFormat _pixelFormat); ConstPixels(const ConstPixel & begin, const ConstPixel & end); ConstPixel begin() const; ConstPixel end() const; @@ -611,7 +614,7 @@ class ofPixels_ { }; struct ConstLine { - ConstLine(const PixelType * _begin, size_t stride, size_t componentsPerPixel, size_t lineNum, ofPixelFormat pixelFormat); + ConstLine(const PixelType * _begin, size_t stride, size_t componentsPerPixel, size_t lineNum, ofPixelFormat _pixelFormat); const ConstLine& operator*() const; const ConstLine* operator->() const; ConstLine& operator++(); @@ -644,7 +647,7 @@ class ofPixels_ { }; struct ConstLines{ - ConstLines(const PixelType * _begin, const PixelType * _end, size_t stride, size_t componentsPerPixel, size_t lines, ofPixelFormat pixelFormat); + ConstLines(const PixelType * _begin, const PixelType * _end, size_t stride, size_t componentsPerPixel, size_t lines, ofPixelFormat _pixelFormat); ConstLine begin() const; @@ -800,10 +803,10 @@ inline typename ofPixels_::const_reverse_iterator ofPixels_ -inline ofPixels_::Pixel::Pixel(PixelType * pixel, size_t componentsPerPixel, ofPixelFormat pixelFormat) -:pixel(pixel) -,componentsPerPixel(componentsPerPixel) -,pixelFormat(pixelFormat){ +inline ofPixels_::Pixel::Pixel(PixelType * _pixel, size_t _componentsPerPixel, ofPixelFormat _pixelFormat) +:pixel(_pixel) +,componentsPerPixel(_componentsPerPixel) +,pixelFormat(_pixelFormat){ } @@ -969,7 +972,7 @@ ofColor_ ofPixels_::Pixel::getColor() const{ //---------------------------------------------------------------------- template -inline ofPixels_::Pixels::Pixels(PixelType * begin, PixelType * end, size_t componentsPerPixel, ofPixelFormat pixelFormat) +inline ofPixels_::Pixels::Pixels(PixelType * begin, PixelType * end, size_t componentsPerPixel, ofPixelFormat _pixelFormat) :_begin(begin) ,_end(end) ,componentsPerPixel(componentsPerPixel) @@ -998,7 +1001,7 @@ inline typename ofPixels_::Pixel ofPixels_::Pixels::end(){ //---------------------------------------------------------------------- template -inline ofPixels_::Line::Line(PixelType * _begin, size_t stride, size_t componentsPerPixel, size_t lineNum, ofPixelFormat pixelFormat) +inline ofPixels_::Line::Line(PixelType * _begin, size_t stride, size_t componentsPerPixel, size_t lineNum, ofPixelFormat _pixelFormat) :_begin(_begin) ,_end(_begin+stride) ,stride(stride) @@ -1163,7 +1166,7 @@ inline typename ofPixels_::Pixels ofPixels_::Line::getPixe //---------------------------------------------------------------------- template -inline ofPixels_::Lines::Lines(PixelType * _begin, PixelType * _end, size_t stride, size_t componentsPerPixel, size_t lines, ofPixelFormat pixelFormat) +inline ofPixels_::Lines::Lines(PixelType * _begin, PixelType * _end, size_t stride, size_t componentsPerPixel, size_t lines, ofPixelFormat _pixelFormat) :_begin(_begin) ,_end(_end) ,stride(stride) @@ -1210,7 +1213,7 @@ inline typename ofPixels_::Pixels ofPixels_::getPixelsIter //---------------------------------------------------------------------- template -inline ofPixels_::ConstPixel::ConstPixel(const PixelType * pixel, size_t componentsPerPixel, ofPixelFormat pixelFormat) +inline ofPixels_::ConstPixel::ConstPixel(const PixelType * pixel, size_t componentsPerPixel, ofPixelFormat _pixelFormat) :pixel(pixel) ,componentsPerPixel(componentsPerPixel) ,pixelFormat(pixelFormat){ @@ -1340,7 +1343,7 @@ ofColor_ ofPixels_::ConstPixel::getColor() const{ //---------------------------------------------------------------------- template -inline ofPixels_::ConstPixels::ConstPixels(const PixelType * begin, const PixelType * end, size_t componentsPerPixel, ofPixelFormat pixelFormat) +inline ofPixels_::ConstPixels::ConstPixels(const PixelType * begin, const PixelType * end, size_t componentsPerPixel, ofPixelFormat _pixelFormat) :_begin(begin) ,_end(end) ,componentsPerPixel(componentsPerPixel) @@ -1368,7 +1371,7 @@ inline typename ofPixels_::ConstPixel ofPixels_::ConstPixe //---------------------------------------------------------------------- template -inline ofPixels_::ConstLine::ConstLine(const PixelType * _begin, size_t stride, size_t componentsPerPixel, size_t lineNum, ofPixelFormat pixelFormat) +inline ofPixels_::ConstLine::ConstLine(const PixelType * _begin, size_t stride, size_t componentsPerPixel, size_t lineNum, ofPixelFormat _pixelFormat) :_begin(_begin) ,_end(_begin+stride) ,stride(stride) @@ -1476,7 +1479,7 @@ inline typename ofPixels_::ConstPixels ofPixels_::ConstLin //---------------------------------------------------------------------- template -inline ofPixels_::ConstLines::ConstLines(const PixelType * _begin, const PixelType * _end, size_t stride, size_t componentsPerPixel, size_t lines, ofPixelFormat pixelFormat) +inline ofPixels_::ConstLines::ConstLines(const PixelType * _begin, const PixelType * _end, size_t stride, size_t componentsPerPixel, size_t lines, ofPixelFormat _pixelFormat) :_begin(_begin) ,_end(_end) ,stride(stride) diff --git a/scripts/ci/linuxrpi/install.sh b/scripts/ci/linuxrpi/install.sh index f236fd122a7..93ec8f967d1 100755 --- a/scripts/ci/linuxrpi/install.sh +++ b/scripts/ci/linuxrpi/install.sh @@ -25,10 +25,14 @@ ROOT=$( cd "$(dirname "$0")" ; pwd -P ) echo $ROOT cd $ROOT +echo "##[group] Setup Multistrap ${MULTISTRAP_ARCH}" mkdir -p raspbian/etc/apt/apt.conf.d/ echo 'Acquire::AllowInsecureRepositories "true";' | sudo tee raspbian/etc/apt/apt.conf.d/90insecure multistrap -a ${MULTISTRAP_ARCH} -d raspbian -f multistrap.conf +echo "##[endgroup]" if [ ${MULTISTRAP_ARCH} = "armhf" ]; then +echo "##[group] Clone Userland" git clone https://github.com/raspberrypi/userland --depth 1 raspbian/userland +echo "##[endgroup]" fi