A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/image__grabber_8cpp_source.html below:

NCBI C++ ToolKit: src/gui/widgets/wx/image_grabber.cpp Source File

68

: m_GuidesEnabled(

false

)

71

, m_TileAspectRatio(-1.0f)

72

, m_ImageAspectRatio(-1.0f)

73

, m_DisableGouraudShaded(

false

)

96  if

(progress !=

NULL

)

99  if

(!glewIsSupported(

"GL_EXT_framebuffer_object"

)) {

100  _TRACE

(

"Opengl: Feature not available"

);

104

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

111  CImage

img(tex_size, tex_size, 4);

123

glGetIntegerv(GL_PACK_ALIGNMENT, &alignment);

124

glPixelStorei(GL_PACK_ALIGNMENT, 1);

130

glDisable(GL_TEXTURE_2D);

153  if

(img.

GetWidth

() != capture_size.

X

() ||

155

img.

Init

(capture_size.

X

(), capture_size.

Y

(), 4);

158

glReadPixels(0, 0, (GLsizei)capture_size.

X

(), (GLsizei)capture_size.

Y

(),

159

GL_RGBA, GL_UNSIGNED_BYTE, img.

SetData

());

171  else if

(progress !=

NULL

) {

185

glPixelStorei(GL_PACK_ALIGNMENT, alignment);

202  if

(!glewIsSupported(

"GL_EXT_framebuffer_object"

)) {

203  _TRACE

(

"Opengl: Feature not available"

);

207

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

219

glGetIntegerv(GL_PACK_ALIGNMENT, &alignment);

220

glPixelStorei(GL_PACK_ALIGNMENT, 1);

224

glDisable(GL_TEXTURE_2D);

243  if

(img->

GetWidth

() != capture_size.

X

() ||

245

img->

Init

(capture_size.

X

(), capture_size.

Y

(), 3);

248

glReadPixels(0, 0, (GLsizei)capture_size.

X

(), (GLsizei)capture_size.

Y

(),

249

GL_RGB, GL_UNSIGNED_BYTE, img->

SetData

());

255

glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);

256

glDrawBuffer(GL_BACK);

257

glReadBuffer(GL_BACK);

264

glPixelStorei(GL_PACK_ALIGNMENT, alignment);

274  int

ref_img_width,

int

ref_img_height,

282  if

(!glewIsSupported(

"GL_EXT_framebuffer_object"

)) {

283  _TRACE

(

"Opengl: Feature not available"

);

292  int

ref_image_size = 64;

293  while

(ref_image_size <

size

)

303

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

305  int

target_tile_width, target_tile_height;

306

vector<IImageGrabberProgress::CTileOrigin> tile_positions;

307

tile_positions = p->

GetTileLocations

(target_tile_width, target_tile_height);

314  float

tile_scale_x = ((float)ref_image_size)/(float)tiled_width;

315  float

tile_scale_y = ((float)ref_image_size)/(float)tiled_height;

335

glDisable(GL_TEXTURE_2D);

364  int

originx = tile_pos.

m_TileIndex

.

X

()*target_tile_width*tile_scale_x;

366

target_tile_height*tile_scale_y;

372

glViewport(originx, originy,

373

(

int

)((

float

)target_tile_width)*tile_scale_x + 1,

374

(

int

)((

float

)target_tile_height)*tile_scale_y + 1);

375

glColor4f(1.0f, 1.0f, 1.0f, 1.0f);

377

glMatrixMode(GL_MODELVIEW);

381

glMatrixMode(GL_PROJECTION);

384

gluOrtho2D(0.0, 1.0, 0.0, 1.0);

386

glEnable(GL_TEXTURE_2D);

387

glBindTexture(GL_TEXTURE_2D, tile_buffer.

GetTexture

());

389  float

capture_ratiox = ((float)capture_size.

X

())/(

float

)tex_size;

390  float

capture_ratioy = ((float)capture_size.

Y

())/(

float

)tex_size;

393

glTexCoord2f(0.0f, 0.0f);

394

glVertex3f(0.0f, 0.0f, 0.0f);

396

glTexCoord2f(capture_ratiox, 0.0f);

397

glVertex3f(1.0f, 0.0f, 0.0f);

399

glTexCoord2f(capture_ratiox, capture_ratioy);

400

glVertex3f(1.0f, 1.0f, 0.0f);

402

glTexCoord2f(0.0f, capture_ratioy);

403

glVertex3f(0.0f, 1.0f, 0.0f);

409

glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);

410

glDrawBuffer(GL_BACK);

411

glReadBuffer(GL_BACK);

416

glMatrixMode(GL_PROJECTION);

423

glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);

424

glDrawBuffer(GL_BACK);

425

glReadBuffer(GL_BACK);

475

glViewport(0, 0, (GLsizei)capture_size.

X

(), (GLsizei)capture_size.

Y

());

476

glMatrixMode(GL_PROJECTION);

479

glOrtho(0.0, (

double

)capture_size.

X

(),

480

0.0, (

double

)capture_size.

Y

(),

483

glMatrixMode(GL_MODELVIEW);

487

glColor3f(0.7f, 0.7f, 0.7f);

489

glEnable(GL_LINE_STIPPLE);

490

glLineStipple(8, (

short

)0x0307);

495

glBegin(GL_LINE_LOOP);

506

glDisable(GL_LINE_STIPPLE);

518

font_height =

std::max

(font_height, (

unsigned int

)8);

521

glColor3f(1.0f, 0.0f, 0.0f);

525  if

(image_name !=

""

) {

526  int

text_width = (

int

)img_name_font.

TextWidth

(image_name.c_str());

528

((

int

)capture_size.

Y

()) - (font_height+2),

532

glColor3f(0.25f, 0.25f, 0.25f);

536  if

(image_bottom !=

""

) {

538  int

text_width = (

int

)img_name_font.

TextWidth

(image_bottom.c_str());

539

img_name_font.

WriteText

(((

int

)capture_size.

X

())/2-text_width/2,

541

image_bottom.c_str());

544  if

(image_top !=

""

) {

546  int

text_width = (

int

)img_name_font.

TextWidth

(image_top.c_str());

547

img_name_font.

WriteText

(((

int

)capture_size.

X

())/2-text_width/2,

548

((

int

)capture_size.

Y

())-(font_height+2),

552  if

(image_right !=

""

) {

554  int

text_width = (

int

)img_name_font.

TextWidth

(image_right.c_str());

555

img_name_font.

WriteText

(((

int

)capture_size.

X

()) - 4,

556

((

int

)capture_size.

Y

())/2-text_width/2,

557

image_right.c_str(), 90.0f);

560  if

(image_left !=

""

) {

562  int

text_width = (

int

)img_name_font.

TextWidth

(image_left.c_str());

563

img_name_font.

WriteText

(font_height + 2,

564

((

int

)capture_size.

Y

())/2-text_width/2,

565

image_left.c_str(), 90.0f);

569

glMatrixMode(GL_MODELVIEW);

572

glMatrixMode(GL_PROJECTION);

virtual void ReleaseTexture()

Releases ownership of texture so it isn't deleted with framebuffer.

void SetTextureWrap(GLint wraps, GLint wrapt)

Set texture paramters, if needed. Call before calling CreateFrameBuffer.

void MakeCurrent(bool b)

Makes this framebuffer the current rendering target if b==true, and if b==false, makes the rendering ...

virtual void GenerateMipMaps()

Generates mipmaps for the texture rendering target.

static bool CheckFBOError()

Returns true and writes error message if framebuffer is invalid.

virtual void SetTextureFiltering(GLint min_filter, GLint mag_filter)

Set texture filtering parameters (default: GL_LINEAR)

virtual bool IsValid()

Returns true if framebuffer was created successfully.

virtual void CreateFrameBuffer()

Create, set and validate framebuffer.

static IImageGrabber * CreateImageGrabber(EOutputFormat format, IVectorGraphicsRenderer &pane)

static bool WriteImage(const CImage &image, CNcbiOstream &ostr, EType type, ECompress compress=eCompress_Default)

static EType GetTypeFromFileName(const string &file)

size_t GetWidth(void) const

void Init(size_t width, size_t height, size_t depth)

size_t GetHeight(void) const

unsigned char * SetData(void)

virtual void ImageSaved(int, int)

virtual void SetGLContext()

virtual void SetPreviewSubImage(CRef< CImage >)

Set an image to be displayed in the center of the widget.

virtual void SetReferenceImage(CGlTexture *refimg)

Return texture so that the preview image can be updated.

virtual vector< CTileOrigin > GetTileLocations(int &w, int &h)

Get locations (origin and size) of individual image tiles.

std::string m_BaseImageName

Image name without its appended number (e.g. img for img1, img2...)

std::string x_GetImageName(int x, int y)

Return image filename for a tile index based on the numbering scheme.

eCaptureResult PreviewImages(int tex_size, int ref_img_width, int ref_img_height, IImageGrabberProgress *p=NULL)

Grab images to update the on-screen image to approximate final output.

virtual eCaptureResult GrabImages(int tex_size, IImageGrabberProgress *p=NULL)

Grab the requested images.

std::string m_Directory

Target directory for saved images.

std::string m_ImageFormat

Image output format (e.g. jpeg, png...)

void x_RenderGuides(CVect2< size_t > capture_size, const std::string &image_name, std::string image_bottom, std::string image_right, std::string image_top, std::string image_left)

Render guides around image edge (cut marks + adjacent image names)

eImageNumberingFormat m_NumberingFormat

Numbering format, such as sequential or tiled (x and y)

virtual void x_EndCaptures()

Called after last image captured.

bool m_GuidesEnabled

If true, printing guides (like where to cut paper) will be added to image edges.

int m_GuideWidthX

If we are making space for printing guides (margins) on the sides, those margins may have different s...

virtual void x_BeginCaptures(int)

Called before first image captured.

virtual eCaptureResult x_CaptureImage(CVect2< int > partitions, CVect2< int > index, CVect2< size_t > &capture_size)

Must be subclassed to capture an individual image.

CVect2< int > m_ImagePartitions

Number of partitions (tilings) in x and 1.

CIRef< IRender > m_SavedRender

eCaptureResult GrabImage(int tex_size, CVect2< int > img_idx, IImageGrabberProgress *p=NULL)

Grab a single image for preview purposes.

void SetOutputInfo(const std::string &dir, const std::string &base_name, const std::string &img_format)

Set file output information.

Interface class for the pdf renderer.

Include a standard set of the NCBI C++ Toolkit most basic headers.

#define NCBI_THROW(exception_class, err_code, message)

Generic macro to throw an exception, given the exception class, error code and message string.

static string ConcatPath(const string &first, const string &second)

Concatenate two parts of the path for the current OS.

static CGlResMgr & Instance()

CIRef< IRender > GetCurrentRenderer()

Returns current renderer, or NULL.

void WriteText(TModelUnit x, TModelUnit y, const char *text, TModelUnit rotate_degrees=0.0) const

Write text at specified model coords.

void SetFontFace(EFontFace face, bool use_bitmap_overrides=true)

void BeginText() const

WriteText interface The WriteText functions produce the same results as TextOut but they are more eff...

static bool CheckGlError()

Check if there are any OpenGL errors.

void SetCurrentRenderer(CIRef< IRender > rm)

Set current renderer (rm must already be in m_Renderers)

void EndText() const

Pops matrices and attributes after writing text.

virtual TModelUnit TextWidth(const char *text) const

Compute and return font metrics.

void SetFontSize(unsigned int size)

Set/get font size in points.

#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.

unsigned int

A callback function used to compare two keys in a database.

The blob sat and sat key Both must be positive integers</td > n< td > Non empty string The interpretation of the blob id depends on a processor Cassandra n processor expects the following format

const struct ncbi::grid::netcache::search::fields::SIZE size

Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...

CVect2< int > m_TileIndex


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