, m_ReferenceImage(new
CGlTexture(img.GetNCPointer()) )
71, m_ReferenceSubImage(
NULL)
73, m_AspectRatio(-1.0
f)
77, m_RectHeight(0.0
f)
83m_ReferenceImage->SetTexEnv(GL_REPLACE);
85m_RefImageSize =
CVect2<int>(
static_cast<int>(img->GetWidth()),
static_cast<int>(img->GetHeight()));
124 floatw = image_width;
125 floath = image_height;
150 if(aspect_ratio >
r) {
259wxCommandEvent evt(wxEVT_TILE_PREVIEW);
261 floatx = (float)event.GetPosition().x;
262 floaty = (float)(this->GetSize().GetY()-
event.GetPosition().y);
273this->GetParent()->GetEventHandler()->ProcessEvent(evt);
283wxCommandEvent evt(wxEVT_TILE_PREVIEW);
285 floatx = (float)event.GetPosition().x;
286 floaty = (float)(this->GetSize().GetY()-
event.GetPosition().y);
297this->GetParent()->GetEventHandler()->ProcessEvent(evt);
316glEnable(GL_TEXTURE_2D);
317glDisable(GL_LIGHTING);
320glViewport(0, 0, w, h);
321 floatimage_aspect = ((float)w)/(float)h;
323glClearColor(0.5f, 0.5f, 0.5f, 0.0f);
324glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
325glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
327glMatrixMode(GL_MODELVIEW);
331glMatrixMode(GL_PROJECTION);
334gluOrtho2D(0.0, (GLdouble)w, 0.0, (GLdouble)h);
354 if(partitioned_aspect > image_aspect) {
356 floatsingle_tile_height = ((float)h)/(float)(
m_PartitionsY+ 1);
358scale = ((float)w)/(single_tile_width*(float)(
m_PartitionsX+1));
361tiled_h = scale*(float)h;
362tiled_w = tiled_h*partitioned_aspect;
367 floatsingle_tile_width = ((float)w)/(float)(
m_PartitionsX+ 1);
368 floatsingle_tile_height = (1.0f/
m_AspectRatio)*single_tile_width;
369scale = ((float)h)/(single_tile_height*(float)(
m_PartitionsY+1));
372tiled_w = scale*(float)w;
373tiled_h = tiled_w*(1.0f/partitioned_aspect);
387 intimage_w = tiled_w;
388 intimage_h = tiled_h;
389 floatbottom_offset = h-(float)image_h;
396glTexCoord2f(0.0f, 0.0f);
397glVertex3f(0.0f, bottom_offset, 0.0f);
399glTexCoord2f(1.0f, 0.0f);
400glVertex3f((
float)image_w, bottom_offset, 0.0f);
402glTexCoord2f(1.0f, 1.0f);
403glVertex3f((
float)image_w, bottom_offset + (
float)image_h, 0.0f);
405glTexCoord2f(0.0f, 1.0f);
406glVertex3f(0.0f, bottom_offset + (
float)image_h, 0.0f);
411glTexCoord2f(1.0f, 0.0f);
412glVertex3f(0.0f, bottom_offset, 0.0f);
414glTexCoord2f(1.0f, 1.0f);
415glVertex3f((
float)image_w, bottom_offset, 0.0f);
417glTexCoord2f(0.0f, 1.0f);
418glVertex3f((
float)image_w, bottom_offset + (
float)image_h, 0.0f);
420glTexCoord2f(0.0f, 0.0f);
421glVertex3f(0.0f, bottom_offset + (
float)image_h, 0.0f);
425glDisable(GL_TEXTURE_2D);
427glColor3f(1.0f, 0.0f, 0.0f);
460 floatfont_width = (float)name_font.
TextWidth(img_name.c_str());
465 for(fsize=10; fsize<36; fsize+=2) {
467font_width = (float)name_font.
TextWidth(img_name.c_str());
477font_width = (float)name_font.
TextWidth(img_name.c_str());
478font_height = (float)name_font.
TextHeight();
480pos.
Y() = ((float)h) -
m_RectHeight/2.0f - font_height/2.0f;
489font_width = (float)name_font.
TextWidth(
"Saved");
492 for(fsize=10; fsize<36; fsize+=2) {
494font_width = (float)saved_font.
TextWidth(
"Saved");
505 floatsaved_font_xdelta = saved_font_xpos - pos.
X();
508glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
536glColor4f(0.0f, 0.0f, 1.0f, 0.5f);
537name_font.
TextOut(pos.
X(), pos.
Y(), img_name.c_str());
542glColor4f(1.0f, 0.0f, 0.0f, 1.0f);
545glBegin(GL_LINE_LOOP);
546glVertex2f(rect_pos.
X(), rect_pos.
Y());
557glColor4f(1.0f, 0.1f, 0.1f, 1.0f);
558 floatposy = pos.
Y() - (saved_font.
TextHeight() + 3);
559 floatposx = pos.
X() + saved_font_xdelta;
560saved_font.
TextOut(posx, posy,
"Saved");
561glColor4f(0.0f, 0.0f, 1.0f, 0.5f);
563glColor4f(0.1f, 0.1f, 0.1f, 0.2f);
565glVertex2f(rect_pos.
X(), rect_pos.
Y());
571glColor4f(0.0f, 0.0f, 1.0f, 0.5f);
588 floatrwidth, rheight;
589 floatref_image_aspect = rw/rh;
591 if(ref_image_aspect > image_aspect) {
603 floatoriginx = (((float)w)-rwidth)/2.0f;
604 floatoriginy = (((float)h)-rheight)/2.0f;
606glEnable(GL_TEXTURE_2D);
608glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
611glTexCoord2f(0.0f, 0.0f);
612glVertex3f(originx, originy, 0);
614glTexCoord2f(1.0f, 0.0f);
615glVertex3f(originx+rwidth, originy, 0);
617glTexCoord2f(1.0f, 1.0f);
618glVertex3f(originx+rwidth, originy+rheight, 0);
620glTexCoord2f(0.0f, 1.0f);
621glVertex3f(originx, originy+rheight, 0);
624glColor4f(0.0f, 0.0f, 1.0f, 1.0f);
626glDisable(GL_TEXTURE_2D);
628glBegin(GL_LINE_LOOP);
629glVertex3f(originx, originy, 0);
630glVertex3f(originx+rwidth, originy, 0);
631glVertex3f(originx+rwidth, originy+rheight, 0);
632glVertex3f(originx, originy+rheight, 0);
635glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
639glMatrixMode(GL_PROJECTION);
642glMatrixMode(GL_MODELVIEW);
645glDisable(GL_TEXTURE_2D);
size_t GetWidth(void) const
size_t GetHeight(void) const
GUI command routing and handling framework.
virtual void MakeCurrent()
virtual void SetFilterMag(GLenum f)
void SetFontFace(EFontFace face, bool use_bitmap_overrides=true)
const CImage * GetImage(void) const
static bool CheckGlError()
Check if there are any OpenGL errors.
virtual TModelUnit TextWidth(const char *text) const
Compute and return font metrics.
virtual TModelUnit TextHeight(void) const
virtual void SetFilterMin(GLenum f)
virtual void TextOut(const char *text) const
TextOut interface Write the specified text and set up state and transformation as needed.
void SetFontSize(unsigned int size)
Set/get font size in points.
void Swallow(CImage *image)
TObjectType * GetNCPointer(void) const THROWS_NONE
Get pointer,.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
const struct ncbi::grid::netcache::search::fields::SIZE size
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4