
Recherche avancée
Médias (91)
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
-
Les Miserables
4 juin 2012, par
Mis à jour : Février 2013
Langue : English
Type : Texte
-
Ne pas afficher certaines informations : page d’accueil
23 novembre 2011, par
Mis à jour : Novembre 2011
Langue : français
Type : Image
-
The Great Big Beautiful Tomorrow
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
-
Richard Stallman et la révolution du logiciel libre - Une biographie autorisée (version epub)
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (58)
-
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...) -
XMP PHP
13 mai 2011, parDixit Wikipedia, XMP signifie :
Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)
Sur d’autres sites (2915)
-
Evolution #4080 : Raccourci puce : se débarasser de l’image
28 septembre 2018, par cedric -Je note que la demande initiale simple était "ne plus avoir une image sur cette puce parce qu’on ne peut pas la personaliser" et qu’à la fin il s’agit de tout revoir le fonctionnement des raccourcis SPIP et donc qu’on ne fera rien :)
Pour revenir au point de départ :
1/ peut-être ça manque de documentation mais la puce est totalement personnalisable via le
mes_options.php
:$GLOBALS[’puce’] = ’’ ; $GLOBALS[’puce_rtl’] = ’’ ; $GLOBALS[’puce_prive’] = ’’ ; $GLOBALS[’puce_prive_rtl’] = ’’ ;
2/ ça paraitrait moderne de passer à une puce unicode par défaut décorée en CSS avec un fallback texte pour les sites qui upgraderont sans avoir la CSS qui va bien
—
avec les styles suivants :
.spip-puce b display:none ;
.spip-puce
position : relative ;
top : 1px ;
display : inline-block ;
font-style : normal ;
font-weight : normal ;
line-height : 1 ;
-webkit-font-smoothing : antialiased ;
-moz-osx-font-smoothing : grayscale ;
.spip-puce:before
content : "\2023" ;
Avec puce à choisir parmi
https://unicode-table.com/fr/2023/
https://unicode-table.com/fr/25B8/
https://unicode-table.com/fr/25B6/Du coup sans ces styles spécifiques, la puce est un simple tiret typographique, et avec les styles c’est un caractère qui s’affiche dans la couleur et taille de texte courante, et stylable
2b/
Voire si on veut faire une transition vraiment smoothly on garde le img actuel en fallback dans le span (au lieu du simple tiret), et il ne s’affichera plus que sur les anciens sites qui n’ont pas ajoutés la nouvelle CSS
(et on prévient que dans une prochaine version cette puce image disparaitra complètement)3/ à partir du moment où on a un plugin qui permet de transformer ces puces en liste je pense que garder le comportement actuel par défaut dans SPIP est pertinent et le plus logique
-
Anomalie #3248 (Nouveau) : Les fonctions parametre_url (js et php) n’insèrent pas correctement les...
26 juillet 2014, par Michel BystranowskiL’appel
parametre_url(’http://domaine/spip.php?t[]=1’,’t’,array(0,2)) ;
retournehttp://domaine/spip.php?t[]=1&t[]=0&t[]=2
au lieu dehttp://domaine/spip.php?t[]=0&t[]=2
Ce problème est présent à la fois dans la version javascript et la version php. Je n’ai testé que sur SPIP 3.0.16.
J’ai un patch qui corrige ça dans les deux cas.
Pour le javascript, il y a une regexp mal échappée, et un appel à la fonction substring avec un index négatif, ce qui n’est pas permis, seule la fonction substr le permet… (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring)
Et dans les deux cas, il faut bien vider les valeurs initiale du tableau dans l’url avant d’ajouter les nouvelles valeurs.
Je joins des fichiers corrigés, et voici un patch :
2 files changed, 9 insertions(+), 3 deletions(-) 2014/ecrire/inc/utils.php | 5 +++++ 2014/prive/javascript/ajaxCallback.js | 7 ++++---
Modified 2014/ecrire/inc/utils.php
diff —git a/2014/ecrire/inc/utils.php b/2014/ecrire/inc/utils.php
index b875aa2..01a7f53 100644
— - a/2014/ecrire/inc/utils.php
+++ b/2014/ecrire/inc/utils.php
@@ -333,6 +333,11 @@ function parametre_url($url, $c, $v=NULL, $sep=’& ;’)
$url[$n] = $r[1].’=’.$u ;
unset($ajouts[$r[1]]) ;
+ // Pour les tableaux on laisse tomber les valeurs de
+ // départ, on remplira à l’étape suivante
+ else
+ unset($url[$n]) ;
+
Modified 2014/prive/javascript/ajaxCallback.js
diff —git a/2014/prive/javascript/ajaxCallback.js b/2014/prive/javascript/ajaxCallback.js
index 118fc31..de434c4 100644
— - a/2014/prive/javascript/ajaxCallback.js
+++ b/2014/prive/javascript/ajaxCallback.js
@@ -809,7 +809,7 @@ function parametre_url(url,c,v,sep,force_vide)
else
a=url ;var regexp = new RegExp(’^(’ + c.replace(’[]’,’[]’) + ’[?] ?)(=.*) ?$’) ;
+ var regexp = new RegExp(’^(’ + c.replace(’[]’,’[]’) + ’[?] ?)(=.*) ?$’) ;
var ajouts = [] ;
var u = (typeof(v) !==’object’) ?encodeURIComponent(v):v ;
var na = [] ;
@@ -829,11 +829,12 @@ function parametre_url(url,c,v,sep,force_vide)
// Ajout. Pour une variable, remplacer au meme endroit,
// pour un tableau ce sera fait dans la prochaine boucleelse if (r[1].substring(-2) != ’[]’)
+ else if (r[1].substr(-2) != ’[]’)
na.push(r[1]+’=’+u) ;
ajouts.push(r[1]) ;
else na.push(args[n]) ;
+ /* Pour les tableaux ont laisse tomber les valeurs de départ, on
+ remplira à l’étape suivante */
else
na.push(args[n]) ; -
Video rendering in OpenGL on Qt5
28 janvier 2016, par BobnonoI’m trying to render my decoded frame from FFMPEG to an QOpenGLWindow.
FFMPEG give me NV12 AVFrame or YUV420p or RGB.
I choose the simplest RGB.I created an c_gl_video_yuv class inherit from QOpenGLWindow and QOpenGLFunctions_3_3.
I want to use shader to draw my rectangle and texture it with the video frame. (for YUV I want the sader to convert it in RGB and apply texture)
my c_gl_video_yuv class is define as below :
class c_gl_video_yuv : public QOpenGLWindow,protected QOpenGLFunctions_3_3_Core
{
public:
c_gl_video_yuv();
~c_gl_video_yuv();
---
void update_texture(AVFrame *frame, int w, int h);
protected:
void initializeGL();
void paintGL();
void resizeGL(int width, int height);
void paintEvent(QPaintEvent *);
private:
---
GLuint textures[2];
---
// Shader program
QOpenGLShaderProgram *m_program;
GLint locVertices;
GLint locTexcoord;
};I initialise the OpenGL :
void c_gl_video_yuv::initializeGL()
{
// Init shader program
initializeOpenGLFunctions();
glGenTextures(2, textures);
/* Apply some filter on the texture */
glBindTexture(GL_TEXTURE_2D, textures[0]);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glBindTexture(GL_TEXTURE_2D, textures[1]);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
qDebug() << "c_gl_video_yuv::initializeGL() initialise shader"<< endl;
m_program = new QOpenGLShaderProgram(this);
m_program->addShaderFromSourceFile(QOpenGLShader::Vertex, ":/shader/Ressources/vertex_yuv.glsl");
m_program->addShaderFromSourceFile(QOpenGLShader::Fragment, ":/shader/Ressources/rgb_to_rgb_shader .glsl");
m_program->link();
// /* Grab location of shader attributes. */
locVertices = m_program->attributeLocation("position");
locTexcoord = m_program->attributeLocation("texpos");
/* Enable vertex arrays to push the data. */
glEnableVertexAttribArray(locVertices);
glEnableVertexAttribArray(locTexcoord);
/* set data in the arrays. */
glVertexAttribPointer(locVertices, 2, GL_FLOAT, GL_FALSE, 0,
&vertices[0][0]);
glVertexAttribPointer(locTexcoord, 2, GL_FLOAT, GL_FALSE, 0,
&texcoords[0][0]);
// GL options
glEnable(GL_DEPTH_TEST);
}And I render
void c_gl_video_yuv::paintGL()
{
qDebug() << "paintGL() set viewport "<* Clear background. */
glClearColor(0.5f,0.5f,0.5f,1.0f);
glClear(GL_COLOR_BUFFER_BIT);
if(first_frame)
{
qDebug() << "paintGL() Bind shader" << endl;
m_program->bind();
/* Get Ytex attribute to associate to TEXTURE0 */
m_program->bindAttributeLocation("Ytex",0);
m_program->bindAttributeLocation("UVtex",1);
qDebug() << "paintGL() Bind texture" << endl;
if(!is_init)
{
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, textures[0]);
glTexImage2D( GL_TEXTURE_2D, 0, GL_RGB, frame_width, frame_height, 0, GL_RGB, GL_UNSIGNED_BYTE, frame_yuv->data[0] );
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, textures[1]);
glTexImage2D( GL_TEXTURE_2D, 0, GL_RGB, frame_width, frame_height, 0, GL_RGB, GL_UNSIGNED_BYTE, frame_yuv->data[0] );
is_init = true;
}
else
{
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, textures[0]);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0,0, frame_width, frame_height, GL_RGB, GL_UNSIGNED_BYTE, frame_yuv->data[0]);
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, textures[1]);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0,0, frame_width, frame_height, GL_RGB, GL_UNSIGNED_BYTE, frame_yuv->data[0]);
}
glVertexAttribPointer(locVertices, 2, GL_FLOAT, GL_FALSE, 0, vertices);
glVertexAttribPointer(locTexcoord, 2, GL_FLOAT, GL_FALSE, 0, texcoords);
glEnableVertexAttribArray(0);
glEnableVertexAttribArray(1);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
glDisableVertexAttribArray(1);
glDisableVertexAttribArray(0);
m_program->release();
}
}the vertex shader is :
#version 330 core
attribute vec3 position;
attribute vec2 texpos;
varying vec2 opos;
void main(void)
{
opos = texpos;
gl_Position = vec4(position, 1.0);
}and the Fragment shader is :
version 330 core
in vec2 TexCoords;
out vec4 color;
uniform sampler2D YImage;
uniform sampler2D UVImage;
const vec3 r_c = vec3(1.164383, 0.000000, 1.596027);
const vec3 g_c = vec3(1.164383, -0.391762, -0.812968);
const vec3 b_c = vec3(1.164383, 2.017232, 0.000000);
const vec3 offset = vec3(-0.0625, -0.5, -0.5);
void main()
{
float y_val = texture(YImage, TexCoords).r;
float u_val = texture(UVImage, TexCoords).r;
float v_val = texture(UVImage, TexCoords).g;
vec3 yuv = vec3(y_val, u_val, v_val);
yuv += offset;
color.r = dot(yuv, r_c);
color.g = dot(yuv, g_c);
color.b = dot(yuv, b_c);
color.a = 1.0;
};(for RGB frame a replace thevec3(1.164383, 0.000000, 1.596027) ; by vec3(1.0, 1.000000, 1.0) ;
So before i receive a frame it render nothing, just a grey window - noarmal
After I receive a frame, the textures are uploaded and the shaders normaly create the player. But nothing appear not even a black rectangle nothing, just plain grey.What is wrong ?
It is not the right way to upload texture, or my vertex are not created ?
of course i declarde my vetrtices eand texture coordonateconst GLfloat vertices[][2] = {
{-1.f, -1.f},
{1.f, -1.f},
{-1.f, 1.f},
{1.f, 1.f}
};
const GLfloat texcoords[][2] = {
{0.0f, 1.0f},
{1.0f, 1.0f},
{0.0f, 0.0f},
{1.0f, 0.0f}
};I am very new to OpenGL so it is quite fuzzy in my head, but I thought it is not really hard to draw a rectangle with a streaming texture.
Maybe i should use vbo or fbo but I still don’t really understand this.If someone can help me, I will appreciate !
Thanks