Skip to content
This repository has been archived by the owner on Oct 15, 2019. It is now read-only.

Commit

Permalink
set layer
Browse files Browse the repository at this point in the history
  • Loading branch information
jvcleave committed Oct 23, 2018
1 parent 3554511 commit 54a14f9
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/DirectDisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class DirectDisplayOptions

doHDMISync = true;
alpha = 255;
layer = 0;
doMirror = false;
rotationIndex = 0;
rotationDegrees =0;
Expand All @@ -35,6 +36,7 @@ class DirectDisplayOptions
int rotationDegrees;
int alpha;
bool doForceFill;
int layer;
};

class DirectDisplay
Expand Down Expand Up @@ -145,7 +147,7 @@ class DirectDisplay

OMX_ERRORTYPE applyConfig()
{
displayConfig.set = (OMX_DISPLAYSETTYPE)(OMX_DISPLAY_SET_DEST_RECT| OMX_DISPLAY_SET_SRC_RECT | OMX_DISPLAY_SET_FULLSCREEN | OMX_DISPLAY_SET_NOASPECT | OMX_DISPLAY_SET_TRANSFORM | OMX_DISPLAY_SET_ALPHA | OMX_DISPLAY_SET_MODE);
displayConfig.set = (OMX_DISPLAYSETTYPE)(OMX_DISPLAY_SET_DEST_RECT| OMX_DISPLAY_SET_SRC_RECT | OMX_DISPLAY_SET_FULLSCREEN | OMX_DISPLAY_SET_NOASPECT | OMX_DISPLAY_SET_TRANSFORM | OMX_DISPLAY_SET_ALPHA | OMX_DISPLAY_SET_LAYER | OMX_DISPLAY_SET_MODE);

displayConfig.dest_rect.x_offset = options.drawRectangle.x;
displayConfig.dest_rect.y_offset = options.drawRectangle.y;
Expand All @@ -162,6 +164,7 @@ class DirectDisplay
displayConfig.transform = (OMX_DISPLAYTRANSFORMTYPE)options.rotationIndex;
//int alpha = (ofGetFrameNum() % 255);
displayConfig.alpha = options.alpha;
displayConfig.layer = options.layer;

if(options.doForceFill)
{
Expand Down Expand Up @@ -248,4 +251,4 @@ class DirectDisplay



};
};
20 changes: 20 additions & 0 deletions src/ofxRPiCameraVideoGrabber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -597,14 +597,28 @@ void ofxRPiCameraVideoGrabber::setDisplayAlpha(int alpha)
if(directEngine)
{
getDisplayManager()->options.alpha = alpha;
getDisplayManager()->applyConfig();
}
}

void ofxRPiCameraVideoGrabber::setDisplayLayer(int layer)
{
if(directEngine)
{
getDisplayManager()->options.layer = layer;
getDisplayManager()->applyConfig();
}
}



void ofxRPiCameraVideoGrabber::setDisplayRotation(int rotationDegrees)
{
if(directEngine)
{
getDisplayManager()->rotateDisplay(rotationDegrees);
getDisplayManager()->applyConfig();

}
}

Expand All @@ -613,6 +627,8 @@ void ofxRPiCameraVideoGrabber::setDisplayDrawRectangle(ofRectangle drawRectangle
if(directEngine)
{
getDisplayManager()->options.drawRectangle = drawRectangle;
getDisplayManager()->applyConfig();


}
}
Expand All @@ -622,6 +638,8 @@ void ofxRPiCameraVideoGrabber::setDisplayCropRectangle(ofRectangle cropRectangle
if(directEngine)
{
getDisplayManager()->options.cropRectangle = cropRectangle;
getDisplayManager()->applyConfig();


}
}
Expand All @@ -631,6 +649,8 @@ void ofxRPiCameraVideoGrabber::setDisplayMirror(bool doMirror)
if(directEngine)
{
getDisplayManager()->options.doMirror = doMirror;
getDisplayManager()->applyConfig();

}
}

Expand Down
1 change: 1 addition & 0 deletions src/ofxRPiCameraVideoGrabber.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ class ofxRPiCameraVideoGrabber
DirectDisplay* getDisplayManager();

void setDisplayAlpha(int);
void setDisplayLayer(int);
void setDisplayRotation(int);
void setDisplayDrawRectangle(ofRectangle);
void setDisplayCropRectangle(ofRectangle);
Expand Down

0 comments on commit 54a14f9

Please sign in to comment.